/* Login / auth screen — fixed brand aesthetic (navy panel + light form),
   theme-independent by design. Standalone: does NOT use the admin --ad-*
   tokens, so the OS dark preference doesn't flip this page. Self-hosted
   Manrope (same face as the kiosk + public site). */
@font-face {
    font-family: "Manrope";
    src: url("/static/fonts/Manrope-VariableFont_wght.woff2") format("woff2");
    font-weight: 200 800; font-display: swap;
}

:root {
    --navy: #0f335e; --navy-deep: #0a2542; --navy-abyss: #06182d;
    --teal: #2bb3a3; --teal-deep: #1f8e82;
    --ink: #1b2733; --muted: #5c6b7b; --line: #e6ecf2;
    --surface: #ffffff; --tint: #f6f9fc;
    --ease: cubic-bezier(.22, 1, .36, 1);
    color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }

.auth {
    font-family: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--ink); min-height: 100dvh;
    display: grid; grid-template-columns: 1fr; background: var(--surface);
}
@media (min-width: 900px) { .auth { grid-template-columns: 46fr 54fr; } }

/* ---------- Flash messages (login errors) — floating toast ---------- */
.flashes {
    position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 200;
    list-style: none; margin: 0; padding: 0; width: min(420px, calc(100% - 2rem));
    display: flex; flex-direction: column; gap: .5rem;
    font-family: "Manrope", system-ui, sans-serif; cursor: pointer;
    transition: opacity .4s ease;
}
.flashes.is-fading { opacity: 0; }
.flashes li {
    padding: .7rem 1rem; border-radius: 10px; font-size: .92rem; font-weight: 600;
    background: #e5f6f3; color: #0f6e56; border: 1px solid #9fe1cb;
    box-shadow: 0 12px 30px -14px rgba(16, 54, 99, .4);
}
.flashes li.flash--error { background: #fdecec; color: #a3272c; border-color: #f3b9bb; }

/* ---------- Brand panel ---------- */
.brand {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(155deg, var(--navy) 0%, var(--navy-deep) 55%, var(--navy-abyss) 100%);
    padding: clamp(1.6rem, 3vw, 2.6rem);
    display: flex; flex-direction: column; gap: 1.5rem; min-height: 240px;
}
.brand::before, .brand::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0;
}
.brand::before {
    width: 34vw; height: 34vw; max-width: 460px; max-height: 460px; top: -8vw; right: -6vw;
    background: radial-gradient(circle, rgba(43,179,163,.62), transparent 70%);
    animation: driftA 19s ease-in-out infinite;
}
.brand::after {
    width: 28vw; height: 28vw; max-width: 380px; max-height: 380px; bottom: -10vw; left: -8vw;
    background: radial-gradient(circle, rgba(70,130,200,.4), transparent 70%);
    animation: driftB 23s ease-in-out infinite;
}
@keyframes driftA { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-2vw,3vw) scale(1.1)} }
@keyframes driftB { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(3vw,-2vw) scale(1.08)} }
.brand > * { position: relative; z-index: 1; }

