/* === BMW VIN Check — Apple-style design system === */

:root {
  /* Apple neutrals */
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-soft: #fbfbfd;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --hairline: rgba(0, 0, 0, 0.08);
  --hairline-strong: rgba(0, 0, 0, 0.14);

  /* Text */
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --ink-4: #a1a1a6;

  /* BMW M accent palette */
  --bmw-blue-deep: #0653b6;
  --bmw-blue: #1c69d4;
  --bmw-cyan: #4aa9ff;
  --bmw-violet: #6f3a8a;
  --bmw-red: #e22718;
  --bmw-orange: #ff5b1a;

  /* Semantic */
  --success: #2e9b54;
  --warning: #f08a1d;
  --danger: #d23728;

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Density */
  --density-base: 1;
  --pad-1: calc(8px * var(--density-base));
  --pad-2: calc(12px * var(--density-base));
  --pad-3: calc(16px * var(--density-base));
  --pad-4: calc(24px * var(--density-base));
  --pad-5: calc(32px * var(--density-base));
  --pad-6: calc(48px * var(--density-base));
  --pad-7: calc(72px * var(--density-base));

  /* Type scale */
  --type-scale: 1;
  --t-xs: calc(12px * var(--type-scale));
  --t-sm: calc(14px * var(--type-scale));
  --t-base: calc(16px * var(--type-scale));
  --t-md: calc(18px * var(--type-scale));
  --t-lg: calc(22px * var(--type-scale));
  --t-xl: calc(28px * var(--type-scale));
  --t-2xl: calc(36px * var(--type-scale));
  --t-3xl: calc(48px * var(--type-scale));
  --t-4xl: calc(64px * var(--type-scale));
  --t-5xl: calc(88px * var(--type-scale));

  /* Shadows */
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-elev: 0 2px 6px rgba(0,0,0,0.05), 0 24px 60px rgba(0,0,0,0.10);
  --shadow-deep: 0 30px 80px -20px rgba(28, 105, 212, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
/* Use overflow-x: clip on the html element instead of body — this prevents
   horizontal overflow without breaking position:fixed/sticky in Safari. */
html { overflow-x: clip; }
body.bmw-body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  font-size: var(--t-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
  /* fallback for browsers without overflow:clip (very old Safari) */
  max-width: 100vw;
}

button, input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* App scaffolding */
.bmw-app {
  min-height: 100vh;
  width: 100%;
  position: relative;
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(28,105,212,0.10), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(111,58,138,0.07), transparent 55%),
    var(--bg);
}

/* Liquid glass */
.glass {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 0 rgba(255,255,255,0.2),
    0 1px 2px rgba(0,0,0,0.04),
    0 12px 40px rgba(0,0,0,0.06);
}
.glass-strong {
  background: var(--surface-strong);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
}

/* Top nav */
.bmw-nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 100;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  color: var(--ink-2);
  max-width: calc(100% - 32px);
}
.bmw-nav .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px;
  font-weight: 600;
  color: var(--ink);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #e6e6ea 60%, #cfcfd6);
  position: relative;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px #1d1d1f, 0 1px 2px rgba(0,0,0,0.2);
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: conic-gradient(from 0deg, #1c69d4 0 25%, #fff 25% 50%, #1c69d4 50% 75%, #fff 75% 100%);
}
.brand-mark::after {
  inset: 3px;
  -webkit-mask: radial-gradient(circle at center, transparent 6px, #000 6px);
          mask: radial-gradient(circle at center, transparent 6px, #000 6px);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 10px; color: var(--ink-3); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 2px; }

.bmw-nav-items { display: flex; align-items: center; gap: 2px; }
.bmw-nav-item {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
  white-space: nowrap;
  color: var(--ink-2);
  font-weight: 500;
  border: none;
  background: transparent;
  font-size: var(--t-sm);
}
.bmw-nav-item:hover { background: rgba(0,0,0,0.05); color: var(--ink); }
.bmw-nav-item.active {
  background: var(--ink);
  color: #fff;
}
.bmw-nav .cta {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, #2a7af0 0%, var(--bmw-blue) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(28,105,212,0.35);
  cursor: pointer;
  border: none;
  font-size: var(--t-sm);
}
.bmw-nav .cta:hover { transform: translateY(-1px); }

.bmw-nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.bmw-nav-toggle span {
  display: block; width: 18px; height: 1.5px; background: var(--ink-2); border-radius: 1px;
  margin: 4px 0;
}

@media (max-width: 760px) {
  .bmw-nav { gap: 4px; padding: 6px 8px; }
  .bmw-nav-items { display: none; }
  /* Detach from .bmw-nav (which is fixed + transformed) and anchor to the
     viewport so the menu never overflows. */
  .bmw-nav-items.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed;
    top: 76px;
    left: 16px;
    right: 16px;
    max-width: 360px;
    margin-left: auto;
    width: auto;
    z-index: 1100;
    background: var(--surface-strong); backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--r-md);
    padding: 8px;
    box-shadow: 0 20px 60px rgba(10,26,59,0.18);
    gap: 2px;
  }
  .bmw-nav-items.open .bmw-nav-item {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: var(--t-base);
    text-align: left;
  }
  .bmw-nav-toggle { display: flex; flex-direction: column; }
  .brand-text { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-size: var(--t-base);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-primary {
  background: linear-gradient(180deg, #2a7af0 0%, var(--bmw-blue) 100%);
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(28,105,212,0.55), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-primary:hover { box-shadow: 0 14px 36px -8px rgba(28,105,212,0.65), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(0,0,0,0.4);
}
.btn-ghost {
  background: rgba(0,0,0,0.04);
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(0,0,0,0.08); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}
.btn-outline:hover { background: rgba(0,0,0,0.04); }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-lg { padding: 18px 30px; font-size: var(--t-md); }
.btn-sm { padding: 10px 16px; font-size: var(--t-sm); }
.btn-xs { padding: 6px 12px; font-size: var(--t-xs); }
.btn-block { width: 100%; }

/* Typography helpers */
.eyebrow {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bmw-blue);
  font-weight: 600;
}
.h-display {
  font-size: clamp(48px, 7vw, var(--t-5xl));
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.h-display .accent {
  background: linear-gradient(100deg, var(--bmw-cyan) 0%, var(--bmw-blue) 30%, var(--bmw-violet) 65%, var(--bmw-red) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.h-section {
  font-size: clamp(28px, 4.5vw, var(--t-3xl));
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0;
}
.h-card {
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.lede {
  font-size: var(--t-md);
  color: var(--ink-2);
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* Layout */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad-4);
}
.section { padding: var(--pad-7) 0; }
/* Custom flex helpers — renamed to avoid clash with Bootstrap's .row/.col grid. */
.bmw-row { display: flex; align-items: center; gap: var(--pad-3); }
.bmw-col { display: flex; flex-direction: column; gap: var(--pad-3); }
.between { justify-content: space-between; }
.text-center { text-align: center; }
.flex-wrap { flex-wrap: wrap; }

/* Hero */
.hero {
  position: relative;
  padding-top: 130px;
  padding-bottom: var(--pad-7);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--pad-6);
  align-items: center;
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--pad-5); }
  .hero { padding-top: 110px; }
}

.eyebrow-row {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(12px);
  font-size: var(--t-xs);
  color: var(--ink-2);
  margin-bottom: var(--pad-4);
}
.eyebrow-row .dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bmw-cyan), var(--bmw-blue), var(--bmw-violet), var(--bmw-red));
}

/* VIN form */
.vin-card {
  margin-top: var(--pad-5);
  padding: 14px 14px 14px 22px;
  border-radius: var(--r-xl);
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-strong);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 30px 80px -30px rgba(28,105,212,0.4),
    0 1px 2px rgba(0,0,0,0.04);
}
.vin-card .ico { color: var(--ink-3); display: flex; }
.vin-card input {
  flex: 1;
  border: none; outline: none;
  background: transparent;
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: 0.18em;
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-transform: uppercase;
  padding: 12px 4px;
  min-width: 0;
}
.vin-card input::placeholder { color: var(--ink-4); letter-spacing: 0.18em; }
.vin-hint {
  margin-top: 12px;
  font-size: var(--t-xs);
  color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
}
.vin-hint .pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(46,155,84,0.18);
}

