/* ---------------------------------------------------------------------------
   GT Motors — Night HUD
   Implements "Turn 2 / Night HUD variant" from the Claude Design canvas
   (boards 2a–2f): night navy, neon edge, bracketed HUD panels, mono readouts.

   Visually hands off from the stand's own screen. The design notes it trades
   some direct-sunlight legibility for that, so the brightness here is pushed as
   far as the palette allows: #F2F7FF on #050C1A is ~17:1.
--------------------------------------------------------------------------- */

:root {
    color-scheme: dark;

    --bg:          #050C1A;
    --bg-2:        #0A1631;
    --panel:       rgba(12, 28, 58, .82);
    --field:       rgba(8, 20, 44, .75);
    --line:        rgba(77, 163, 255, .34);
    --line-strong: rgba(77, 163, 255, .62);

    --ink:      #F2F7FF;
    --ink-2:    #A9BEDD;
    --ink-hint: #8DA3C6;
    --ink-foot: #7C93B8;
    --ink-ghost:#6E86AC;

    --neon:   #4DA3FF;
    --neon-2: #38E1FF;
    --ok:     #3BE3A0;
    --danger: #FF6B5E;

    --glow: 0 0 0 1px rgba(77, 163, 255, .28), 0 0 28px rgba(56, 160, 255, .22);

    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --pad: 22px;
}

* { box-sizing: border-box; }

/* .error sets display:flex, which outranks the UA sheet's [hidden]{display:none}
   — without this the empty error rows still paint their "!" bullet. */
[hidden] { display: none !important; }

html { height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    background: linear-gradient(180deg, #071129 0%, #050C1A 55%, #04101F 100%) fixed;
    color: var(--ink);
    font: 16px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

/* Each page is a full-height column: content scrolls, actions stay in the
   thumb zone. 100dvh rather than 100vh so the mobile URL bar doesn't push the
   button off-screen. */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;

    /* Designed at 390px and only ever opened from a QR scan, but staff and the
       client will open it on a laptop. Cap it rather than let a 30-character
       line of Georgian stretch across a desktop. */
    max-width: 430px;
    margin-inline: auto;
}

/* Tone variants — board 2f repaints the whole screen, not just the icon. */
.tone--danger { background: linear-gradient(180deg, #1A0E17 0%, #04101F 45%) fixed; }
.tone--warn   { background: linear-gradient(180deg, #1B1405 0%, #04101F 45%) fixed; }

/* --- header --------------------------------------------------------------- */

.topbar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) var(--pad) 0;
}

.brand { display: flex; align-items: baseline; gap: 8px; }

.brand__gt {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .12em;
}

.brand__motors {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--neon);
}

.lang {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lang__item {
    padding: 8px 14px;
    min-height: 36px;
    display: flex;
    align-items: center;
    font: 700 13px/1 var(--sans);
    color: var(--ink-2);
    text-decoration: none;
}

.lang__item.is-active { background: var(--neon-2); color: #04101F; }

/* --- screen scaffolding --------------------------------------------------- */

.screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.screen__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px var(--pad) 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.screen__body--center {
    justify-content: center;
    align-items: center;
    gap: 26px;
    text-align: center;
    padding: 0 30px;
    overflow: hidden;
}

.screen__actions {
    flex: none;
    padding: 16px var(--pad) max(28px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.screen__foot {
    flex: none;
    margin: 0;
    padding: 0 30px max(44px, env(safe-area-inset-bottom));
    font: 500 11px/1.6 var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-foot);
    text-align: center;
}

/* --- hero (game identity) ------------------------------------------------- */

.hero { display: flex; flex-direction: column; gap: 6px; }

.hero__title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: .01em;
    text-transform: uppercase;
    text-wrap: pretty;
}

.hero__rule { width: 56px; height: 3px; background: var(--neon-2); }

.hero__tag {
    margin: 0;
    font: 400 11px/1.5 var(--mono);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--neon);
}

/* --- HUD reservation panel ------------------------------------------------ */

.hud {
    position: relative;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--glow);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

/* Bracketed corners — the stand screen's own motif. */
.hud::before,
.hud::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
}

.hud::before {
    top: -1px; left: -1px;
    border-top: 2px solid var(--neon-2);
    border-left: 2px solid var(--neon-2);
    border-radius: 12px 0 0 0;
}

.hud::after {
    bottom: -1px; right: -1px;
    border-bottom: 2px solid var(--neon-2);
    border-right: 2px solid var(--neon-2);
    border-radius: 0 0 12px 0;
}

.hud__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.hud__label {
    font: 400 11px/1.5 var(--mono);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.hud__clock {
    flex: none;
    font: 400 26px/1 var(--mono);
    color: var(--neon-2);
    font-variant-numeric: tabular-nums;
}

.hud__bar {
    height: 4px;
    overflow: hidden;
    background: rgba(77, 163, 255, .2);
}

.hud__bar > span {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--neon), var(--neon-2));
    transition: width 1s linear;
}

.hud__sub {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-2);
}

