/*
 * Auth-surface styles — shared by /login, /register, /forgot-password,
 * /password/reset. Two-column newsroom-grade layout: editorial marketing
 * panel on the left, form panel on the right. Collapses to single-column
 * on tablets and below.
 */

/* ---------- Full-bleed page shell ---------- */

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: #f8fafc;
}

.auth-page__brand-bar {
    padding: 20px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page__brand-bar img {
    max-height: 44px;
    width: auto;
}

.auth-page__body {
    display: grid;
    grid-template-columns: 1fr;
    flex: 1;
    min-height: 0;
}

@media (min-width: 1024px) {
    .auth-page__body {
        grid-template-columns: 1.05fr 1fr;
    }
}

/* ---------- Marketing panel (left, desktop only) ---------- */

.auth-marketing {
    display: none;
    padding: 56px 64px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-marketing::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(29, 78, 216, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

@media (min-width: 1024px) {
    .auth-marketing {
        display: flex;
    }
}

.auth-marketing__inner {
    position: relative;
    max-width: 480px;
}

.auth-marketing__eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fca5a5;
    margin: 0 0 16px;
}

.auth-marketing__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 24px;
    color: #ffffff;
}

.auth-marketing__lede {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0 0 32px;
}

.auth-marketing__features {
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
}

.auth-marketing__features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-marketing__features li:last-child {
    border-bottom: none;
}

.auth-marketing__check {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #16a34a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0;
}

.auth-marketing__quote {
    margin: 0;
    padding: 18px 22px;
    border-left: 3px solid #dc2626;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 6px 6px 0;
}

.auth-marketing__quote-text {
    margin: 0 0 8px;
    font-style: italic;
    font-size: 0.98rem;
    line-height: 1.5;
    color: #f1f5f9;
}

.auth-marketing__quote-cite {
    font-size: 0.82rem;
    color: #cbd5e1;
    font-style: normal;
}

.auth-marketing__stat {
    margin-top: 32px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.auth-marketing__stat-number {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.auth-marketing__stat-label {
    font-size: 0.9rem;
    color: #cbd5e1;
}

/* ---------- Form panel (right) ---------- */

.auth-form-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 24px 48px;
    background: #f8fafc;
}

@media (min-width: 1024px) {
    .auth-form-panel {
        padding: 72px 56px 72px;
        align-items: center;
    }
}

.auth-form-panel__inner {
    width: 100%;
    max-width: 460px;
}

/* Replace the existing tw-rounded-md/tw-p-6 card with these so spacing
   scales up at desktop sizes. Tailwind utility classes also win
   specificity-wise so the per-page view markup still uses them but
   these CSS rules add the bigger breathing room. */
.auth-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.08);
    padding: 32px 28px;
}

@media (min-width: 768px) {
    .auth-card {
        padding: 40px 36px;
    }
}

.auth-card__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px;
    color: #0f172a;
}

@media (min-width: 768px) {
    .auth-card__title {
        font-size: 2.1rem;
    }
}

.auth-card__subtitle {
    margin: 0 0 4px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #64748b;
}

.auth-card__cross-link {
    margin: 0;
    font-size: 0.92rem;
    color: #64748b;
}

.auth-card__cross-link a {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
}