/* Hero visual */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-xl);
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(74,169,255,0.5), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(226,39,24,0.35), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(111,58,138,0.5), transparent 60%),
    linear-gradient(180deg, #eef3fb 0%, #d9e3f5 100%);
  display: grid; place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 30px 70px -20px rgba(28,105,212,0.35);
}
.hero-visual::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 50% 100%, rgba(0,0,0,0.18), transparent 50%);
  pointer-events: none;
}
.hero-visual .badge-strip {
  position: absolute; top: 18px; left: 18px;
  display: flex; gap: 6px;
}
.hero-visual .badge-strip span {
  width: 28px; height: 8px; border-radius: 4px;
  background: var(--bmw-cyan);
}
.hero-visual .badge-strip span:nth-child(2) { background: var(--bmw-blue); }
.hero-visual .badge-strip span:nth-child(3) { background: var(--bmw-violet); }
.hero-visual .badge-strip span:nth-child(4) { background: var(--bmw-red); }

.meta-chip {
  position: absolute;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.meta-chip .lab { color: var(--ink-3); }
.meta-chip .val { color: var(--ink); font-weight: 600; }

/* Cards */
.card {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  padding: var(--pad-4);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
}
.card-glass {
  border-radius: var(--r-lg);
  padding: var(--pad-4);
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow-soft);
}
.card-lg { padding: var(--pad-5); border-radius: var(--r-xl); }

/* Feature grid */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pad-3);
}
@media (max-width: 900px) { .feat-grid { grid-template-columns: 1fr; } }
.feat {
  padding: var(--pad-4);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 12px;
  min-height: 220px;
}
.feat .icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(28,105,212,0.12), rgba(111,58,138,0.12));
  color: var(--bmw-blue);
}
.feat h3 { margin: 0; font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.02em; }
.feat p { margin: 0; color: var(--ink-3); font-size: var(--t-sm); line-height: 1.5; }

/* Stat strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pad-3);
}
@media (max-width: 760px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
.stat {
  padding: var(--pad-4);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
}
.stat .v { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.03em; }
.stat .l { font-size: var(--t-sm); color: var(--ink-3); margin-top: 4px; }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pad-3);
}
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
.step {
  position: relative;
  padding: var(--pad-4);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
}
.step .num {
  font-size: var(--t-xs); font-weight: 600;
  color: var(--bmw-blue);
  letter-spacing: 0.1em;
}
.step h4 { margin: 8px 0 6px; font-size: var(--t-md); font-weight: 600; letter-spacing: -0.02em; }
.step p { margin: 0; color: var(--ink-3); font-size: var(--t-sm); line-height: 1.5; }

/* Logos chips */
.logo-row { display: flex; flex-wrap: wrap; gap: var(--pad-3); align-items: center; opacity: 0.65; }
.logo-row .chip {
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--bg-elev); border: 1px solid var(--hairline);
  font-size: var(--t-sm); color: var(--ink-2); font-weight: 500;
}