/* --- fields --------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; }

.field__label {
    font: 400 11px/1.4 var(--mono);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.field__hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ink-hint);
}

.input,
.phone {
    height: 56px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--field);
}

.input {
    width: 100%;
    padding: 0 16px;
    color: var(--ink);
    /* 17px, because anything under 16px makes iOS zoom the page on focus and
       the visitor then has to pinch back out mid-form. */
    font: 400 17px/1 var(--sans);
}

.input::placeholder { color: var(--ink-ghost); }

.input:focus-visible,
.phone:focus-within {
    border-color: var(--neon-2);
    box-shadow: 0 0 18px rgba(56, 225, 255, .25);
    outline: none;
}

.phone {
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.phone__prefix {
    flex: none;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-right: 1px solid var(--line);
    background: rgba(77, 163, 255, .14);
    font: 400 17px/1 var(--mono);
    color: var(--neon-2);
}

.phone .input {
    height: auto;
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: none;
    padding: 0 14px;
    font-family: var(--mono);
    letter-spacing: .04em;
}

.phone .input:focus-visible { box-shadow: none; }

/* error state — board 2b */
.field.has-error .input,
.field.has-error .phone {
    border-color: var(--danger);
    background: rgba(60, 16, 20, .5);
    box-shadow: 0 0 20px rgba(255, 107, 94, .22);
}

.field.has-error .phone__prefix {
    background: rgba(255, 107, 94, .14);
    border-right-color: rgba(255, 107, 94, .4);
    color: #FFC4BD;
}

.field.has-error .input { color: #FFEDEB; }

.error {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
    color: #FF9B90;
}

.error::before {
    content: "!";
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--danger);
    color: #2A0704;
    font: 800 12px/18px var(--sans);
    text-align: center;
}

/* --- consent -------------------------------------------------------------- */

.consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-2);
}

.consent input {
    flex: none;
    width: 26px;
    height: 26px;
    margin: 1px 0 0;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--field);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.consent input:checked {
    border-color: var(--neon-2);
    background: var(--neon-2);
}

/* Drawn rather than a glyph, so it can't fall back to a missing font char. */
.consent input:checked::after {
    content: "";
    display: block;
    width: 7px;
    height: 13px;
    margin: 3px auto 0;
    border: solid #04101F;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(42deg);
}

.consent input:focus-visible { outline: 2px solid var(--neon-2); outline-offset: 2px; }

.consent a { color: var(--neon-2); font-weight: 600; }

/* --- primary action ------------------------------------------------------- */

.button {
    width: 100%;
    min-height: 60px;
    padding: 14px 20px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #2E8BFF, #38E1FF);
    color: #04101F;
    font: 800 18px/1.25 var(--sans);
    letter-spacing: .02em;
    text-transform: uppercase;
    box-shadow: 0 0 24px rgba(56, 193, 255, .35);
    cursor: pointer;
}

.button:active { filter: brightness(1.08); }

.footnote {
    margin: 0;
    font: 500 11px/1.5 var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-foot);
    text-align: center;
}

/* --- headline blocks ------------------------------------------------------ */

.headline {
    margin: 0;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: .01em;
    text-transform: uppercase;
    text-wrap: pretty;
}

.headline--lg { font-size: 30px; line-height: 1.15; }

.subhead {
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink-2);
    text-wrap: pretty;
}

.subhead--lg { font-size: 18px; line-height: 1.5; }

.pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 18px;
    font: 500 11px/1.6 var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-2);
    text-align: center;
}

/* --- glyphs --------------------------------------------------------------- */

.glyph { flex: none; display: flex; align-items: center; justify-content: center; }

/* QR in viewfinder brackets — board 2e */
.glyph--qr { position: relative; width: 132px; height: 132px; }

.glyph--qr i {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 0 solid var(--neon-2);
}

.glyph--qr i:nth-child(1) { top: 0; left: 0;    border-top-width: 3px; border-left-width: 3px; }
.glyph--qr i:nth-child(2) { top: 0; right: 0;   border-top-width: 3px; border-right-width: 3px; }
.glyph--qr i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.glyph--qr i:nth-child(4) { bottom: 0; right: 0;border-bottom-width: 3px; border-right-width: 3px; }

.glyph__grid {
    width: 84px;
    height: 84px;
    display: grid;
    grid-template: repeat(3, 1fr) / repeat(3, 1fr);
    gap: 7px;
}

