:root {
  /* App palette (screenshot style) */
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #667085;
  --line: rgba(15, 23, 42, 0.12);
  --danger: #e11d48;

  --primary: #2563eb;
  --primary2: #1f66d1;
  --primaryHover: #1e4fd6;

  --inputBg: #ffffff;
  --inputBorder: rgba(15, 23, 42, 0.14);
  --inputBorderFocus: rgba(37, 99, 235, 0.55);
  --shadow: 0 10px 22px rgba(15, 23, 42, 0.08);

  /* Layout */
  --maxW: 720px;
  --sidePad: 18px;

  /* Bottom nav + floating scan */
  --navH: 74px;
  --scanSize: 88px;
  --scanLift: 18px;
  --scanBottomGap: 10px;

  /* Scanner vars (JS sets) */
  --sq: 300px;
  --hintSize: 16px;

  /* Lane frame vars (JS sets) */
  --laneX: 0px;
  --laneY: 0px;
  --laneW: 0px;
  --laneH: 0px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
}

/* a11y */
.srOnly {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  min-height: 100dvh;
  padding-bottom: calc(
    var(--navH) + env(safe-area-inset-bottom) + (var(--scanSize) / 2) + 22px
  );
}

/* =========================
   HERO IMAGE (full-bleed)
   ========================= */
.hero {
  width: 100%;
}
.hero__img {
  width: 100%;
  height: auto; /* show full image */
  display: block;
}
/* =========================
   TOP BAR
   ========================= */
.topBar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.topBar__inner {
  max-width: var(--maxW);
  margin: 0 auto;
  padding: 14px var(--sidePad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.14);
  color: var(--primary2);
  display: grid;
  place-items: center;
}
.brand__name {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 18px;
  color: #0b1220;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trust {
  color: rgba(15, 23, 42, 0.55);
}

/* =========================
   PAGE
   ========================= */
.page {
  max-width: var(--maxW);
  margin: 0 auto;
  padding: 16px var(--sidePad) 0;
}
.intro {
  text-align: center;
  padding: 10px 0 18px;
}
.intro__title {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 34px);
  letter-spacing: -0.01em;
  font-weight: 900;
  color: #0b1220;
}
.intro__sub {
  margin: 8px 0 0;
  font-size: 16px;
  color: rgba(15, 23, 42, 0.62);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 14px;
}

/* =========================
   CARDS
   ========================= */
.card {
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card__head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.02);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.card__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary2);
  display: grid;
  place-items: center;
}
.card__title {
  font-weight: 900;
  font-size: 18px;
  color: #0b1220;
}
.card__body {
  padding: 16px;
}
.card--nested {
  margin-top: 12px;
  box-shadow: none;
  border-radius: 16px;
}

/* =========================
   FORM + FIELDS
   ========================= */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
}
.label__muted {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(15, 23, 42, 0.4);
  margin-left: 6px;
  text-transform: none;
}

.req {
  color: var(--danger);
  margin-left: 6px;
  font-weight: 900;
}
.req--off {
  display: none;
}

.input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--inputBorder);
  background: var(--inputBg);
  color: #0b1220;
  font-size: 16px;
  padding: 0 14px;
  outline: none;
  appearance: none;
}

.input::placeholder {
  color: rgba(15, 23, 42, 0.35);
}

.input:focus {
  border-color: var(--inputBorderFocus);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.input[disabled] {
  opacity: 0.55;
  background: rgba(15, 23, 42, 0.03);
}

.input--vin {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 650;
  height: 56px;
  font-size: 18px;
}

.fieldError {
  margin: -2px 0 0;
  min-height: 16px;
  font-size: 13px;
  color: var(--danger);
}

.status {
  margin: -4px 0 0;
  min-height: 18px;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.55);
}
.status[data-kind="ok"] {
  color: rgba(16, 185, 129, 0.95);
}
.status[data-kind="error"] {
  color: rgba(225, 29, 72, 0.95);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 620px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 6px 0 2px;
}

/* Radio/Checks */
.radioRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.radio {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.02);
  font-size: 14px;
  color: rgba(15, 23, 42, 0.8);
}
.radio input {
  transform: translateY(0.5px);
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: rgba(15, 23, 42, 0.8);
}
.checkOther {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.input--other {
  height: 46px;
}

/* Money input */
.money {
  position: relative;
}
.money__prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(15, 23, 42, 0.45);
  font-weight: 800;
}
.input--money {
  padding-left: 28px;
}

/* Segmented control */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 380px) {
  .seg {
    grid-template-columns: 1fr;
  }
}
.seg__btn {
  height: 44px;
  border-radius: 12px;
  border: 2px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: rgba(15, 23, 42, 0.75);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.seg__btn[aria-pressed="true"] {
  border-color: rgba(37, 99, 235, 0.85);
  color: rgba(37, 99, 235, 1);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.seg__btn:active {
  transform: translateY(1px);
}

/* Message + CTA */
.msg {
  min-height: 22px;
  margin: 0;
  font-size: 14px;
  color: rgba(15, 23, 42, 0.7);
}
.msg[data-ok="0"] {
  color: var(--danger);
  font-weight: 650;
}

.cta {
  height: 64px;
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2);
}
.cta:hover {
  background: var(--primaryHover);
}
.cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cta__arrow {
  font-size: 20px;
  transform: translateY(-1px);
}

/* Honeypot */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* =========================
   FIXED BOTTOM NAV + SCAN BUTTON
   ========================= */
.bottomNav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  height: calc(var(--navH) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);

  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(15, 23, 42, 0.08);

  z-index: 2000;
}

