/* ============================================================
   AUTH — login, verify-email, forgot/reset password
   A night drive: deep-forest panel with a topo + route motif,
   warm paper card floating over it. "The road is calling."
   ============================================================ */

.auth-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 130% 55% at 50% 118%, rgba(224, 134, 47, 0.16) 0%, transparent 58%),
        radial-gradient(ellipse 85% 55% at 12% -8%, rgba(82, 144, 104, 0.24) 0%, transparent 62%),
        linear-gradient(176deg, #1d3a28 0%, var(--green-950) 58%, #0a1710 100%);
}

/* ------------------------------------------------------------
   Terrain motif — topo contours + a dotted route, drawn once
   per template as an inline SVG. Purely decorative.
   ------------------------------------------------------------ */
.auth-terrain {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-terrain svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Route slowly flows toward the horizon */
.auth-route-path {
    stroke-dasharray: 1 10;
    animation: auth-route-flow 70s linear infinite;
}

@keyframes auth-route-flow {
    to { stroke-dashoffset: -660; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-route-path { animation: none; }
}

/* ------------------------------------------------------------
   Card — warm paper over the dark panel
   ------------------------------------------------------------ */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    padding: 42px 40px 36px;
    background: linear-gradient(180deg, var(--cream-50) 0%, var(--cream-100) 100%);
    border: 1px solid rgba(254, 252, 247, 0.55);
    border-radius: var(--radius-xl);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 8px 28px rgba(5, 14, 9, 0.38),
        0 32px 90px rgba(5, 14, 9, 0.5);
    animation: auth-card-rise 0.6s var(--ease-spring-soft) both;
}

@keyframes auth-card-rise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Brand block --- */
.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--green-600) 0%, var(--green-800) 100%);
    color: var(--cream-50);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 4px 14px rgba(42, 83, 57, 0.35);
    margin-bottom: 12px;
    animation: pop-in 0.55s var(--ease-spring) 0.16s both;
}

.auth-logo h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 680;
    color: var(--green-800);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.auth-logo .tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 0.94rem;
    color: var(--brown-500);
    margin-top: 4px;
}

/* Dotted route divider under the brand */
.auth-logo::after {
    content: '';
    display: block;
    width: 76px;
    height: 2px;
    margin: 16px auto 0;
    background-image: repeating-linear-gradient(90deg,
        var(--brown-300) 0 6px,
        transparent 6px 13px);
    border-radius: 2px;
    opacity: 0.75;
}

/* --- Headings --- */
.auth-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 660;
    letter-spacing: -0.015em;
    color: var(--brown-900);
    margin-bottom: 20px;
    text-align: center;
    animation: rise-in 0.5s var(--ease-out) 0.08s both;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: -12px 0 22px;
    line-height: 1.55;
    animation: rise-in 0.5s var(--ease-out) 0.12s both;
}

.auth-subtitle strong {
    color: var(--brown-700);
}

/* --- Form --- */
.auth-form {
    margin-bottom: 0;
    animation: rise-in 0.5s var(--ease-out) 0.16s both;
}

.auth-form-secondary {
    margin-top: 12px;
}

/* Label warms up when its field takes focus */
.auth-card .field:focus-within label {
    color: var(--green-700);
    transition: color var(--duration-fast) ease;
}

.auth-forgot {
    text-align: right;
    margin: -8px 0 12px;
    font-size: 0.85rem;
}

.auth-form .btn-primary {
    margin-top: 8px;
    padding: 13px;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

/* --- 6-digit code entry — one input, ticket-stub presence --- */
.auth-form input.code-input {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.48em;
    text-indent: 0.24em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding: 16px 12px 14px;
    color: var(--brown-900);
    background: linear-gradient(180deg, var(--cream-50) 0%, var(--cream-100) 100%);
    border: 1.5px dashed var(--brown-300);
    border-radius: var(--radius-lg);
    caret-color: var(--sun-500);
    transition: border-color var(--duration-fast) ease,
        box-shadow var(--duration-base) var(--ease-out),
        background var(--duration-fast) ease;
}

.auth-form input.code-input::placeholder {
    color: var(--cream-300);
    letter-spacing: 0.48em;
    font-weight: 600;
}

.auth-form input.code-input:focus {
    border-style: solid;
    border-color: var(--green-700);
    background: var(--cream-50);
    box-shadow: var(--ring-primary), 0 4px 18px rgba(62, 122, 84, 0.12);
}

@media (max-width: 768px) {
    /* Stay above base.css's 16px floor while keeping the big digits */
    .auth-form input.code-input {
        font-size: 1.5rem !important;
    }
}

/* --- Footer links --- */
.auth-switch {
    text-align: center;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-top: 22px;
    animation: rise-in 0.5s var(--ease-out) 0.22s both;
}

/* ------------------------------------------------------------
   Scenic variant — rotating photo backdrop behind the card
   (used on the login page)
   ------------------------------------------------------------ */
.auth-page--scenic {
    background: var(--green-950);
}

.auth-scenic {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.auth-scenic-slide {
    position: absolute;
    inset: -5%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease;
    will-change: opacity, transform;
    /* Slow drift runs on every slide so crossfades never jump */
    animation: auth-scenic-drift 80s ease-in-out infinite alternate;
}

.auth-scenic-slide:nth-child(2n) { animation-delay: -27s; }
.auth-scenic-slide:nth-child(3n) { animation-delay: -54s; }

.auth-scenic-slide.is-visible {
    opacity: 1;
}

@keyframes auth-scenic-drift {
    from { transform: scale(1) translateY(0); }
    to   { transform: scale(1.08) translateY(-1.5%); }
}

/* Scrim: deep-forest wash + a warm campfire horizon so the
   card stays readable over any photo */
.auth-scenic::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 130% 50% at 50% 116%, rgba(224, 134, 47, 0.16) 0%, transparent 58%),
        radial-gradient(ellipse 90% 75% at 50% 44%, rgba(14, 32, 21, 0.2) 0%, rgba(14, 32, 21, 0.66) 100%),
        linear-gradient(180deg, rgba(14, 32, 21, 0.32) 0%, rgba(14, 32, 21, 0.48) 100%);
}

.auth-page--scenic .auth-card {
    background: rgba(254, 252, 247, 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-color: rgba(254, 252, 247, 0.45);
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .auth-page {
        padding: 28px 14px;
    }

    .auth-card {
        padding: 34px 24px 30px;
    }

    .auth-logo {
        margin-bottom: 24px;
    }

    .auth-logo h1 {
        font-size: 1.8rem;
    }
}