/* Screen shell */
.screen-shell {
  min-height: 100vh;
  padding-top: 110px;
  padding-bottom: var(--pad-6);
}

/* VIN input screen */
.vin-screen-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--pad-5);
  align-items: start;
}
@media (max-width: 960px) { .vin-screen-grid { grid-template-columns: 1fr; } }

.vin-big {
  padding: var(--pad-5);
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
}
.vin-grid {
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  gap: 6px;
  margin-top: var(--pad-4);
}
@media (max-width: 680px) {
  .vin-grid { grid-template-columns: repeat(9, 1fr); }
}
.vin-cell {
  aspect-ratio: 1 / 1.2;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: clamp(16px, 2vw, 22px);
  color: var(--ink);
  transition: background .15s, border-color .15s, transform .15s;
}
.vin-cell.filled {
  background: #eaf1fb;
  border-color: rgba(28,105,212,0.3);
  color: var(--bmw-blue-deep);
}
.vin-cell.active {
  border-color: var(--bmw-blue);
  box-shadow: 0 0 0 4px rgba(28,105,212,0.15);
  background: #fff;
}

/* Preview card */
.preview-card {
  padding: var(--pad-4);
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
}
.preview-img {
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  background:
    radial-gradient(circle at 30% 20%, rgba(74,169,255,0.4), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(111,58,138,0.45), transparent 55%),
    linear-gradient(180deg, #e9eff8 0%, #c9d5ea 100%);
  position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.preview-img .stripe {
  position: absolute; bottom: 14px; left: 14px;
  display: flex; gap: 4px;
}
.preview-img .stripe span { width: 22px; height: 6px; border-radius: 3px; background: var(--bmw-cyan); }
.preview-img .stripe span:nth-child(2){ background: var(--bmw-blue); }
.preview-img .stripe span:nth-child(3){ background: var(--bmw-violet); }
.preview-img .stripe span:nth-child(4){ background: var(--bmw-red); }

.spec-row {
  display: flex; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--t-sm);
}
.spec-row:last-child { border-bottom: 0; }
.spec-row .k { color: var(--ink-3); }
.spec-row .v { color: var(--ink); font-weight: 600; }

/* Payment */
.pay-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad-5);
  align-items: start;
}
@media (max-width: 960px) { .pay-grid { grid-template-columns: 1fr; } }

.pay-card {
  padding: var(--pad-5);
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
}
.pay-total {
  display: flex; align-items: baseline; gap: 8px;
  margin: var(--pad-3) 0;
}
.pay-total .v {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 700; letter-spacing: -0.04em;
}
.pay-total .c { color: var(--ink-3); font-size: var(--t-lg); }

.pay-method {
  padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--bg-soft);
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  color: inherit;
}
.pay-method:hover { border-color: var(--hairline-strong); background: #fff; }
.pay-method.active {
  border-color: var(--bmw-blue);
  background: #eef4fc;
  box-shadow: 0 0 0 4px rgba(28,105,212,0.10);
}
.pay-method .logo {
  width: 44px; height: 30px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: #fff; background: var(--ink);
  flex-shrink: 0;
}
.pay-method .name { font-weight: 600; font-size: var(--t-base); }
.pay-method .desc { color: var(--ink-3); font-size: var(--t-xs); margin-top: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--t-xs); color: var(--ink-3); font-weight: 500; }
.field input, .field textarea, .field select {
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--bg-soft);
  outline: none;
  font-size: var(--t-base);
  transition: border-color .15s, box-shadow .15s;
  color: var(--ink);
  width: 100%;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--bmw-blue);
  box-shadow: 0 0 0 4px rgba(28,105,212,0.12);
  background: #fff;
}
.field-error { color: var(--danger); font-size: var(--t-xs); }
.field-hint { color: var(--ink-3); font-size: var(--t-xs); }

/* Report */
.report-hero {
  padding: var(--pad-5);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #0a1a3b 0%, #112b66 40%, #1c69d4 90%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.report-hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 90% 0%, rgba(74,169,255,0.5), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(226,39,24,0.4), transparent 50%);
  pointer-events: none;
}
.report-hero > * { position: relative; z-index: 1; }
.score-ring {
  width: 110px; height: 110px; border-radius: 50%;
  background:
    conic-gradient(#4aa9ff 0deg, #4aa9ff var(--ring-deg, 320deg), rgba(255,255,255,0.18) var(--ring-deg, 320deg));
  display: grid; place-items: center;
  position: relative;
  flex-shrink: 0;
}
.score-ring::before {
  content: ""; position: absolute; inset: 8px;
  border-radius: 50%; background: #0a1a3b;
}
.score-ring .sv {
  position: relative; z-index: 1;
  font-size: 32px; font-weight: 700; letter-spacing: -0.03em;
}

.report-cols {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--pad-4);
  margin-top: var(--pad-5);
}
@media (max-width: 900px) { .report-cols { grid-template-columns: 1fr; } }