.wordmark { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; text-decoration: none; color: #fff; }
.wordmark .chirp { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.wordmark .chirp span { width: 4px; border-radius: 2px; background: var(--teal); }
.wordmark .chirp span:nth-child(1) { height: 9px; animation: bar 1.6s var(--ease) infinite; }
.wordmark .chirp span:nth-child(2) { height: 18px; animation: bar 1.6s var(--ease) .2s infinite; }
.wordmark .chirp span:nth-child(3) { height: 13px; animation: bar 1.6s var(--ease) .4s infinite; }
@keyframes bar { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(.55)} }

.brand__body { margin-top: auto; margin-bottom: auto; display: flex; flex-direction: column; gap: 1.6rem; }
.eyebrow {
    align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem;
    padding: .32rem .8rem; border-radius: 999px; font-size: .74rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    background: rgba(43,179,163,.16); color: #8fe6d8; border: 1px solid rgba(43,179,163,.32);
}
.brand h1 {
    margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.12; font-weight: 800;
    letter-spacing: -.02em; text-wrap: balance; max-width: 15ch;
}
.brand h1 .hl { color: #4fd6c4; }
.brand__sub { margin: 0; color: rgba(255,255,255,.72); font-size: 1.02rem; line-height: 1.55; max-width: 34ch; }

/* Mini product card — the real kiosk moment */
.kiosk {
    align-self: flex-start; width: min(320px, 100%);
    background: linear-gradient(160deg, #0d2036, #081627);
    border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
    padding: 1.1rem 1.1rem 1.2rem; box-shadow: 0 30px 60px -28px rgba(0,0,0,.7);
    animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.kiosk__tag { display: inline-flex; align-items: center; gap: .4rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7fd8ca; margin-bottom: .7rem; }
.kiosk__tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.kiosk__q { margin: 0 0 .9rem; font-size: 1.06rem; font-weight: 700; color: #eaf1f7; line-height: 1.3; }
.kiosk__q .hl { color: #4fd6c4; }
.kiosk__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kiosk__opt {
    display: flex; align-items: center; justify-content: space-between;
    padding: .55rem .7rem; border-radius: 10px; font-size: .84rem; font-weight: 600; color: #cdd8e2;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
}
.kiosk__opt.is-on { background: rgba(43,179,163,.16); border-color: rgba(43,179,163,.55); color: #eafaf7; }
.kiosk__opt .ring { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.kiosk__opt.is-on .ring { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 2px #0d2036; }

.brand__foot { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; color: rgba(255,255,255,.62); font-size: .84rem; font-weight: 600; }
.brand__foot span { display: inline-flex; align-items: center; gap: .4rem; }
.brand__foot svg { width: 15px; height: 15px; color: var(--teal); }

/* ---------- Form panel ---------- */
.panel { display: flex; align-items: center; justify-content: center; padding: clamp(1.8rem, 5vw, 3.5rem); background: var(--surface); }
.form-card { width: 100%; max-width: 380px; }
.form-card h2 { margin: 0 0 .35rem; font-size: 1.8rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.form-card .intro { margin: 0 0 2rem; color: var(--muted); font-size: 1rem; }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.15rem; }
.field > label { font-size: .84rem; font-weight: 700; color: var(--ink); }
.field__wrap { position: relative; display: flex; align-items: center; }
.field__wrap > svg.lead { position: absolute; left: .8rem; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.field input {
    width: 100%; height: 48px; padding: 0 .9rem 0 2.5rem; font: inherit; font-size: .98rem;
    color: var(--ink); background: var(--tint); border: 1.5px solid var(--line); border-radius: 11px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field__wrap:has(.toggle) input { padding-right: 3rem; }
.field input::placeholder { color: #9aa8b5; }
.field input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(43,179,163,.16); }
.field .toggle {
    position: absolute; right: .35rem; height: 34px; width: 34px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.field .toggle:hover { background: var(--line); color: var(--ink); }
.field .toggle svg { width: 19px; height: 19px; }

/* Password hint + inline validation errors (reset / invite) */
.hint { margin: -.35rem 0 1.4rem; font-size: .82rem; color: var(--muted); }
.auth-errors { background: #fdecec; border: 1px solid #f3b9bb; border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1.3rem; }
.auth-errors ul { margin: 0; padding-left: 1.1rem; }
.auth-errors li { color: #a3272c; font-size: .9rem; font-weight: 600; }
.form-card .intro strong { color: var(--ink); font-weight: 700; }

/* Multi-hat chooser options */
.hat-stack { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; }
.hat-option {
    display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem;
    border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
    background: var(--tint); transition: border-color .15s ease, background .15s ease;
}
.hat-option:hover { border-color: #c3cfdb; background: #eef3f8; }
.hat-option:has(input:checked) { border-color: var(--teal); background: #eafaf6; }
.hat-option:focus-within { box-shadow: 0 0 0 3px rgba(43,179,163,.22); }
.hat-option input { accent-color: var(--teal); width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
.hat-option__name { font-weight: 700; color: var(--ink); font-size: .96rem; margin-right: auto; }
.hat-option__role {
    font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    color: var(--teal-deep); background: #e5f6f3; padding: .22rem .55rem; border-radius: 999px; white-space: nowrap;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -.15rem 0 1.5rem; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 19px; height: 19px; flex: 0 0 19px; border-radius: 6px; border: 1.5px solid #c3cfdb; background: #fff; display: flex; align-items: center; justify-content: center; transition: all .15s ease; }
.check .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.6); transition: all .15s ease; }
.check input:checked + .box { background: var(--teal); border-color: var(--teal); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(43,179,163,.25); }
.row > a { color: var(--teal-deep); font-size: .9rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.row > a:hover { text-decoration: underline; }

.submit {
    position: relative; overflow: hidden; width: 100%; height: 50px; border: none; border-radius: 12px;
    font: inherit; font-size: 1rem; font-weight: 700; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    box-shadow: 0 12px 26px -12px rgba(31,142,130,.85);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s ease;
}
.submit:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px rgba(31,142,130,.95); filter: brightness(1.04); }
.submit:active { transform: translateY(0); }
.submit svg { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.submit:hover svg { transform: translateX(3px); }
.submit::after {
    content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.4), transparent);
    transform: skewX(-20deg); transition: left .6s var(--ease);
}
.submit:hover::after { left: 130%; }

.divider { display: flex; align-items: center; gap: .9rem; margin: 1.8rem 0 1.4rem; color: #9aa8b5; font-size: .82rem; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alt { text-align: center; font-size: .95rem; color: var(--muted); margin: 0; }
.alt a { color: var(--teal-deep); font-weight: 700; text-decoration: none; }
.alt a:hover { text-decoration: underline; }
.back { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 2rem; color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none; }
.back:hover { color: var(--ink); }
.back svg { width: 15px; height: 15px; }

/* Load-in stagger */
.rise { animation: rise .7s var(--ease) both; }
.d1 { animation-delay: .06s; } .d2 { animation-delay: .13s; } .d3 { animation-delay: .2s; }
.d4 { animation-delay: .27s; } .d5 { animation-delay: .34s; } .d6 { animation-delay: .41s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .brand::before, .brand::after, .kiosk, .wordmark .chirp span { animation: none; }
    .rise { animation: none; }
    .submit::after { display: none; }
}
