@font-face {
    font-family: "Outfit";
    src: url("fonts/Outfit-Variable.ttf") format("truetype");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Questrial";
    src: url("fonts/Questrial-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* One-line swap once Sailec is licensed: --font-headline: "Sailec", "Outfit", sans-serif; and the same for --font-body. */
    --font-headline: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    --font-body: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    --font-label: "Questrial", "Outfit", sans-serif;
    --green: #78BC43;
    --green-deep: #5c9a2e;
    --navy: #273B6E;
    --ink: #102044;
    --gray: #7F7F7F;
    --light: #D4D9E1;
    --deep: #040F2C;
    --mid: #0E2A63;
    --card: rgba(6, 16, 42, 0.62);
    --line: rgba(255, 255, 255, 0.62);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--deep);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 380;
}

button, input, textarea, select { font-family: inherit; }

.kiosk, .admin-shell {
    min-height: 100dvh;
    position: relative;
}

.stage-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.stage-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(90% 55% at 12% 8%, #1a4a8a 0%, transparent 55%),
        radial-gradient(120% 80% at 80% 100%, #0E2A63 0%, #040F2C 70%);
}

.stage-wave {
    position: absolute;
    left: -12%;
    top: -8%;
    width: 130%;
    height: 125%;
    background: url("brand/wave.jpg") center / cover no-repeat;
    opacity: 0.42;
    mix-blend-mode: screen;
    animation: drift 56s linear infinite;
}

.stage-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(4, 15, 44, 0.55) 0%, rgba(4, 15, 44, 0.15) 24%, rgba(4, 15, 44, 0.18) 62%, rgba(4, 15, 44, 0.72) 100%);
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1.04); }
    to { transform: translate3d(-3%, -2.5%, 0) scale(1.08); }
}

.kiosk-top, .kiosk-main, .admin-frame {
    position: relative;
    z-index: 1;
}

.kiosk-top {
    padding: 0.85rem 1.25rem 0.2rem;
}

.kiosk-main {
    padding: 0.4rem 1.25rem 1.5rem;
    display: flex;
    justify-content: center;
}

.stepper { position: relative; max-width: 980px; margin: 0 auto; }

.stepper ol {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

.stepper li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.runway {
    position: absolute;
    left: 12.5%;
    right: 12.5%;
    top: 1.85rem;
    height: 0;
    border-top: 4px dashed rgba(255, 255, 255, 0.72);
    z-index: 0;
}

.runway::before,
.runway::after {
    content: "";
    position: absolute;
    top: -7px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
}

.runway::before { left: 0; }
.runway::after { right: 0; }

.plane {
    position: absolute;
    top: -18px;
    left: 0;
    width: 34px;
    height: 34px;
    color: var(--green);
    opacity: 0;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}

.stepper.is-thanks .plane {
    animation: takeoff 2.1s cubic-bezier(.16, .8, .24, 1) forwards;
}

@keyframes takeoff {
    0% { left: 0; opacity: 0; transform: translateY(6px) rotate(-8deg); }
    15% { opacity: 1; }
    100% { left: calc(100% - 28px); opacity: 0; transform: translateY(-42px) rotate(-18deg); }
}

.node {
    width: 3.7rem;
    height: 3.7rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(4, 15, 44, 0.55);
    border: 3px solid rgba(255, 255, 255, 0.78);
    color: #fff;
    transition: transform 220ms ease, background 220ms ease, width 220ms ease, height 220ms ease;
}

.node svg { width: 1.55rem; height: 1.55rem; }

.stepper li.done .node {
    background: #fff;
    border-color: #fff;
    color: var(--navy);
}

.stepper li.current .node {
    width: 4.7rem;
    height: 4.7rem;
    margin-top: -0.5rem;
    background: var(--green);
    border-color: var(--green);
    color: var(--ink);
    box-shadow: 0 0 0 8px rgba(120, 188, 67, 0.22), 0 0 32px rgba(120, 188, 67, 0.55);
}

.slabel {
    font-family: var(--font-label);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--light);
    text-align: center;
}

.stepper li.current .slabel {
    color: var(--green);
    font-family: var(--font-headline);
    font-weight: 650;
    letter-spacing: 0.08em;
}

.stepper li.done .slabel { color: #fff; }

.logo-slot {
    --logo-h: 2.7rem;
    display: inline-flex;
    padding: calc(var(--logo-h) * 0.28);
}

.logo-slot img { height: var(--logo-h); width: auto; display: block; }

.logo-slot-hero { --logo-h: 3.15rem; padding-left: 0; }

.attract {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    width: min(1100px, 100%);
    min-height: 68dvh;
    text-align: left;
    padding: 0.2rem 0.4rem 1rem;
    cursor: pointer;
    animation: rise 700ms ease both;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.2rem 0 0.35rem;
    font-family: var(--font-label);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--light);
    font-size: clamp(0.78rem, 1.5vw, 1rem);
}

.eyebrow-plain { letter-spacing: 0.16em; }

.slashes { width: 5.4rem; height: 1rem; fill: var(--green); flex: none; }

.district {
    margin: 0;
    color: var(--green);
    font-family: var(--font-headline);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
}

h1 {
    margin: 0.15rem 0 0.6rem;
    font-family: var(--font-headline);
    font-weight: 760;
    letter-spacing: -0.03em;
    line-height: 0.96;
    font-size: clamp(3.1rem, 7vw, 6.4rem);
}

.question {
    font-size: clamp(1.8rem, 3.6vw, 3.15rem);
    line-height: 1.12;
    max-width: 18ch;
}

.g { color: var(--green); }

.lede, .help, .when, .tagline, .note {
    color: var(--light);
    font-weight: 360;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    line-height: 1.35;
}