.sidebar {
  position: sticky; top: 100px;
  padding: var(--pad-3);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  align-self: start;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar a {
  padding: 10px 12px; border-radius: 10px;
  font-size: var(--t-sm); color: var(--ink-2);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  transition: background .15s;
}
.sidebar a:hover { background: rgba(0,0,0,0.04); }
.sidebar a.active { background: var(--ink); color: #fff; }
.sidebar a .pill {
  font-size: 10px; padding: 2px 6px; border-radius: var(--r-pill);
  background: rgba(0,0,0,0.06); color: var(--ink-2);
}
.sidebar a.active .pill { background: rgba(255,255,255,0.18); color: #fff; }
.sidebar a .ico { display: inline-flex; margin-right: 6px; }

.report-section {
  padding: var(--pad-4);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  margin-bottom: var(--pad-3);
}
.report-section h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 var(--pad-3); font-size: var(--t-lg); font-weight: 600;
  letter-spacing: -0.02em;
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: var(--t-xs); font-weight: 600;
}
.tag-ok { background: rgba(46,155,84,0.12); color: #22884b; }
.tag-warn { background: rgba(240,138,29,0.14); color: #b56612; }
.tag-bad { background: rgba(210,55,40,0.12); color: #b62a1f; }
.tag-info { background: rgba(28,105,212,0.12); color: #1556a8; }
.tag-violet { background: rgba(111,58,138,0.12); color: #6f3a8a; }
.tag-neutral { background: rgba(0,0,0,0.06); color: var(--ink-2); }

.kv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad-3) var(--pad-4);
}
@media (max-width: 700px) { .kv-grid { grid-template-columns: 1fr; } }
.kv {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--hairline);
  font-size: var(--t-sm);
  gap: 12px;
}
.kv .k { color: var(--ink-3); }
.kv .v { color: var(--ink); font-weight: 600; text-align: right; }

.timeline {
  position: relative;
  margin-left: 8px; padding-left: 22px;
  border-left: 2px solid var(--hairline);
}
.tl-item { position: relative; padding: 10px 0 18px; }
.tl-item::before {
  content: ""; position: absolute;
  left: -29px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bmw-blue);
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--hairline);
}
.tl-item.bad::before { background: var(--danger); }
.tl-item.warn::before { background: var(--warning); }
.tl-date { font-size: var(--t-xs); color: var(--ink-3); }
.tl-title { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.01em; margin: 2px 0 6px; }
.tl-desc { font-size: var(--t-sm); color: var(--ink-2); }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 12px; }
.bar-chart .bar {
  flex: 1; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--bmw-cyan), var(--bmw-blue));
  position: relative;
  min-height: 4px;
}
.bar-chart .bar.warn { background: linear-gradient(180deg, #ffb35a, var(--warning)); }
.bar-chart .bar .lab {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--ink-3); white-space: nowrap;
}

/* Cabinet */
.cab-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: var(--pad-4);
}
@media (max-width: 900px) { .cab-grid { grid-template-columns: 1fr; } }

