/* SNAP Driver PWA — premium sales-demo theme (matches AG_DESIGN_TARGET.png). */
:root {
  --bg:#0a0f1f; --bg2:#0d1428;
  --ink:#f1f5f9; --muted:#94a3b8;
  --green:#22c55e; --green2:#34d399; --green-deep:#059669;
  --amber:#d9a441; --amber-ink:#3a2c08;
  --glass:rgba(30,41,59,.55); --glass-brd:rgba(52,211,153,.45);
  --red:#fb7185;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
/* Guarantee the `hidden` attribute always wins over the overlay/splash/celebrate
   display rules below (otherwise a class `display:flex` can leak a hidden gate). */
[hidden] { display:none !important; }
html, body { margin:0; min-height:100%; }
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #13203f 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment:fixed;
  color:var(--ink);
  font-family:'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust:100%;
}
.app { max-width:480px; margin:0 auto; padding:14px 16px 40px; }

/* ---------- Header (gradient card) ---------- */
.app-header {
  background:linear-gradient(135deg, #2bd48a 0%, var(--green) 45%, var(--green-deep) 100%);
  border-radius:20px;
  padding:18px 20px;
  box-shadow:0 12px 30px rgba(16,185,129,.28), inset 0 1px 0 rgba(255,255,255,.25);
  display:flex; align-items:center; justify-content:center;
}
.brand { font-weight:800; font-size:1.35rem; color:#fff; letter-spacing:.2px; display:flex; align-items:center; gap:8px; text-shadow:0 1px 2px rgba(0,0,0,.18); }
.brand-mark { font-size:1.25rem; filter:drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.demo-badge { background:linear-gradient(180deg,#e9c46a,#caa13c); color:var(--amber-ink); font-weight:800; font-size:.62rem; padding:3px 9px; border-radius:999px; letter-spacing:.1em; box-shadow:inset 0 1px 0 rgba(255,255,255,.4); }

/* ---------- Connection row ---------- */
.conn-row { display:flex; justify-content:center; margin:16px 0 8px; }
.conn { display:inline-flex; align-items:center; gap:7px; font-size:.95rem; font-weight:600; color:var(--muted); }
.conn .dot { width:9px; height:9px; border-radius:50%; background:var(--muted); }
.conn.online { color:var(--green2); }
.conn.online .dot { background:var(--green2); box-shadow:0 0 0 0 rgba(52,211,153,.7); animation:livePulse 2s infinite; }
@keyframes livePulse { 0%{box-shadow:0 0 0 0 rgba(52,211,153,.6);} 70%{box-shadow:0 0 0 8px rgba(52,211,153,0);} 100%{box-shadow:0 0 0 0 rgba(52,211,153,0);} }
.conn.offline { color:var(--red); }
.conn.offline .dot { background:var(--red); }

main { padding:6px 0; }
.muted { color:var(--muted); }

/* ---------- Waiting card ---------- */
.card { background:var(--glass); border:1px solid rgba(148,163,184,.18); border-radius:18px; padding:22px; margin-bottom:14px; backdrop-filter:blur(8px); }
.waiting { text-align:center; }
.waiting-icon { font-size:2.4rem; margin-bottom:6px; animation:floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-6px);} }
.card h2 { margin:4px 0 6px; font-size:1.1rem; }

/* ---------- Glass order card ---------- */
.glass-card {
  background:linear-gradient(160deg, rgba(45,60,90,.55), rgba(20,30,52,.55));
  border:1.5px solid var(--glass-brd);
  border-radius:20px; padding:18px 20px; margin-bottom:18px;
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  box-shadow:0 0 0 1px rgba(52,211,153,.08), 0 14px 40px rgba(0,0,0,.45), 0 0 26px rgba(52,211,153,.18);
  animation:slideUp .55s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes slideUp { from{opacity:0; transform:translateY(26px) scale(.98);} to{opacity:1; transform:translateY(0) scale(1);} }
.job-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.job-head h2 { margin:0; font-size:1.25rem; font-weight:800; }
.field { margin:10px 0; }
.field .label { display:block; color:var(--muted); font-size:.78rem; margin-bottom:1px; }
.field .value { display:block; color:#fff; font-size:1.02rem; font-weight:600; }
.pill { display:inline-block; padding:4px 12px; border-radius:999px; font-size:.72rem; font-weight:800; letter-spacing:.03em; }
.pill.amber { background:linear-gradient(180deg,#e9c46a,#caa13c); color:var(--amber-ink); }
.pill.green { background:rgba(34,197,94,.18); color:var(--green2); border:1px solid rgba(34,197,94,.5); }

/* ---------- Progress stepper ---------- */
.stepper { display:flex; align-items:flex-start; justify-content:space-between; position:relative; margin:8px 6px 20px; }
.stepper::before { content:""; position:absolute; top:11px; left:8%; right:8%; height:3px; background:rgba(148,163,184,.25); border-radius:2px; }
.step { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:7px; flex:1; }
.step .dot { width:24px; height:24px; border-radius:50%; background:#1b2540; border:3px solid #475569; transition:all .35s ease; }
.step .step-label { font-size:.72rem; color:var(--muted); font-weight:600; transition:color .35s; }
.step.done .dot { background:var(--green); border-color:var(--green); box-shadow:0 0 10px rgba(34,197,94,.5); }
.step.done .step-label { color:var(--green2); }
.step.active .dot { background:var(--green2); border-color:var(--green2); box-shadow:0 0 0 5px rgba(52,211,153,.18); animation:stepPulse 1.6s infinite; }
.step.active .step-label { color:#fff; }
@keyframes stepPulse { 0%{box-shadow:0 0 0 4px rgba(52,211,153,.25);} 70%{box-shadow:0 0 0 12px rgba(52,211,153,0);} 100%{box-shadow:0 0 0 0 rgba(52,211,153,0);} }

/* ---------- Pulsing GPS ---------- */
.gps { text-align:center; color:var(--green2); font-weight:700; font-variant-numeric:tabular-nums; margin:6px 0 18px; letter-spacing:.02em; animation:gpsGlow 2s ease-in-out infinite; }
.gps-pin { filter:drop-shadow(0 0 6px rgba(52,211,153,.8)); }
@keyframes gpsGlow { 0%,100%{text-shadow:0 0 6px rgba(52,211,153,.25);} 50%{text-shadow:0 0 16px rgba(52,211,153,.7);} }

/* ---------- Big CTA ---------- */
.btn-cta {
  display:block; width:100%; border:none; cursor:pointer;
  font:inherit; font-weight:800; font-size:1.12rem; color:#fff;
  padding:18px; border-radius:16px; letter-spacing:.2px;
  background:linear-gradient(135deg, #2bd48a, var(--green) 55%, var(--green-deep));
  box-shadow:0 12px 26px rgba(16,185,129,.4), inset 0 1px 0 rgba(255,255,255,.3);
  transition:transform .12s ease, box-shadow .2s ease;
}
.btn-cta:active { transform:translateY(2px) scale(.99); box-shadow:0 6px 16px rgba(16,185,129,.35); }
.btn-cta:disabled { opacity:.55; }

button { font:inherit; font-weight:700; border:none; border-radius:12px; padding:12px 16px; cursor:pointer; }
.btn-primary { background:var(--green); color:#fff; }
.btn-ghost { background:transparent; color:var(--ink); border:1px solid #475569; margin-top:18px; }

/* ---------- Overlays (install / perm) ---------- */
.overlay { position:fixed; inset:0; z-index:1000; background:linear-gradient(180deg,var(--bg),var(--bg2)); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:28px; }
.overlay h1 { color:var(--green2); }
.overlay ol { text-align:left; max-width:420px; color:var(--muted); line-height:1.6; }
.install-steps { max-width:420px; width:100%; }
.install-os { text-align:left; color:var(--ink); font-weight:600; margin:6px 0 0; }

/* ---------- Splash ---------- */
.splash { position:fixed; inset:0; z-index:1200; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  background:radial-gradient(800px 500px at 50% 35%, #14264a 0%, var(--bg) 70%); transition:opacity .4s ease; }
.splash.hide { opacity:0; }
.splash-logo { font-size:3.4rem; animation:floaty 2.6s ease-in-out infinite; filter:drop-shadow(0 6px 16px rgba(16,185,129,.45)); }
.splash-title { font-size:1.5rem; font-weight:800; background:linear-gradient(90deg,#2bd48a,var(--green2)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.splash-sub { color:var(--muted); font-size:.9rem; }
.spinner { width:38px; height:38px; border-radius:50%; border:4px solid rgba(52,211,153,.2); border-top-color:var(--green2); animation:spin 0.9s linear infinite; }
@keyframes spin { to{transform:rotate(360deg);} }

/* ---------- Update banner ---------- */
.banner { position:fixed; top:0; left:0; right:0; z-index:1100; background:var(--amber); color:#1f2937; padding:10px 14px; display:flex; justify-content:space-between; align-items:center; font-weight:700; }
.banner button { background:#1f2937; color:#fff; padding:6px 12px; }

/* ---------- Celebration ---------- */
.celebrate { position:fixed; inset:0; z-index:1300; display:flex; align-items:center; justify-content:center; pointer-events:none; background:rgba(5,10,22,.45); backdrop-filter:blur(2px); }
.check-burst { text-align:center; animation:pop .5s cubic-bezier(.2,.9,.3,1.4) both; }
.celebrate-text { margin-top:8px; font-size:1.5rem; font-weight:800; color:var(--green2); text-shadow:0 0 18px rgba(52,211,153,.6); }
@keyframes pop { 0%{transform:scale(.4); opacity:0;} 60%{transform:scale(1.12);} 100%{transform:scale(1); opacity:1;} }
.check-ring { stroke:var(--green2); stroke-dasharray:226; stroke-dashoffset:226; animation:draw .5s ease forwards; }
.check-mark { stroke:#fff; stroke-dasharray:60; stroke-dashoffset:60; animation:draw .35s .35s ease forwards; }
@keyframes draw { to{stroke-dashoffset:0;} }
.confetti { position:absolute; inset:0; overflow:hidden; }
.confetti i { position:absolute; top:-12px; width:9px; height:14px; border-radius:2px; opacity:.95; animation:confettiFall linear forwards; }
@keyframes confettiFall { to { transform:translateY(110vh) rotate(720deg); opacity:.9; } }