.help { font-size: 1.15rem; max-width: 42rem; }

.when { margin-top: 0.8rem; }

.tagline {
    display: block;
    margin-top: 1.4rem;
    font-family: var(--font-label);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: #fff;
}

.cta {
    display: inline-flex;
    align-items: center;
    margin-top: 1.3rem;
    min-height: 4.6rem;
    padding: 0.85rem 1.7rem;
    border-radius: 999px;
    background: var(--green);
    color: var(--ink);
    font-family: var(--font-headline);
    font-weight: 720;
    font-size: 1.35rem;
    box-shadow: 0 10px 30px rgba(120, 188, 67, 0.28);
}

.attract:focus,
.attract:focus-visible,
h1:focus,
h1:focus-visible {
    outline: none;
}

.btn:focus-visible,
.touch-input:focus-visible,
.match:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.panel {
    width: min(920px, 100%);
    animation: rise 420ms ease both;
}

.field-label {
    display: block;
    margin: 1rem 0 0.4rem;
    font-family: var(--font-label);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--light);
    font-size: 0.85rem;
}

.touch-input, select.touch-input, select {
    width: 100%;
    min-height: 4.4rem;
    border-radius: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 520;
    padding: 0.8rem 1.1rem;
}

.suggestion-box {
    min-height: 28vh;
    resize: vertical;
    line-height: 1.4;
    font-weight: 430;
}

.counter { color: var(--gray); margin: 0.35rem 0 0; font-size: 0.95rem; }

.matches {
    list-style: none;
    margin: 0.8rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.match {
    width: 100%;
    min-height: 4.5rem;
    border-radius: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.1rem;
    font-size: 1.45rem;
    font-weight: 620;
    text-align: left;
    cursor: pointer;
}

.match-go {
    font-family: var(--font-label);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--green-deep);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 4.4rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    text-decoration: none;
    border: 2px solid transparent;
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1.15rem;
    cursor: pointer;
}

.btn-primary { background: var(--green); color: var(--ink); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.72); }
.btn:disabled { opacity: 0.55; cursor: default; }

.form-error, .banner {
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    margin: 0.6rem 0;
}

.form-error { background: rgba(180, 40, 40, 0.28); color: #fff; }
.banner { background: rgba(120, 188, 67, 0.18); color: #fff; }

.admin-frame {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.2rem 0 3rem;
}

.admin-top, .card-head, .sheet-pick {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
}

.admin-top h1, .admin-card h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }

.admin-card h2 {
    margin: 0 0 0.4rem;
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1.45rem;
}

.stat-row, .admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin: 0.8rem 0;
}

.admin-grid { grid-template-columns: 1.2fr 0.8fr; }

.stat, .admin-card, .login-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1.3rem;
    padding: 1rem 1.1rem 1.15rem;
    backdrop-filter: blur(8px);
}

.stat-value {
    display: block;
    font-family: var(--font-headline);
    font-weight: 760;
    font-size: 2.4rem;
    color: var(--green);
}

.stat-label {
    font-family: var(--font-label);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--light);
    font-size: 0.75rem;
}

.logo-slot-admin { --logo-h: 2.1rem; padding: 0 0 0.2rem; }

.login-card { max-width: 460px; margin: 8vh auto; }
.login-form { display: grid; gap: 0.6rem; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
th, td { text-align: left; padding: 0.65rem 0.5rem; vertical-align: top; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
th {
    font-family: var(--font-label);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--light);
    font-weight: 400;
}
.suggestion-cell { min-width: 16rem; white-space: pre-wrap; }

select {
    min-height: 3.4rem;
    border-radius: 0.9rem;
    font-size: 1.05rem;
}

.sheet-pick .touch-input, .sheet-pick select { flex: 1; min-width: 14rem; }

.name-tools, .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.name-tools { margin-top: 0.8rem; }
.name-tools .touch-input { flex: 1; min-width: 10rem; min-height: 3.2rem; }
.row-actions .btn { min-height: 2.7rem; padding: 0.35rem 0.9rem; font-size: 0.95rem; }
.subhead { margin: 1.4rem 0 0.3rem; font-size: 1.15rem; }
.help-steps { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
.help-steps li { margin: 0.35rem 0; }
.help-steps code { word-break: break-all; }

::file-selector-button, input::file-selector-button {
    min-height: 3rem;
    margin-right: 0.8rem;
    border: 0;
    border-radius: 999px;
    background: var(--green);
    color: var(--ink);
    font-family: var(--font-headline);
    font-weight: 700;
    padding: 0.4rem 1rem;
}

@media (max-width: 860px), (orientation: portrait) {
    h1 { font-size: clamp(2.7rem, 12vw, 4.6rem); }
    .question { font-size: clamp(1.7rem, 6.4vw, 2.5rem); max-width: none; }
    .slabel { font-size: 0.62rem; letter-spacing: 0.08em; }
    .node { width: 3rem; height: 3rem; }
    .stepper li.current .node { width: 3.7rem; height: 3.7rem; }
    .runway { top: 1.5rem; }
    .stat-row, .admin-grid { grid-template-columns: 1fr; }
    .kiosk-main { padding-inline: 0.85rem; }
}

@media (max-height: 760px) and (orientation: landscape) {
    h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
    .kiosk-top { padding-top: 0.35rem; }
    .cta, .btn, .touch-input, .match { min-height: 3.5rem; }
    .suggestion-box { min-height: 22vh; }
}

@media (prefers-reduced-motion: reduce) {
    .stage-wave, .attract, .panel, .stepper.is-thanks .plane { animation: none; }
    .plane { display: none; }
    .node { transition: none; }
}