.cab-list {
  display: flex; flex-direction: column; gap: 10px;
}
.cab-item {
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  color: inherit;
}
.cab-item:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.cab-thumb {
  width: 56px; height: 56px; border-radius: 14px;
  background:
    radial-gradient(circle at 30% 30%, rgba(74,169,255,0.6), transparent 60%),
    linear-gradient(180deg, #dfe7f4, #c2cee5);
  display: grid; place-items: center;
  font-size: 10px; color: #fff; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.cab-item .ti { font-size: var(--t-md); font-weight: 600; letter-spacing: -0.01em; }
.cab-item .su { font-size: var(--t-xs); color: var(--ink-3); }

/* Footer */
.bmw-footer {
  padding: var(--pad-6) 0 var(--pad-4);
  color: var(--ink-3);
  font-size: var(--t-sm);
  border-top: 1px solid var(--hairline);
  margin-top: var(--pad-6);
}
.bmw-footer .cols {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--pad-5);
  margin-bottom: var(--pad-4);
}
@media (max-width: 800px) { .bmw-footer .cols { grid-template-columns: 1fr 1fr; } }
.bmw-footer h5 { color: var(--ink); margin: 0 0 12px; font-size: var(--t-sm); font-weight: 600; }
.bmw-footer a { display: block; padding: 4px 0; color: var(--ink-3); }
.bmw-footer a:hover { color: var(--ink); }
.bmw-footer .legal {
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.fade-up { animation: fadeUp .5s ease both; }
.float { animation: float 5s ease-in-out infinite; }

/* Flash */
.flash {
  max-width: 1280px;
  margin: 16px auto 0;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface-strong);
  backdrop-filter: blur(20px);
  font-size: var(--t-sm);
  color: var(--ink);
}
.flash.success { border-color: rgba(46,155,84,0.3); background: rgba(46,155,84,0.08); color: #22884b; }
.flash.error, .flash.danger { border-color: rgba(210,55,40,0.3); background: rgba(210,55,40,0.08); color: #b62a1f; }
.flash.warning, .flash.warn { border-color: rgba(240,138,29,0.3); background: rgba(240,138,29,0.08); color: #b56612; }
.flash.info { border-color: rgba(28,105,212,0.3); background: rgba(28,105,212,0.08); color: #1556a8; }

/* Auth screens */
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
@media (max-width: 900px) { .auth-screen { grid-template-columns: 1fr; } }

.auth-visual {
  position: relative;
  padding: var(--pad-6);
  background:
    radial-gradient(circle at 30% 20%, rgba(74,169,255,0.5), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(226,39,24,0.35), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(111,58,138,0.5), transparent 60%),
    linear-gradient(135deg, #0a1a3b 0%, #112b66 50%, #1c69d4 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 50% 100%, rgba(0,0,0,0.18), transparent 50%);
  pointer-events: none;
}
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual .quote { max-width: 460px; }
.auth-visual .quote h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
.auth-visual .quote p { margin-top: 14px; color: rgba(255,255,255,0.75); font-size: var(--t-md); line-height: 1.5; }
.auth-visual .quote-meta { color: rgba(255,255,255,0.55); font-size: var(--t-xs); letter-spacing: 0.16em; text-transform: uppercase; }
.auth-visual .auth-stripe { display: flex; gap: 6px; margin-bottom: 22px; }
.auth-visual .auth-stripe span { width: 36px; height: 8px; border-radius: 4px; background: var(--bmw-cyan); }
.auth-visual .auth-stripe span:nth-child(2) { background: var(--bmw-blue); }
.auth-visual .auth-stripe span:nth-child(3) { background: var(--bmw-violet); }
.auth-visual .auth-stripe span:nth-child(4) { background: var(--bmw-red); }
.auth-visual .auth-features {
  display: flex; flex-direction: column; gap: 12px;
}
.auth-visual .auth-features div {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--t-sm); color: rgba(255,255,255,0.85);
}
.auth-visual .auth-features .ico {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,0.12);
  display: grid; place-items: center; flex-shrink: 0;
}

.auth-form-wrap {
  padding: var(--pad-6) var(--pad-5);
  display: flex; flex-direction: column; justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.auth-form-wrap h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.auth-form-wrap .auth-sub { color: var(--ink-3); margin-top: 8px; font-size: var(--t-md); }
.auth-form-wrap form { display: flex; flex-direction: column; gap: 16px; margin-top: var(--pad-5); }
.auth-form-wrap .password-wrap { position: relative; }
.auth-form-wrap .password-wrap input { padding-right: 60px; }
.auth-form-wrap .password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none;
  font-size: var(--t-xs); font-weight: 600; color: var(--bmw-blue);
  cursor: pointer; padding: 6px 10px; border-radius: 8px;
}
.auth-form-wrap .password-toggle:hover { background: rgba(28,105,212,0.08); }
.auth-form-wrap .auth-options {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--t-sm); color: var(--ink-3);
}
.auth-form-wrap .auth-options a { color: var(--bmw-blue); font-weight: 500; }
.auth-form-wrap .auth-options a:hover { text-decoration: underline; }
.auth-form-wrap .auth-divider {
  position: relative; text-align: center; margin: 6px 0;
  font-size: var(--t-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.14em;
}
.auth-form-wrap .auth-divider::before, .auth-form-wrap .auth-divider::after {
  content: ""; position: absolute; top: 50%; width: calc(50% - 30px); height: 1px; background: var(--hairline);
}
.auth-form-wrap .auth-divider::before { left: 0; }
.auth-form-wrap .auth-divider::after { right: 0; }
.auth-form-wrap .google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: #fff;
  font-weight: 600; color: var(--ink);
  font-size: var(--t-base);
  cursor: pointer;
}
.auth-form-wrap .google-btn:hover { background: var(--bg-soft); }
.auth-form-wrap .auth-foot {
  text-align: center; color: var(--ink-3); font-size: var(--t-sm);
  margin-top: var(--pad-3);
}
.auth-form-wrap .auth-foot a { color: var(--bmw-blue); font-weight: 600; }

/* Quick request widget (in cabinet) */
.quick-request {
  background: linear-gradient(135deg, #f6f8fc 0%, #fff 100%);
  border-radius: var(--r-xl);
  padding: var(--pad-4) var(--pad-5);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
}
.quick-request-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 12px; flex-wrap: wrap;
}
.quick-request-title { font-weight: 600; font-size: var(--t-md); }
.quick-request-subtitle { font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }
.quick-request-badge {
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(28,105,212,0.1); color: var(--bmw-blue);
  font-size: var(--t-xs); font-weight: 600;
}
.quick-request-form { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.quick-request-form .field { flex: 1; min-width: 240px; gap: 0; }
.quick-request-form input {
  padding: 14px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: var(--t-base);
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.quick-request-form input:focus {
  border-color: var(--bmw-blue);
  box-shadow: 0 0 0 4px rgba(28,105,212,0.12);
}
.quick-request-meta {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px;
  font-size: var(--t-xs); color: var(--ink-3);
}
.quick-request-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Cabinet shell (sidebar + main) */
.cabinet-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) { .cabinet-shell { grid-template-columns: 1fr; } }
.cab-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--hairline);
  padding: var(--pad-4);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
@media (max-width: 900px) { .cab-side { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--hairline); } }
.cab-side-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px 18px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 16px;
}
.cab-side-section { margin-bottom: var(--pad-3); }
.cab-side-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-4); padding: 0 8px 8px;
}
.cab-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: var(--t-sm); color: var(--ink-2);
  text-decoration: none; transition: background .15s, color .15s;
  font-weight: 500;
}
.cab-side a:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.cab-side a.active { background: var(--ink); color: #fff; }
.cab-side a .badge {
  margin-left: auto;
  font-size: 10px; padding: 2px 6px; border-radius: var(--r-pill);
  background: rgba(0,0,0,0.06); color: var(--ink-2); font-weight: 600;
}
.cab-side a.active .badge { background: rgba(255,255,255,0.18); color: #fff; }
.cab-side a .badge.hot { background: rgba(226,39,24,0.12); color: #b62a1f; }
.cab-side a .badge.alert { background: rgba(240,138,29,0.14); color: #b56612; }
.cab-side a.active .badge.hot,
.cab-side a.active .badge.alert { background: rgba(255,255,255,0.18); color: #fff; }

.cab-side-foot {
  margin-top: auto; padding-top: var(--pad-3);
  border-top: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 10px;
}
.cab-side-foot .avatar {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, var(--bmw-blue), var(--bmw-violet));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; flex-shrink: 0;
}
.cab-side-foot .who { flex: 1; min-width: 0; }
.cab-side-foot .who-email { font-size: var(--t-xs); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-side-foot .who-role { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; }
.cab-side-foot button {
  background: rgba(0,0,0,0.04); border: none;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--ink-2);
  font-family: inherit; font-size: var(--t-sm);
}
.cab-side-foot button:hover { background: rgba(210,55,40,0.1); color: var(--danger); }

.cab-main {
  padding: var(--pad-5) var(--pad-5) var(--pad-6);
  min-width: 0;
}
@media (max-width: 700px) { .cab-main { padding: var(--pad-4) var(--pad-3); } }

.cab-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: var(--pad-4);
}
.cab-topbar .crumb {
  font-size: var(--t-md); font-weight: 600; letter-spacing: -0.02em;
}
.cab-topbar .crumb-sub { color: var(--ink-3); font-size: var(--t-xs); margin-top: 4px; }
.cab-balance {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(28,105,212,0.08), rgba(111,58,138,0.08));
  border: 1px solid rgba(28,105,212,0.15);
  font-size: var(--t-sm); font-weight: 600; color: var(--bmw-blue-deep);
}
.cab-balance .num { font-size: var(--t-md); }

/* Empty state */
.empty {
  padding: var(--pad-6) var(--pad-4);
  text-align: center;
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px dashed var(--hairline-strong);
}
.empty .ico {
  width: 60px; height: 60px; border-radius: 18px;
  margin: 0 auto var(--pad-3);
  background: linear-gradient(135deg, rgba(28,105,212,0.12), rgba(111,58,138,0.12));
  color: var(--bmw-blue); display: grid; place-items: center;
}
.empty h3 { font-size: var(--t-lg); font-weight: 600; margin: 0 0 6px; letter-spacing: -0.02em; }
.empty p { color: var(--ink-3); font-size: var(--t-sm); margin: 0 0 var(--pad-3); }

/* Tables */
.bmw-table { width: 100%; border-collapse: collapse; }
.bmw-table th {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-3); font-weight: 600;
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--hairline);
}
.bmw-table td {
  padding: 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--t-sm);
}
.bmw-table tr:hover td { background: var(--bg-soft); }
.bmw-table tr:last-child td { border-bottom: none; }

