:root {
  --bg: #0b0b0d;
  --panel: #141418;
  --panel-2: #1c1c22;
  --line: #2a2a33;
  --text: #f2f2f4;
  --muted: #9a9aa6;
  --gold: #d4a64a;
  --gold-2: #f0c46a;
  --ok: #3ecf8e;
  --bad: #ef5a5a;
  --warn: #f2b84b;
  --radius: 14px;
  --bg-photo: url("bg.jpg");
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif; line-height: 1.5; }
a { color: var(--gold-2); text-decoration: none; }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 700; margin: 0 0 .5rem; letter-spacing: .3px; }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(11,11,13,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: "Playfair Display", serif; font-size: 1.25rem; color: var(--text); }
.brand span { color: var(--gold); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; cursor: pointer;
  padding: .85rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: 1rem; transition: .15s; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #111; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-ok { background: var(--ok); color: #071; color: #052; }
.btn-bad { background: var(--bad); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Hero */
.hero { padding: 96px 0 72px; background:
  radial-gradient(1000px 500px at 80% -10%, rgba(212,166,74,.18), transparent 60%),
  radial-gradient(800px 400px at 0% 100%, rgba(212,166,74,.08), transparent 60%); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.1; max-width: 800px; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 600px; margin: 1rem 0 2rem; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 36px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--gold); font-weight: 700; margin-bottom: 12px; border: 1px solid var(--line); }

.car { overflow: hidden; padding: 0; }
.car .img { aspect-ratio: 16/10; background: linear-gradient(135deg, #1d1d24, #0f0f13); display: grid; place-items: center; color: #444; font-size: .9rem; }
.car .body { padding: 18px; }
.car .price { color: var(--gold-2); font-weight: 700; }

footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .9rem; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Forms */
.form-wrap { max-width: 640px; margin: 32px auto 80px; }
.progress { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin: 8px 0 24px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); width: 0; transition: width .3s; }
.step-label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .9rem; margin-bottom: 6px; color: #d6d6dc; }
.field input, .field textarea, .field select { width: 100%; padding: .85rem 1rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 1rem; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.error { color: var(--bad); font-size: .9rem; margin-top: 6px; min-height: 1.2em; }
.nav-buttons { display: flex; gap: 12px; justify-content: space-between; margin-top: 24px; }

/* Capture */
.capture-box { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; background: var(--panel); }
.capture-box img { width: 100%; border-radius: 10px; display: block; }
.id-frame { aspect-ratio: 1.586; border: 2px solid var(--gold); border-radius: 12px; display: grid; place-items: center; color: var(--muted); margin-bottom: 14px; }

.face-stage { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 3/4; border-radius: 20px; overflow: hidden; background: #000; }
.face-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-oval { position: absolute; inset: 10% 14% 14%; border-radius: 50%; border: 4px solid rgba(255,255,255,.4); transition: border-color .2s; }
.face-oval.good { border-color: var(--ok); }
.face-prompt { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; text-align: center; font-weight: 600; font-size: 1.15rem;
  background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.checks { display: flex; justify-content: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.chip.done { border-color: var(--ok); color: var(--ok); }

.agreement { max-height: 220px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: .9rem; color: #cfcfd6; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; }
.checkbox input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--gold); }

.notice { background: rgba(212,166,74,.1); border: 1px solid rgba(212,166,74,.35); color: #ecd9b0; padding: 12px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.success { text-align: center; padding: 40px 0; }
.success .ref { font-size: 1.6rem; color: var(--gold-2); letter-spacing: 3px; font-weight: 700; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; padding: 24px 0; }
@media (max-width: 900px) { .admin-layout { grid-template-columns: 1fr; } }
.list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 180px); overflow-y: auto; }
.list-item { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; color: var(--text); width: 100%; }
.list-item.active { border-color: var(--gold); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.badge.pending { background: rgba(242,184,75,.15); color: var(--warn); }
.badge.approved { background: rgba(62,207,142,.15); color: var(--ok); }
.badge.rejected { background: rgba(239,90,90,.15); color: var(--bad); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); padding: 6px 14px; border-radius: 99px; cursor: pointer; }
.tab.active { color: var(--text); border-color: var(--gold); }
.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: #000; aspect-ratio: 4/3; object-fit: cover; }
.photo-grid figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: grid; place-items: center; z-index: 50; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.card-reveal { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; letter-spacing: 1px; }
.form-wrap section { padding: 0; }

/* Parallax photo background (layer injected by assets/parallax.js) */
body { background: transparent; min-height: 100vh; }
.bg-parallax { position: fixed; top: 0; left: 0; right: 0; height: 125vh; height: 125lvh;
  z-index: -1; pointer-events: none; will-change: transform;
  background: var(--bg) var(--bg-photo) center 60% / cover no-repeat; }
.bg-parallax::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,11,13,.62) 0%, rgba(11,11,13,.78) 45%, rgba(11,11,13,.92) 100%); }
@media (max-width: 700px) {
  /* phones: keep the headlights centered, darken more so text stays readable */
  .bg-parallax { background-position: 40% 50%; }
  .bg-parallax::after { background: linear-gradient(180deg, rgba(11,11,13,.7), rgba(11,11,13,.9)); }
}

/* Billing address autocomplete */
.billing-title { font-size: 1.05rem; margin: 22px 0 10px; }
.addr-field { position: relative; }
.addr-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 4px 0 0; padding: 6px;
  list-style: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); max-height: 260px; overflow-y: auto; }
.addr-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; line-height: 1.3; }
.addr-list li:hover, .addr-list li.active { background: rgba(212,166,74,.14); }
.row-3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 520px) { .row-3 { grid-template-columns: 1fr 1fr; } .row-3 .field:first-child { grid-column: 1 / -1; } }

/* Reference number + copy button */
.ref-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.ref-row .ref { margin: 0; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: .9rem; min-height: 40px; }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

/* Edit history (admin) */
.edits .edit-old { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.edits .edit-final { color: var(--ok); font-weight: 600; }
.edits .edit-arrow { color: var(--muted); margin: 0 4px; }

/* Fake error pop-up (temporary test) */
.fake-error { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.75); display: grid; place-items: center; padding: 16px; }
.fake-error-box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid rgba(239,90,90,.5); border-radius: var(--radius); padding: 26px 22px; text-align: center; }
.fake-error-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: rgba(239,90,90,.15); color: var(--bad); font-size: 1.6rem; font-weight: 800; }
.fake-error-box h3 { color: var(--bad); }
.fake-error-box p { color: var(--muted); margin: 0 0 18px; }
.fake-error-box.shake { animation: fe-shake .4s; }
@keyframes fe-shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
