/* ============================================================================
   TheReceiptHound — Auth surfaces + 404
   login / register / forgot-password / reset-password / verify-email / 404

   Split shell (auth-side.png on login, register-side.png on register),
   1:1 card-top art on the single-card pages (forgot-scent / reset-key /
   verify-mail), captcha row, and the "lost trail" 404 page.

   Relies on the shared design system:
     • form fields are styled by the .form-group descendant rules in
       components.css — no .input classes needed in auth markup;
     • focus rings use the --focus-ring-soft token (variables.css), repainted
       per-tenant by theme.js;
     • .auth-container / .auth-card / .auth-description base styles live in
       layout.css — this file only adds the split shell and auth-only pieces.
   ============================================================================ */

/* ── Split shell: trail art panel + card ── */
.auth-split {
    display: grid;
    grid-template-columns: minmax(300px, 460px) minmax(320px, 440px);
    gap: var(--space-8);
    align-items: stretch;
    justify-content: center;
    width: 100%;
    max-width: 980px;
}

.auth-side {
    position: relative;
    min-height: 460px;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    background: var(--navy-800);
    box-shadow: var(--shadow-xl);
}

.auth-side img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The card centres itself inside its grid column on wide screens. */
.auth-split .auth-card {
    justify-self: center;
    align-self: center;
}

@media (max-width: 899px) {
    .auth-side {
        display: none;
    }

    .auth-split {
        grid-template-columns: minmax(0, 440px);
    }
}

/* ── Brand mark above the card heading ── */
.auth-logo {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-3);
    border-radius: var(--border-radius-full);
    box-shadow: var(--shadow-md);
}

/* ── Card-top scene art (forgot / reset / verify single-card pages) ──
   1:1 illustration inside the card, centered above the h2, so the four
   auth screens feel related but not identical. */
.auth-card-art {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: cover;
    margin: 0 auto var(--space-4);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--hound-100);
}

/* ── Registration captcha ("Human check") ── */
.captcha-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}

.captcha-img {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--color-gray-50);
}

/* Failed challenge load removes src — keep the layout, hide the broken img. */
.captcha-img:not([src]) {
    visibility: hidden;
}

/* ── Success panel (register "check your email", forgot-password sent) ──
   Text-only: the page's own art (side panel / card-top scene) stays
   visible when the form hides, so the panel needs no image of its own. */
.auth-success-panel {
    text-align: center;
    padding: var(--space-2) 0;
}

.auth-success-panel h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent-text);
    margin-bottom: var(--space-2);
}

.auth-success-panel p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.auth-success-actions {
    margin-top: var(--space-5);
}

/* ── Email verification states ── */
.verify-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.verify-success {
    text-align: center;
    color: var(--color-success);
    font-weight: 600;
}

.verify-error {
    display: block;
    text-align: center;
    color: var(--color-danger);
    font-weight: 500;
}

.verify-actions {
    margin-top: var(--space-5);
    text-align: center;
}

/* ── 404 — "The Hound lost this trail." ──
   Served by nginx via `error_page 404 /pages/404.html` at ANY bad URL, so
   the page itself uses absolute asset paths; these styles just center the
   snag-error scene. .art-bob (components.css) supplies the idle float. */
.error-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 64px - 56px);
    padding: var(--space-8) var(--space-4);
    margin: calc(-1 * var(--space-8)) 0;
}

.error-404-art {
    width: min(320px, 70vw);
    height: auto;
    margin-bottom: var(--space-6);
}

.error-404 h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-accent-text);
    margin-bottom: var(--space-3);
}

.error-404-sub {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 46ch;
}

.error-404-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* Torn-receipt seam above the footer — reuses .zigzag-edge from home.css. */
.error-404-band {
    --zigzag-color: var(--navy-50);
    height: 56px;
    background: var(--navy-50);
}