/* Utility */
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--pad-2); }
.center { display: grid; place-items: center; }
.mt-1 { margin-top: var(--pad-1); }
.mt-2 { margin-top: var(--pad-2); }
.mt-3 { margin-top: var(--pad-3); }
.mt-4 { margin-top: var(--pad-4); }
.mt-5 { margin-top: var(--pad-5); }
.mb-2 { margin-bottom: var(--pad-2); }
.mb-3 { margin-bottom: var(--pad-3); }
.mb-4 { margin-bottom: var(--pad-4); }
.mb-5 { margin-bottom: var(--pad-5); }
.gap-1 { gap: var(--pad-1); }
.gap-2 { gap: var(--pad-2); }
.gap-3 { gap: var(--pad-3); }
.gap-4 { gap: var(--pad-4); }
.flex-1 { flex: 1; }
.hidden { display: none; }
.no-wrap { white-space: nowrap; }

/* Toast (existing toast.js compatibility) */
.toast-host {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast-host > * { pointer-events: auto; }

/* SVG icon helper */
.ico-svg { display: inline-flex; vertical-align: -3px; }

/* ==================================================================
   Bootstrap integration & mobile fixes
   Layered on top of Bootstrap 5.3 — overrides for our brand palette
   ================================================================== */

/* Bootstrap container alignment — match our --pad-4 */
.container { padding-left: var(--pad-4); padding-right: var(--pad-4); }
@media (max-width: 576px) {
  .container { padding-left: 16px; padding-right: 16px; }
}

/* Re-color Bootstrap alerts to match our brand */
.alert { border-radius: var(--r-md); padding: 14px 18px; font-size: var(--t-sm); border: 1px solid var(--hairline); }
.alert.flash-success { background: rgba(46,155,84,0.08); border-color: rgba(46,155,84,0.3); color: #22884b; }
.alert.flash-error, .alert.flash-danger { background: rgba(210,55,40,0.08); border-color: rgba(210,55,40,0.3); color: #b62a1f; }
.alert.flash-warning, .alert.flash-warn { background: rgba(240,138,29,0.08); border-color: rgba(240,138,29,0.3); color: #b56612; }
.alert.flash-info { background: rgba(28,105,212,0.08); border-color: rgba(28,105,212,0.3); color: #1556a8; }

/* === Cabinet shell becomes a mobile drawer === */
@media (max-width: 991.98px) {
  .cabinet-shell {
    grid-template-columns: 1fr;
  }
  .cab-side {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    /* Cap width so backdrop is always visible & tappable to close */
    width: 84%;
    max-width: 320px;
    min-width: 260px;
    height: 100vh;
    z-index: 1050;
    border-right: 1px solid var(--hairline);
    border-bottom: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    transform: translateX(-100%);
    transition: transform 0.28s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Very narrow viewports: shrink so backdrop stays at least 40px wide */
  @media (max-width: 360px) {
    .cab-side { min-width: 240px; width: calc(100% - 56px); }
  }
  .cab-side.is-open { transform: translateX(0); }

  /* Close button inside the drawer (auto-added by JS) */
  .cab-side-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    border: none;
    cursor: pointer;
    display: grid; place-items: center;
    font-size: 18px;
    color: var(--ink-2);
    z-index: 2;
    line-height: 1;
    padding: 0;
  }
  .cab-side-close:hover { background: rgba(0,0,0,0.1); color: var(--ink); }
  .cab-side-logo { padding-right: 48px; } /* avoid overlap with close X */

  .cab-side-backdrop {
    position: fixed; inset: 0; z-index: 1040;
    background: rgba(10,26,59,0.5);
    backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  .cab-side-backdrop.is-open { opacity: 1; pointer-events: auto; }

  .cab-mobile-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--surface-strong);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--hairline);
    /* Fixed so it stays visible while user scrolls long pages */
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: 60px;
  }
  .cab-mobile-toggle {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--bg-elev);
    border: 1px solid var(--hairline);
    display: grid; place-items: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .cab-mobile-toggle span {
    display: block; width: 18px; height: 2px;
    background: var(--ink);
    margin: 3px 0;
    border-radius: 1px;
  }
  .cab-mobile-title {
    font-weight: 600;
    font-size: var(--t-md);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Pad main content so the fixed bar doesn't overlap it */
  .cab-main { padding: calc(60px + var(--pad-3)) var(--pad-3) var(--pad-5); }

  /* When drawer is open, lock body scroll without layout shift */
  body.drawer-open { overflow: hidden; touch-action: none; }
}
@media (min-width: 992px) {
  .cab-mobile-bar { display: none !important; }
  .cab-side-backdrop { display: none !important; }
  .cab-side-close { display: none !important; }
}

/* === Top nav becomes more compact on mobile === */
@media (max-width: 576px) {
  .bmw-nav { padding: 6px 8px; top: 10px; }
  .bmw-nav .brand { padding: 4px 8px; }
  .brand-text { display: none; }
  .bmw-nav .cta { padding: 6px 12px; font-size: var(--t-xs); }
}

/* === Hero on mobile === */
@media (max-width: 576px) {
  .hero { padding-top: 90px; padding-bottom: var(--pad-5); }
  .hero-visual { display: none; }
  .h-display { font-size: clamp(32px, 9vw, 48px) !important; }
  .vin-card { padding: 10px 10px 10px 16px; }
  .vin-card input { font-size: 16px; padding: 10px 4px; }
  .vin-card .btn { padding: 12px 14px; font-size: var(--t-sm); }
}

/* === Tables: horizontal scroll on mobile === */
.table-responsive-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
}
.bmw-table {
  min-width: 600px;
}
@media (max-width: 768px) {
  .bmw-table th, .bmw-table td {
    padding: 10px 12px;
    font-size: var(--t-xs);
  }
}

/* === Buttons: touch-friendly on mobile === */
@media (max-width: 576px) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .btn-xs { min-height: 32px; }
}

/* === Forms: full-width inputs on mobile === */
@media (max-width: 576px) {
  .field input, .field textarea, .field select {
    font-size: 16px; /* prevent iOS zoom on focus */
  }
  .bmw-row.between { flex-wrap: wrap; }
}

/* === Cabinet topbar on mobile === */
@media (max-width: 576px) {
  .cab-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .cab-balance .num { font-size: var(--t-md); }
}

/* === Stat strip on mobile (2 cols already, but tighter) === */
@media (max-width: 576px) {
  .stat-strip { gap: 8px; }
  .stat { padding: var(--pad-3); }
  .stat .v { font-size: var(--t-xl); }
  .stat .l { font-size: var(--t-xs); }
}

/* === Report hero on mobile === */
@media (max-width: 576px) {
  .report-hero { padding: var(--pad-4); }
  .score-ring { width: 80px; height: 80px; }
  .score-ring::before { inset: 6px; }
  .score-ring .sv { font-size: 22px; }
}

/* === Auth screen on mobile (already 1-col via @media 900px) === */
@media (max-width: 900px) {
  .auth-visual {
    padding: var(--pad-4);
    min-height: 200px;
  }
  .auth-visual .quote h2 { font-size: clamp(22px, 5vw, 32px); }
  .auth-form-wrap { padding: var(--pad-4); }
}

/* === Hero stripe & badges scale down === */
@media (max-width: 576px) {
  .feat-grid, .steps, .stat-strip {
    gap: 10px;
  }
  .feat { min-height: auto; padding: var(--pad-3); }
  .step { padding: var(--pad-3); }
}

/* === Bootstrap utilities playing nice with our flex helpers === */
.bmw-row.between { justify-content: space-between; }
.col-end { text-align: end; }

/* === Mobile modal sizing === */
@media (max-width: 576px) {
  .bmw-modal { padding: var(--pad-4); }
  .bmw-modal-close { top: 8px; right: 10px; }
}

/* === Sticky bottom CTA on hero (mobile) === */
@media (max-width: 576px) {
  .hero-cta-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .hero-cta-row .btn { width: 100%; }
}

/* === Quick request inline form on mobile === */
@media (max-width: 576px) {
  .quick-request-form { flex-direction: column; }
  .quick-request-form .field { min-width: 0; width: 100%; }
  .quick-request-form .btn { width: 100%; }
  .quick-request { padding: var(--pad-3); }
}

/* === Make Bootstrap row.g-* play well inside our containers === */
.bmw-app .row > *, .bmw-app .bmw-row > * { box-sizing: border-box; }

/* ==================================================================
   Cross-device polish — smooth harmony from mobile to desktop
   ================================================================== */

/* Tablet sweet spot: 768-991 — keep hero 2-col but shrink visual */
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: var(--pad-4);
  }
  .hero-visual {
    aspect-ratio: 4 / 3;
  }
  .hero-visual .meta-chip {
    font-size: 10px;
    padding: 8px 10px;
  }
  .h-display { font-size: clamp(40px, 6vw, 64px) !important; }
}

