/* =============================================================
   Auth surfaces — sign in / register / password reset.
   Two-column hero+form layout on warm-paper, mono micro-labels,
   0-radius inputs and CTAs. Mirrors the app system rather than
   the legacy marketing skin.
   ============================================================= */

.auth-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-inter);
}

.auth-top-bar {
    position: absolute;
    left: 80px;
    right: 80px;
    top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    z-index: 2;
}

.auth-top-bar .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    text-decoration: none;
}

.auth-top-bar .duck {
    width: 28px;
    height: 22px;
    display: inline-block;
}

.auth-top-bar .wordmark {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
}

.auth-top-bar .nav {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text);
    white-space: nowrap;
}

.auth-body {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(auto, 560px) minmax(auto, 380px);
    align-items: center;
    justify-content: center;
    gap: 80px;
    padding: 0 80px;
}

.auth-hero .eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin: 0 0 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-hero .eyebrow .dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.auth-headline {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 64px;
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: var(--text);
    margin: 0;
}

.auth-headline .acc {
    color: var(--accent);
    font-style: italic;
}

/* Form card */
.form-card {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 28px 28px 24px;
    width: 100%;
    max-width: 380px;
}

.form-card .card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 18px;
    color: var(--text);
}

.form-card .footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    margin-top: 14px;
    border-top: 1px solid var(--border-light);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.form-card .footer-row a,
.form-card .footer-row .footer-link-btn {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.form-card .footer-row .footer-link-btn {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

/* Fields */
.field {
    position: relative;
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field .input,
.field input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 0;
    font-family: var(--font-inter);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field .input::placeholder,
.field input::placeholder {
    color: var(--text-faint);
}

.field .input:focus,
.field input:focus {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.field.has-pw .input,
.field.has-pw input {
    padding-right: 54px;
}

.field .input-wrap {
    position: relative;
}

.field .show-pw {
    position: absolute;
    right: 6px;
    top: 0;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0 8px;
}

.field .show-pw:hover {
    color: var(--accent);
}

.field.err .input,
.field.err input {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.field .field-err {
    margin-top: 6px;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.45;
    color: var(--accent);
}

.field .field-err a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.field .field-hint {
    margin-top: 6px;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}

/* Form-level non-field error block */
.form-error {
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 13px;
    line-height: 1.45;
    padding: 10px 12px;
    margin-bottom: 14px;
}

/* Helper text shown above some single-purpose forms */
.helper-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0 0 18px;
}

.helper-text strong {
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    background: var(--bg-alt);
    padding: 1px 6px;
    border: 1px solid var(--border-light);
}

/* Resend cooldown count */
.resend-count {
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.resend-check {
    color: var(--accent);
    font-weight: 600;
    margin-right: 6px;
}

/* CTA button */
.btn {
    width: 100%;
    height: 44px;
    background: var(--text);
    color: var(--bg);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: background 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn[disabled]:hover {
    background: var(--text);
}

/* Anchor styled as a CTA */
a.btn.btn-link {
    color: var(--bg);
}

a.btn.btn-link:hover {
    color: var(--bg);
}

/* Cloudflare Turnstile widget — match the real widget chrome.
   We deliberately don't try to skin it; the colors below are the
   defaults Cloudflare ships, made aware of our dark mode. */
.cf-turnstile {
    margin-bottom: 14px;
    min-height: 65px;
}

[data-theme="dark"] .cf-turnstile iframe {
    color-scheme: dark;
}

/* Dark theme overrides — uses the existing app-wide [data-theme=dark]
   rather than the design prototype's body.dark selector. */
[data-theme="dark"] .auth-top-bar {
    border-color: var(--border);
}

[data-theme="dark"] .form-card {
    background: var(--bg-alt);
    border-color: var(--border);
}

[data-theme="dark"] .field input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .field input {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .btn {
    background: var(--text);
    color: var(--bg);
}

[data-theme="dark"] .btn:hover {
    background: var(--accent);
    color: var(--text);
}

@media (max-width: 760px) {
    .auth-top-bar {
        left: 24px;
        right: 24px;
        top: 18px;
    }
    .auth-body {
        padding: 88px 24px 32px;
        grid-template-columns: 1fr;
        gap: 24px;
        align-items: start;
        justify-content: start;
        position: relative;
        min-height: 100vh;
    }
    .auth-headline {
        font-size: 36px;
    }
    .form-card {
        justify-self: start;
        max-width: none;
    }
}