.glyph__grid b { border: 4px solid var(--ink); border-radius: 3px; }
.glyph__grid u { background: var(--neon-2); border-radius: 2px; }
.glyph__grid s { background: var(--ink); border-radius: 2px; }

/* Expired / used — board 2f */
.glyph--stop {
    width: 120px;
    height: 120px;
    border: 1px solid rgba(255, 107, 94, .35);
    border-radius: 14px;
    background: rgba(60, 16, 20, .35);
    box-shadow: 0 0 36px rgba(255, 107, 94, .18);
}

.glyph--stop i {
    width: 78px;
    height: 78px;
    border: 5px solid var(--danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glyph--stop i::before {
    content: "";
    width: 5px;
    height: 34px;
    border-radius: 3px;
    background: var(--danger);
}

/* Stand occupied */
.glyph--busy { width: 120px; height: 120px; gap: 8px; }

.glyph--busy i {
    width: 12px;
    border-radius: 3px;
    background: var(--neon-2);
    animation: pulse 1.3s ease-in-out infinite;
}

.glyph--busy i:nth-child(1) { height: 38px; animation-delay: 0s; }
.glyph--busy i:nth-child(2) { height: 62px; animation-delay: .18s; }
.glyph--busy i:nth-child(3) { height: 86px; animation-delay: .36s; }
.glyph--busy i:nth-child(4) { height: 62px; animation-delay: .54s; }
.glyph--busy i:nth-child(5) { height: 38px; animation-delay: .72s; }

@keyframes pulse { 0%, 100% { opacity: .28; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .glyph--busy i { animation: none; opacity: .7; }
    .hud__bar > span { transition: none; }
}

/* Stand offline */
.glyph--alert {
    width: 120px;
    height: 120px;
    border: 1px solid rgba(255, 200, 90, .32);
    border-radius: 14px;
    background: rgba(60, 44, 10, .35);
    box-shadow: 0 0 36px rgba(255, 200, 90, .16);
}

.glyph--alert i {
    width: 78px;
    height: 78px;
    border: 5px solid #FFC85A;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.glyph--alert i::before { content: ""; width: 5px; height: 26px; border-radius: 3px; background: #FFC85A; }
.glyph--alert i::after  { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #FFC85A; }

/* Success — board 2d */
.glyph--done {
    width: 136px;
    height: 136px;
    border: 1px solid rgba(59, 227, 160, .4);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(59, 227, 160, .25);
}

.glyph--done i {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--ok);
    display: flex;
    align-items: center;
    justify-content: center;
}

.glyph--done i::after {
    content: "";
    width: 24px;
    height: 44px;
    margin-top: -8px;
    border: solid #032117;
    border-width: 0 7px 7px 0;
    transform: rotate(42deg);
}

.shear { display: flex; gap: 6px; align-items: center; }

.shear span {
    width: 26px;
    height: 6px;
    transform: skewX(-24deg);
    background: var(--neon-2);
}

.shear span:nth-child(2) { background: rgba(56, 225, 255, .55); }
.shear span:nth-child(3) { background: rgba(56, 225, 255, .25); }

.page--done { background: radial-gradient(120% 60% at 50% 32%, rgba(56, 225, 255, .16), rgba(5, 12, 26, 0) 70%), linear-gradient(180deg, #071129, #04101F) fixed; }

/* --- prose --------------------------------------------------------------- */

.prose { padding: 24px var(--pad) 60px; line-height: 1.65; color: var(--ink-2); }
.prose h1 { margin: 0 0 18px; font-size: 24px; font-weight: 800; text-transform: uppercase; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose__todo { color: var(--danger); font-weight: 700; }

/* ---------------------------------------------------------------------------
   Keyboard open — board 2c.

   The on-screen keyboard cuts the viewport to roughly 390x400. Without this the
   submit button sits under the keyboard, on a 60-second clock. Matching the
   design's compact treatment: the game identity steps aside, the HUD panel
   collapses to a single readout, fields and button shrink.
--------------------------------------------------------------------------- */

@media (max-height: 620px) {
    .hero,
    .hud__bar,
    .hud__sub,
    .field__hint,
    .footnote { display: none; }

    .screen__body { gap: 12px; padding-top: 12px; }

    .hud {
        padding: 10px 14px;
        box-shadow: none;
    }

    .hud::before, .hud::after { display: none; }
    .hud__clock { font-size: 18px; }

    .input, .phone { height: 48px; }
    .input { font-size: 16px; }

    .consent { font-size: 12px; gap: 10px; }
    .consent input { width: 24px; height: 24px; }

    .button { min-height: 56px; font-size: 17px; }
    .screen__actions { padding-top: 10px; padding-bottom: 14px; gap: 0; }
}