/* Below 768 — single column with reasonable visual height */
@media (max-width: 767.98px) {
  .hero {
    padding-top: 96px;
    padding-bottom: var(--pad-5);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--pad-4);
  }
  /* Show smaller visual on mobile too, not hide */
  .hero-visual {
    aspect-ratio: 16 / 10;
    max-height: 240px;
    order: -1;
  }
  .hero-visual .meta-chip {
    font-size: 9px;
    padding: 6px 8px;
  }
  .hero-visual .meta-chip[style*="top:80px"] { display: none; }
}

/* Mobile: hide visual completely on very small screens (< 480) */
@media (max-width: 479.98px) {
  .hero-visual { display: none; }
}

/* Smooth typography scaling — fluid display heading */
.h-display {
  font-size: clamp(32px, 6vw, 88px);
}
.h-section {
  font-size: clamp(24px, 4vw, 48px);
}

/* Stat strip cleaner sizes per breakpoint */
@media (min-width: 992px) {
  .stat .v { font-size: clamp(28px, 2.5vw, 40px); }
}

/* Cabinet shell on tablet (768-991) — narrower side */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .cabinet-shell { grid-template-columns: 230px 1fr; }
  .cab-main { padding: var(--pad-4); }
}

/* Cabinet main breathing room on big screens */
@media (min-width: 1400px) {
  .cab-main { padding: var(--pad-5) var(--pad-6) var(--pad-6); }
}

