@import url("/css/tokens-de79f75eca920b27ba764af3cf8febf2.css");

/* Shared styling for the unauthenticated pages: login, signup, link-sent.
   Extracted verbatim from the original login page so all auth screens stay in
   lockstep. Additions for the signup/link-sent screens are grouped at the end. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }



html, body {
    height: 100%;
    background: var(--page-bg, var(--bg));
    background-attachment: fixed;
    color: var(--text);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.003em;
}

body::before { display: none; }

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    gap: 0;
}

.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface), var(--bg) 28%) 100%);
    box-shadow: 0 1px 0 var(--card-inset) inset, var(--card-shadow);
    padding: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--teal), var(--border) 58%);
}

.theme-toggle:focus-visible {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 206, 207, 0.12), var(--card-shadow);
}

.theme-toggle-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem;
    border-radius: 9999px;
    background: var(--toggle-track);
    border: 1px solid var(--border-subtle);
}

.theme-chip {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

html[data-theme="light"] .theme-chip-light,
html[data-theme="dark"] .theme-chip-dark {
    background: var(--toggle-thumb);
    color: var(--text);
    box-shadow: 0 8px 18px rgba(26, 206, 207, 0.12);
    transform: translateY(-1px);
}

/* ── Brand ─────────────────────────────────────────────────── */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.brand-img {
    display: block;
    width: 240px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(26,206,207,.16));
}
.brand-img-dark { display: none; }
html[data-theme="dark"] .brand-img-light { display: none; }
html[data-theme="dark"] .brand-img-dark { display: block; }

.brand-sub {
    font-size: 0.625rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2.25rem 2.25rem 2.5rem;
    box-shadow:
        0 0 0 1px var(--card-inset) inset,
        0 24px 60px rgba(42,44,40,.13);
}

.card-heading {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.055em;
    color: var(--text);
    line-height: 0.98;
    margin-bottom: 0.375rem;
}

.card-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.875rem;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--teal-ink);
}

.alert-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* ── Form ──────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.125rem;
}

label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 206, 207, 0.12);
}

input::placeholder {
    color: var(--text-muted);
}

/* ── Button ────────────────────────────────────────────────── */
.btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
    margin-top: 0.75rem;
}

.btn-primary {
    background: linear-gradient(180deg, #22d7d8, #14b9ba);
    color: #042322;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px -6px var(--teal-glow);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #34e0e1, #19c5c6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 30px -6px var(--teal-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* ── Divider / footer ──────────────────────────────────────── */
.page-footer {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.page-footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
}

/* ── Accent line at top of card ────────────────────────────── */
.card::before { display: none; }

@media (max-width: 640px) {
    .page {
        padding-top: calc(5rem + env(safe-area-inset-top));
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
    .theme-toggle {
        position: absolute;
        top: calc(0.85rem + env(safe-area-inset-top));
        right: 0.85rem;
    }
}

/* ══ Additions for signup / passwordless / link-sent ═══════════ */

/* Secondary (outline) button for the "email me a link" alternative. */
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 var(--card-inset);
}

.btn-secondary:hover {
    border-color: color-mix(in srgb, var(--teal), var(--border) 45%);
    background: var(--teal-dim);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* "or" divider between the password form and the magic-link option. */
.divider-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.divider-or::before,
.divider-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Small centered link row under the card ("Already have an account?"). */
.card-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.text-link {
    color: var(--teal-ink);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

/* Big glyph on the "check your email" confirmation card. */
.confirm-glyph {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--teal-dim);
    color: var(--teal-ink);
}

/* Keep the login preparation error absent until there is something to report. */
.alert[hidden] { display: none; }

.remember-login {
    display: flex; align-items: center; gap: .65rem; min-height: 44px;
    margin: 0; cursor: pointer; color: var(--text);
    font-size: .85rem; font-weight: 500; letter-spacing: normal; text-transform: none;
}
.remember-login input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--teal); }
.remember-login input:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.remember-login-help { margin: 0 0 1.25rem 1.8rem; font-size: .75rem; color: var(--text-secondary); line-height: 1.5; }

/* Studio / Night surfaces share the app palette. */
.card { border-radius:14px; box-shadow:none; background:var(--surface); }
.theme-toggle { background:var(--surface); border-radius:9px; box-shadow:none; }
.brand-logo, .logo, .brand-img { filter:none; }
.btn-primary, .btn-primary:hover { border-radius:9px; background:var(--teal); color:#102124; box-shadow:none; }
.btn-primary:hover { background:var(--teal-hover); }
.btn-secondary { border-radius:9px; box-shadow:none; }
input { border-radius:9px; }

:focus-visible { outline:2px solid var(--teal-ink); outline-offset:3px; }
.theme-toggle:focus-visible { outline:2px solid var(--teal-ink); box-shadow:none; }
.card-heading { font-weight:700; letter-spacing:-.04em; line-height:1.15; }

/* ── Depth (DESIGN.md "Depth") ─────────────────────────────────
   A calm light field behind the sign-in card, which becomes level-1 glass.
   z-index 0 keeps the field above the body background and under .page. */
.aurora-field { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; background: var(--field-base); }
.card {
    background: var(--glass-1);
    border-color: var(--glass-edge);
    box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
}