/* Scan button anchored to bottom nav */
.scanBtn {
  position: absolute;
  left: 50%;
  bottom: calc(var(--scanBottomGap) + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(calc(-1 * var(--scanLift)));

  width: var(--scanSize);
  height: var(--scanSize);
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: #f6c21c;
  display: grid;
  place-items: center;
  cursor: pointer;

  z-index: 2100;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  -webkit-tap-highlight-color: transparent;
}

.scanBtn:active {
  transform: translateX(-50%) translateY(calc(-1 * var(--scanLift) + 1px));
}

.scanBtn__icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 999px;
  pointer-events: none;
}

/* =========================
   CAR INFO PANEL (kept + adapted to light theme)
   ========================= */
.carInfo {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  padding: 16px 16px 18px;
}
.carInfo__title {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
  color: #0b1220;
}
.carInfo__sub {
  margin: 6px 0 12px;
  font-size: 14px;
  font-weight: 650;
  color: rgba(15, 23, 42, 0.6);
}
.carInfo__grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  column-gap: 16px;
  row-gap: 10px;
  align-items: start;
}
.carInfo__k {
  font-size: 13px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.5);
}
.carInfo__v {
  font-size: 14px;
  font-weight: 650;
  color: rgba(15, 23, 42, 0.88);
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 420px) {
  .carInfo__grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   SCANNER OVERLAY (unchanged from your working version)
   ========================= */
.overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: #000;
  z-index: 9999;
  overflow: hidden;
}

.reader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#reader,
#reader__scan_region {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
}

#reader video,
#reader canvas,
#reader__scan_region video,
#reader__scan_region canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  object-fit: cover !important;
  z-index: 1 !important;
}

#reader__dashboard,
#reader__dashboard_section,
#reader__status_span,
#reader .qr-shaded-region,
#reader__scan_region .qr-shaded-region {
  display: none !important;
}

#reader__scan_region div {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

#reader img,
#reader__scan_region img {
  display: none !important;
}

.mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10 !important;
}

.frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--sq);
  height: var(--sq);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 20 !important;
}

.br {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 4px solid rgba(255, 255, 255, 0.98);
}

.br.tl {
  left: 0;
  top: 0;
  border-right: none;
  border-bottom: none;
}
.br.tr {
  right: 0;
  top: 0;
  border-left: none;
  border-bottom: none;
}
.br.bl {
  left: 0;
  bottom: 0;
  border-right: none;
  border-top: none;
}
.br.brc {
  right: 0;
  bottom: 0;
  border-left: none;
  border-top: none;
}

.hint {
  position: absolute;
  color: rgba(255, 255, 255, 0.95);
  font-size: var(--hintSize);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  letter-spacing: 0.2px;
  pointer-events: none;
}

@media (orientation: portrait) {
  .hint {
    right: 1px;
    top: 50%;
    left: auto;
    bottom: auto;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: translateY(-50%);
  }
}

@media (orientation: landscape) {
  :root {
    --hintSize: 14px;
  }
  .hint {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    left: 50%;
    top: 1px;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
  }
}

.laneFrame {
  position: absolute;
  left: var(--laneX);
  top: var(--laneY);
  width: var(--laneW);
  height: var(--laneH);
  pointer-events: none;
  z-index: 20 !important;
}

.lbr {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 4px solid rgba(255, 255, 255, 0.98);
}

.lbr.tl {
  left: 0;
  top: 0;
  border-right: none;
  border-bottom: none;
}
.lbr.tr {
  right: 0;
  top: 0;
  border-left: none;
  border-bottom: none;
}
.lbr.bl {
  left: 0;
  bottom: 0;
  border-right: none;
  border-top: none;
}
.lbr.brc {
  right: 0;
  bottom: 0;
  border-left: none;
  border-top: none;
}

.iconBtn {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 10000;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
}

.iconBtn--topRight {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
}

.iconBtn--bottomLeft {
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  font-size: 26px;
}

.iconBtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* =========================
   Bottom nav: phone + scan + IG (balanced, professional)
   ========================= */
.bottomNav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding-left: var(--sidePad);
  padding-right: var(--sidePad);
}

.navSide {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* extra spacing between side buttons and the center scan button */
.navSide--left {
  padding-right: 20px;
}
.navSide--right {
  padding-left: 20px;
}

.navLink {
  display: flex;
  flex-direction: column; /* icon above text */
  align-items: center;
  justify-content: center;
  gap: 6px;

  height: var(--navH);
  text-decoration: none;

  color: rgba(15, 23, 42, 0.88);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.2px;

  max-width: 100%;
}

.navText {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navIconWrap {
  width: 34px; /* slightly larger icon area */
  height: 34px;
  display: grid;
  place-items: center;
}

.navIconPng {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
  border-radius: 999px; /* if you use circular PNGs */
}

/* SVG fallback (always visible unless PNG loads) */
.navIconSvg {
  width: 30px;
  height: 30px;
  display: block;
  color: rgba(15, 23, 42, 0.92);
}
