/* AutoVxMS kiosk — one stylesheet, iPhone first.
 *
 * Showroom look: deep charcoal, warm ivory type, one champagne accent. The
 * customer holds the phone, so every tap target is >= 64px tall and text never
 * drops below 15px. A light variant exists for bright windows (?theme=light).
 */

:root {
  --bg: #0e0f11;
  --surface: #17191d;
  --surface-2: #1f2227;
  --line: #2c2f36;
  --ink: #f4f1ea;
  --muted: #a7a196;
  --accent: #c9a96e;
  --accent-ink: #1b1509;
  --accent-soft: rgba(201, 169, 110, 0.14);
  --good: #7cc4a0;
  --warn: #e2b96a;
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="light"] {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --line: #e0dbd0;
  --ink: #16171a;
  --muted: #625d54;
  --accent: #8a6a2f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(138, 106, 47, 0.1);
  --good: #2f7a55;
  --warn: #8a5a10;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }

.screen {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 12px) 20px calc(env(safe-area-inset-bottom) + 20px);
  animation: enter 0.32s var(--ease);
}
@keyframes enter { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.screen.back { animation-name: enter-back; }
@keyframes enter-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 10px; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.muted { color: var(--muted); }

/* ---- welcome ---------------------------------------------------------- */
.welcome { justify-content: space-between; }
.welcome .brand { font-size: 15px; letter-spacing: 0.3em; font-weight: 700; padding-top: 12px; }
.welcome .hero h1 { font-size: 40px; line-height: 1.05; margin-top: 14px; }
.welcome .art { width: 100%; height: auto; margin: 8px 0 0; color: var(--accent); opacity: 0.9; }
.fineprint { font-size: 14px; color: var(--muted); text-align: center; margin-top: 14px; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  appearance: none; border: 0; width: 100%; min-height: 64px; border-radius: var(--radius);
  font: inherit; font-size: 19px; font-weight: 650; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.12s var(--ease), background 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-row { display: grid; gap: 12px; margin-top: auto; padding-top: 20px; }

/* ---- question --------------------------------------------------------- */
.topbar { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.icon-btn {
  appearance: none; border: 0; background: var(--surface); color: var(--ink);
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn svg { width: 24px; height: 24px; }
.text-btn { appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px;
  min-height: 48px; padding: 0 4px; cursor: pointer; }
.progress { flex: 1; display: flex; gap: 6px; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background 0.3s; }
.progress span.on { background: var(--accent); }

.q-head { margin: 18px 0 6px; }
.answers { display: grid; gap: 12px; margin-top: 8px; }
.answer {
  appearance: none; width: 100%; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  min-height: 84px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; font: inherit;
  transition: transform 0.12s var(--ease), border-color 0.15s, background 0.15s;
}
.answer:active { transform: scale(0.985); }
.answer.picked { border-color: var(--accent); background: var(--accent-soft); }
.answer .ico {
  width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); color: var(--accent);
  display: grid; place-items: center; flex: none;
}
.answer .ico svg { width: 28px; height: 28px; }
.answer .txt { flex: 1; min-width: 0; }
.answer .label { display: block; font-size: 20px; font-weight: 650; line-height: 1.2; }
.answer .sub { display: block; font-size: 15px; color: var(--muted); margin-top: 3px; }
.answer .chev { color: var(--muted); width: 20px; height: 20px; flex: none; }

/* ---- thinking ------------------------------------------------------------ */
.thinking { justify-content: center; align-items: center; text-align: center; }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin-bottom: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- results ------------------------------------------------------------ */
.notice { background: var(--surface); border: 1px dashed var(--warn); color: var(--ink);
  border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: 6px 0 14px; }
.notice b { color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.card + .card { margin-top: 12px; }
.card.hero { border-color: var(--accent); padding: 22px 20px; }
.card .model { font-size: 15px; color: var(--muted); letter-spacing: 0.04em; }
.card .trim { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; margin: 2px 0 6px; }
.card.alt .trim { font-size: 21px; }
.price { font-size: 17px; }
.price b { font-size: 22px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.badge.warn { color: var(--warn); background: rgba(226, 185, 106, 0.14); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { font-size: 14px; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.highlights { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.stock {
  appearance: none; width: 100%; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface-2); border-radius: 14px; min-height: 64px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.stock .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); flex: none; }
.stock .dot.none { background: var(--muted); }
.stock .s-txt { flex: 1; font-size: 16px; }
.stock .s-txt small { display: block; color: var(--muted); font-size: 14px; }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 26px 0 10px; }
.why { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.why span { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

/* ---- inventory ---------------------------------------------------------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 14px; padding: 4px;
  margin: 12px 0 14px; }
.seg button { appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
  min-height: 48px; border-radius: 11px; cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--ink); }
.unit { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.unit + .unit { margin-top: 10px; }
.unit .u-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.unit .u-name { font-size: 18px; font-weight: 650; line-height: 1.25; }
.unit .u-price { text-align: right; white-space: nowrap; }
.unit .u-price b { font-size: 20px; display: block; }
.unit .u-price s { color: var(--muted); font-size: 14px; }
.unit .u-meta { color: var(--muted); font-size: 15px; margin-top: 6px; }
.pill { display: inline-block; font-size: 13px; font-weight: 650; padding: 3px 9px; border-radius: 999px; margin-top: 8px; }
.pill.in_stock { color: var(--good); background: rgba(124, 196, 160, 0.14); }
.pill.in_transit { color: var(--warn); background: rgba(226, 185, 106, 0.14); }
.pill.allocated, .pill.unknown { color: var(--muted); background: var(--surface-2); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---- hand-off ------------------------------------------------------------ */
.handoff { text-align: center; }
.code { font-size: 64px; font-weight: 800; letter-spacing: 0.08em; color: var(--accent); margin: 18px 0 4px;
  font-variant-numeric: tabular-nums; }
.summary { text-align: left; margin-top: 22px; }
.summary dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.summary dt { color: var(--muted); font-size: 14px; }
.summary dd { margin: 0 0 4px; font-size: 17px; font-weight: 600; }

/* ---- idle overlay ------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 24px; z-index: 10; }
.overlay .card { max-width: 420px; width: 100%; text-align: center; }
.overlay h2 { margin: 4px 0 8px; font-size: 26px; }

.error { color: var(--warn); text-align: center; margin: 12px 0; }

@media (prefers-reduced-motion: reduce) {
  .screen, .spinner { animation: none; }
}
.mt { margin-top: 16px; }
.btn-row.tight { margin-top: 0; padding-top: 12px; }
.btn svg { width: 22px; height: 22px; flex: none; }
.stock > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }

/* ---- decision tree v2: model grid, notes, multi-select ------------------ */
.models { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.model-btn {
  appearance: none; cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  min-height: 112px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
  transition: transform 0.12s var(--ease), border-color 0.15s;
}
.model-btn:active { transform: scale(0.97); border-color: var(--accent); }
.model-btn .m-code { font-size: 28px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.1; }
.model-btn .m-sub { font-size: 13px; color: var(--muted); line-height: 1.3; }
.model-btn .m-meta { font-size: 14px; color: var(--accent); font-weight: 600; }
.answer.accent { border-color: var(--accent); background: var(--accent-soft); }
.note { font-size: 15px; color: var(--accent); margin: 4px 0 0; }
.answer.toggle .check {
  width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; transition: background 0.15s, border-color 0.15s;
}
.answer.toggle.picked .check { background: var(--accent); border-color: var(--accent); }
.answer.toggle.picked .check::after { content: ""; width: 8px; height: 14px; border: solid var(--accent-ink);
  border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -2px); }
.btn-row.sticky { position: sticky; bottom: 0; padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
  background: linear-gradient(transparent, var(--bg) 30%); }
.unit .pill + .pill { margin-left: 6px; }
