/* ==========================================================================
   Rafiki Tours — sign-in (savanna at dusk + solid ivory / chocolate panel)
   Only this page uses imagery; the operational pages stay compact (site.css).
   ========================================================================== */
:root {
    --sidebar: #2B1B16;
    --ivory: #FFFDF7;
    --canvas: #F5F2E8;
    --gold: #D4A64A;
    --gold-2: #E7C85C;
    --gold-hover: #C69538;
    --gold-line: #B08530;
    --ink: #29241F;
    --ink-2: #4A4237;
    --muted: #6D665A;
    --border: #DED8C9;
    --border-strong: #CBC2AE;
    --danger: #A2412E;  --danger-soft: #F5E2DB;
    --warning: #8A5612; --warning-soft: #F8ECD6;
    --info: #3F6683;    --info-soft: #E4EBF0;
    --on-dark: #F5ECDD;
    --on-dark-soft: rgba(245, 236, 221, .78);
    --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --sans: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 15px; }
.auth-body {
    margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--sans); color: var(--ink);
    background: var(--sidebar); overflow-x: hidden; -webkit-font-smoothing: antialiased;
}

/* ---------- backdrop ---------- */
.scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.auth-photo { position: fixed; inset: 0; z-index: 0; background-size: cover; background-position: center 60%; }
.auth-veil {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, rgba(30, 18, 13, .72) 0%, rgba(30, 18, 13, .38) 45%, rgba(30, 18, 13, .12) 70%, rgba(30, 18, 13, .35) 100%);
}

/* ---------- layout ---------- */
.auth-shell {
    position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh;
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 410px); gap: clamp(24px, 5vw, 80px);
    align-items: center; padding: clamp(24px, 4vw, 52px) clamp(20px, 6vw, 88px);
}
.auth-story { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; color: var(--on-dark); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-dark); text-decoration: none; }
.auth-mark { width: 38px; height: 38px; border-radius: 4px; display: grid; place-items: center; font-size: 1.15rem; color: var(--sidebar); background: var(--gold); }
.auth-name { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.55rem; line-height: 1; }
.auth-sub { display: block; margin-top: 3px; font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); }
.auth-copy { max-width: 560px; }
.auth-kicker { margin: 0 0 10px; font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); }
.auth-copy h1 {
    margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.05; color: #FBF4E6;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .3);
}
.auth-lede { margin: 14px 0 0; max-width: 480px; font-size: 1.05rem; line-height: 1.55; color: var(--on-dark-soft); }
.auth-legal { margin: 0; font-size: .8rem; color: rgba(245, 236, 221, .6); }

/* ---------- panel ---------- */
.auth-panel { background: var(--ivory); border: 1px solid #1E120E; border-radius: 5px; box-shadow: 0 18px 50px rgba(20, 12, 8, .45); overflow: hidden; }
.auth-panel-head {
    display: flex; align-items: center; gap: 8px; padding: 10px 22px; background: var(--sidebar); color: var(--on-dark);
    font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; border-bottom: 3px solid var(--gold);
}
.auth-panel-head i { color: var(--gold-2); }
.auth-panel-body { padding: 24px 24px 20px; }
.glass-head { margin-bottom: 18px; }
.glass-eyebrow { font-size: .8rem; font-weight: 600; color: var(--muted); }
.glass-head h2 { margin: 2px 0 4px; font-family: var(--serif); font-weight: 700; font-size: 2.1rem; line-height: 1; color: var(--ink); }
.glass-head p { margin: 0; color: var(--muted); }

.glass-alert {
    display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; margin-bottom: 16px; border-radius: 4px;
    font-size: .93rem; font-weight: 500; line-height: 1.4; border: 1px solid transparent; border-left-width: 3px;
}
.glass-alert i { margin-top: 1px; }
.glass-alert.info { background: var(--info-soft); border-color: #C7D4DE; border-left-color: var(--info); color: var(--info); }
.glass-alert.warning { background: var(--warning-soft); border-color: #E8D2AA; border-left-color: var(--warning); color: var(--warning); }
.glass-alert.danger { background: var(--danger-soft); border-color: #E3C1B6; border-left-color: var(--danger); color: var(--danger); }
.glass-alert.validation-summary-valid { display: none; }
.glass-alert ul { margin: 0; padding: 0; list-style: none; }

.field { position: relative; margin-bottom: 14px; }
.field label { display: block; margin-bottom: 4px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.field-box {
    display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 11px; border-radius: 4px;
    background: #FFFEFA; border: 1px solid var(--border-strong);
}
.field-box > i { color: var(--muted); font-size: 1rem; }
.field-box:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(176, 133, 48, .3); background: #fff; }
.field-box:focus-within > i { color: #84591A; }
.field-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.field-box input::placeholder { color: #857D6E; }
.field-btn { width: 32px; height: 32px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); }
.field-btn:hover, .field-btn:focus-visible { background: #F1EBDC; color: var(--ink); outline: 0; }
.field:has(.input-validation-error) .field-box { border-color: var(--danger); }
.field-error { display: block; margin-top: 4px; font-size: .86rem; font-weight: 500; color: var(--danger); }
.field-error:empty { display: none; }
.field-hint { display: inline-flex; gap: 6px; margin-top: 4px; font-size: .84rem; color: var(--warning); }
.field-hint[hidden] { display: none; }

.glass-submit {
    position: relative; width: 100%; height: 42px; margin-top: 6px; border: 1px solid var(--gold-line); border-radius: 4px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; color: var(--sidebar);
    background: var(--gold);
}
.glass-submit:hover { background: var(--gold-hover); }
.glass-submit:focus-visible { outline: 2px solid var(--sidebar); outline-offset: 2px; }
.glass-submit .spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(43, 27, 22, .25); border-top-color: var(--sidebar); animation: spin .7s linear infinite; }
.glass-submit.busy .label, .glass-submit.busy > i { display: none; }
.glass-submit.busy .spinner { display: block; }
.glass-foot { display: grid; gap: 4px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .84rem; color: var(--muted); }
.glass-foot i { color: #84591A; margin-right: 4px; }
.glass-link { color: #84591A; font-weight: 600; text-decoration: none; }
.glass-link:hover { text-decoration: underline; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tablet & phone ---------- */
@media (max-width: 1023.98px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 22px; }
    .auth-story { align-self: auto; width: 100%; max-width: 440px; gap: 16px; text-align: center; align-items: center; }
    .auth-copy h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); }
    .auth-lede, .auth-legal { display: none; }
    .auth-panel { width: 100%; max-width: 420px; }
    .auth-veil { background: linear-gradient(0deg, rgba(30, 18, 13, .6) 0%, rgba(30, 18, 13, .3) 55%, rgba(30, 18, 13, .45) 100%); }
}
@media (max-width: 575.98px) {
    .auth-shell { padding: 20px 14px 28px; align-content: start; }
    .auth-kicker { font-size: .7rem; letter-spacing: .12em; }
    .auth-copy h1 { font-size: 1.85rem; }
    .auth-panel-body { padding: 20px 16px 16px; }
    .glass-head h2 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
    .glass-submit .spinner { animation-duration: 1.6s; }
}