.auth-card__cross-link a:hover,
.auth-card__cross-link a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.auth-footer-legal {
    text-align: center;
    padding: 24px 16px 32px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.auth-footer-legal a {
    color: #64748b;
    margin: 0 8px;
    text-decoration: none;
}

.auth-footer-legal a:hover,
.auth-footer-legal a:focus-visible {
    color: #0f172a;
    text-decoration: underline;
    outline: none;
}

/* Legacy/sprint-1 styles still in use — kept as-is below. ----------- */

/* ---------- Skip-to-content link (WCAG 2.4.1 Bypass Blocks) ---------- */
.auth-skip-link {
    position: absolute;
    top: -64px;
    left: 12px;
    z-index: 2000;
    padding: 10px 16px;
    background: #111827;
    color: #ffffff;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: top 150ms ease;
}

.auth-skip-link:focus {
    top: 12px;
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

/* ---------- Brand block ---------- */
.auth-brand__logo {
    max-height: 56px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
    display: block;
}

/* ---------- Password field wrapper + show/hide toggle ---------- */
.auth-password-field {
    position: relative;
}

.auth-password-field input[type="password"],
.auth-password-field input[type="text"] {
    padding-right: 44px !important; /* room for the toggle */
}

.auth-password-toggle {
    position: absolute;
    right: 8px;
    top: 32px;          /* matches the input's offset under the label */
    bottom: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 120ms ease, background-color 120ms ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: #1f2937;
    background: #f3f4f6;
    outline: none;
}

.auth-password-toggle:focus-visible {
    box-shadow: 0 0 0 2px #1d4ed8;
}

/* ---------- Caps Lock warning ---------- */
.auth-capslock-warning {
    margin-top: -8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ---------- Remember-this-device checkbox ---------- */
.auth-remember-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #1d4ed8;
    cursor: pointer;
}

/* ---------- Recovery (Trouble signing in?) ---------- */
.auth-recovery {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.auth-recovery__summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    list-style: none;
    user-select: none;
}

.auth-recovery__summary::-webkit-details-marker { display: none; }

.auth-recovery__summary::before {
    content: '+ ';
    color: #1d4ed8;
    font-weight: 700;
    margin-right: 4px;
}

.auth-recovery[open] .auth-recovery__summary::before {
    content: '− ';
}

.auth-recovery__list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.auth-recovery__list li {
    padding: 4px 0;
}

.auth-recovery__list a {
    color: #1d4ed8;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-recovery__list a:hover,
.auth-recovery__list a:focus-visible {
    text-decoration: underline;
    outline: none;
}

/* ---------- Cloudflare Turnstile widget container ---------- */
.auth-turnstile {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

/* ---------- DPDP Act 2023 consent banner ---------- */

.dpdp-consent {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #7c2d12;
    font-size: 0.85rem;
}

.dpdp-consent__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.dpdp-consent__icon {
    flex: 0 0 20px;
    color: #c2410c;
    margin-top: 2px;
}

.dpdp-consent__text {
    flex: 1 1 220px;
    margin: 0;
    line-height: 1.5;
    min-width: 0;
}

.dpdp-consent__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.dpdp-consent__link {
    background: transparent;
    border: none;
    color: #c2410c;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 6px;
}

.dpdp-consent__cta {
    background: #c2410c;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.dpdp-consent__cta:hover,
.dpdp-consent__cta:focus-visible {
    background: #9a3412;
    outline: none;
}

.dpdp-consent__expanded {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #fdba74;
    font-size: 0.8rem;
    line-height: 1.5;
}

.dpdp-consent__expanded p {
    margin: 0 0 8px;
}

.dpdp-consent__officer--missing small {
    color: #b91c1c;
    font-style: italic;
}

.dpdp-consent__expanded a {
    color: #9a3412;
    text-decoration: underline;
}

/* ---------- OAuth provider buttons ---------- */

.auth-oauth-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: filter 120ms ease, transform 80ms ease;
}

.auth-oauth-provider:hover,
.auth-oauth-provider:focus-visible {
    filter: brightness(0.96);
    outline: none;
    text-decoration: none;
}

.auth-oauth-provider:active {
    transform: translateY(1px);
}

.auth-oauth-provider__icon {
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (prefers-color-scheme: dark) {
    .dpdp-consent {
        background: #3b1f0a;
        border-color: #9a3412;
        color: #fed7aa;
    }

    .dpdp-consent__icon,
    .dpdp-consent__link {
        color: #fdba74;
    }

    .dpdp-consent__expanded {
        border-top-color: #9a3412;
    }

    .dpdp-consent__expanded a {
        color: #fdba74;
    }

    /* Apple-button keeps black-on-white on dark mode too (HIG recommendation
       for "Sign in with Apple" — invert via white-on-dark not supported in
       a strict reading of the brand guidelines). */
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
    .auth-skip-link {
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    .auth-capslock-warning {
        background: #3b2f0e;
        border-color: #78651e;
        color: #fcd34d;
    }

    .auth-recovery {
        background: #1f2937;
        border-color: #374151;
    }

    .auth-recovery__summary {
        color: #e5e7eb;
    }

    .auth-recovery__list a {
        color: #93c5fd;
    }
}