/* Make all <a> in cab-side stay aligned with icon */
.cab-side a > svg { flex-shrink: 0; }

/* Cabinet topbar: nicer wrap on mid-sizes */
@media (min-width: 577px) and (max-width: 991.98px) {
  .cab-topbar { gap: 14px; }
  .cab-topbar .bmw-row { flex-wrap: wrap; }
}

/* Top nav: nicer compactness on tablet */
@media (min-width: 577px) and (max-width: 991.98px) {
  .bmw-nav-items { gap: 0; }
  .bmw-nav-item { padding: 6px 10px; }
}

/* Reports cards: comfortable buttons row on mid-sizes */
@media (min-width: 577px) and (max-width: 991.98px) {
  .cab-list .card .bmw-row { flex-wrap: wrap; gap: 8px; }
}

/* Feature/step grids: smooth gap scaling */
.feat-grid, .steps, .kv-grid { gap: clamp(12px, 1.5vw, 24px); }

/* Forms inside cards keep consistent input height */
.field input, .field select, .field textarea { line-height: 1.45; }

/* Logo row chips look tighter on small screens */
@media (max-width: 576px) {
  .logo-row { gap: 8px; }
  .logo-row .chip { padding: 6px 10px; font-size: var(--t-xs); }
}

/* Auth screen vertical visual on small */
@media (max-width: 899.98px) {
  .auth-screen { min-height: auto; }
  .auth-visual { padding: var(--pad-5) var(--pad-4); }
  .auth-form-wrap { padding: var(--pad-5) var(--pad-4); }
}

/* Smooth section vertical rhythm */
.section { padding-top: clamp(40px, 7vw, 72px); padding-bottom: clamp(40px, 7vw, 72px); }

/* Footer columns breathing space across breakpoints */
.bmw-footer .cols { display: none; } /* legacy — we now use Bootstrap row */
.bmw-footer .row { row-gap: var(--pad-4); }
.bmw-footer h5 { margin-bottom: 10px; }

/* Make all .container side-padding consistent */
.bmw-app > .container,
.bmw-app section > .container,
.cab-main > .container {
  padding-left: clamp(16px, 4vw, 24px);
  padding-right: clamp(16px, 4vw, 24px);
}

/* Bigger touch targets for nav items on tablet */
@media (max-width: 991.98px) {
  .cab-side a { padding: 12px 14px; }
}

/* Hero visual gradient softer on small screens */
@media (max-width: 767.98px) {
  .hero-visual {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.9),
      0 16px 36px -16px rgba(28,105,212,0.3);
  }
}

/* Modal & toasts on small screens */
@media (max-width: 576px) {
  .toast-host { right: 12px; bottom: 12px; left: 12px; }
  .bmw-modal-ov { padding: 12px; }
}

/* Smooth hover scale on cards (desktop only) */
@media (min-width: 992px) and (hover: hover) {
  .feat:hover, .step:hover, .stat:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
  }
}

