/* Mobile-first, dark theme: near-black with a green tint. A soft whitish light
   shimmer drifts across the background (WebGL), glassy cards float on top. */
:root {
    --ink: #eafaf0;
    --muted: #a9c6b4;
    --line: rgba(255, 255, 255, .12);
    --surface: rgba(8, 20, 13, .62);
    --surface-2: rgba(6, 16, 10, .72);
    --field: rgba(4, 12, 8, .66);
    --accent: #46d07a;
    --accent-light: #7ce8a3;
    --accent-ink: #04140b;
    --ok: #58e08a;
    --warn: #ffcc66;
    --err: #ff8a8a;
    --radius: 16px;
    --shadow: 0 24px 60px rgba(0, 0, 0, .45);
    --glow: 0 0 0 4px rgba(124, 232, 163, .30), 0 12px 32px rgba(70, 208, 122, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
    background: #04100a;
    color: var(--ink);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* WebGL background + CSS fallback while/if WebGL is unavailable. */
.landing-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 32%, rgba(255, 255, 255, .10), transparent 40%),
        radial-gradient(circle at 72% 66%, rgba(120, 200, 150, .10), transparent 38%),
        #04100a;
}
.landing-page.landing-webgl-ready::before { display: none; }
.landing-background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: transparent;
}

.topbar, main, .site-footer { position: relative; z-index: 1; }

/* Topbar: small logo flush to the left, single app button on the right. */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 18px;
}
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand img { width: 118px; height: auto; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .5)); }

.btn-app {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: var(--accent-ink);
    font-weight: 800;
    text-decoration: none;
    border: 1px solid rgba(70, 208, 122, .5);
    box-shadow: 0 4px 14px rgba(70, 208, 122, .3);
    transition: box-shadow .2s ease, transform .06s ease, filter .2s ease;
}
.btn-app:hover { box-shadow: var(--glow); filter: brightness(1.05); }
.btn-app:active { transform: translateY(1px); }

/* Layout */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 6px 18px 52px;
    display: grid;
    gap: 34px;
}

/* Hero: compact, small heading that sits up near the top bar. */
.hero { padding-top: 4px; }
.hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.3rem, 5.2vw, 2rem);
    line-height: 1.2;
    letter-spacing: -.01em;
    text-wrap: balance;
}
.lead {
    margin: 0;
    max-width: 560px;
    color: var(--muted);
    font-size: clamp(.96rem, 2.6vw, 1.08rem);
}
.code-chip {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 8px;
    background: rgba(70, 208, 122, .16);
    border: 1px solid rgba(70, 208, 122, .4);
    color: var(--accent-light);
    font-weight: 800;
    letter-spacing: .14em;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.card-title { margin: 0 0 16px; font-size: 1.2rem; }

.finder { display: grid; gap: 14px; }

/* Finder card stands out from the rest: brighter accent border + soft green glow. */
#findForm {
    background: var(--surface-2);
    border-color: rgba(70, 208, 122, .38);
    box-shadow: var(--shadow), 0 0 0 1px rgba(70, 208, 122, .18), 0 0 36px rgba(70, 208, 122, .12);
}

/* Label sits on the same row as its input. */
.field { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 14px; }
.field + .field { margin-top: 14px; }
.field label { font-size: 1.12rem; font-weight: 700; color: var(--ink); }
/* Status line (Where) drops to its own full-width row under the input. */
.field > .loc-status { grid-column: 1 / -1; }

label { font-weight: 700; font-size: .95rem; }
.muted { color: var(--muted); font-weight: 500; }
.help { color: var(--muted); font-size: .84rem; }

input, button { font: inherit; }
input {
    width: 100%;
    padding: 13px 14px;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: rgba(169, 198, 180, .55); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70, 208, 122, .22); }

#code {
    text-transform: uppercase;
    letter-spacing: .5em;
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    padding-left: .5em;
}

/* "Where" city autocomplete */
.combo { position: relative; }
.combo-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 6px;
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #0b1d14;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.combo-item {
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.combo-item:hover, .combo-item.active { background: rgba(70, 208, 122, .14); }
.combo-item .city { color: var(--ink); font-weight: 700; }
.combo-item .region { color: var(--muted); font-size: .84rem; }
.combo-empty { padding: 10px 12px; color: var(--muted); font-size: .9rem; }
.loc-status {
    margin: 6px 0 0;
    padding: 11px 14px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: .9rem;
}
.loc-status.ok { color: var(--ok); border-color: rgba(88, 224, 138, .4); background: rgba(88, 224, 138, .08); }
.loc-status.warn { color: var(--warn); border-color: rgba(255, 204, 102, .4); background: rgba(255, 204, 102, .08); }

button { border: 0; border-radius: 12px; cursor: pointer; font-weight: 800; transition: transform .06s ease, filter .15s ease, box-shadow .2s ease; }
button:active { transform: translateY(1px); }
.primary {
    margin-top: 18px;
    width: 100%;
    padding: 15px 16px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: var(--accent-ink);
    font-size: 1.05rem;
    box-shadow: 0 6px 18px rgba(70, 208, 122, .35);
}
.primary:hover { box-shadow: var(--glow); filter: brightness(1.04); }
.primary:disabled { filter: grayscale(.3) brightness(.9); cursor: progress; box-shadow: none; }

.error { color: var(--err); margin: 14px 0 0; font-weight: 600; }

/* Result */
.result { border-left: 4px solid var(--line); }
.result h2 { margin: 0 0 8px; font-size: 1.2rem; }
.result p { margin: 0; color: var(--muted); }
.result.ok { border-left-color: var(--ok); }
.result.ok h2 { color: var(--ok); }
.result.none { border-left-color: var(--warn); }
.result.none h2 { color: var(--warn); }

/* How it works */
.how h2, .get-app h2 { text-align: center; font-size: clamp(1.3rem, 4.5vw, 1.7rem); margin: 0 0 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.step-num {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(70, 208, 122, .16);
    border: 1px solid rgba(70, 208, 122, .4);
    color: var(--accent-light);
    font-weight: 800;
    margin-bottom: 10px;
}
.step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Get app */
.get-app { text-align: center; }
.get-app > p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }
.stores { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.store {
    display: inline-block;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    background: var(--surface-2);
    font-weight: 700;
}
.store:hover { border-color: var(--accent); color: var(--accent-light); }

/* Footer */
.site-footer { text-align: center; color: var(--muted); font-size: .88rem; max-width: 800px; margin: 0 auto; padding: 6px 18px 30px; }

/* Larger screens */
@media (min-width: 640px) {
    .topbar { padding: 16px 24px; }
    .brand img { width: 138px; }
    main { padding: 10px 24px 64px; gap: 46px; }
    .hero { padding-top: 8px; }
    .card { padding: 26px; }
    .combo-list { max-height: 320px; }
    .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* Wide screens: flank the centered 800px content column with a fixed logo on the left and the
   "Get the app" button on the right, so the top row reads:  logo | hero | Get the app. */
@media (min-width: 1200px) {
    .topbar { padding: 0; max-width: none; margin: 0; }
    .brand {
        position: fixed;
        top: 30px;
        right: calc(50% + 400px + 32px);   /* right edge 32px left of the content column */
        z-index: 3;
    }
    .brand img { width: 132px; }
    .btn-app {
        position: fixed;
        top: 34px;
        left: calc(50% + 400px + 32px);    /* left edge 32px right of the content column */
        z-index: 3;
    }
    main { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
