:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #0b1220;
  --muted: #5b657a;
  --border: rgba(12, 18, 32, .10);
  --shadow: 0 10px 30px rgba(13, 18, 32, .08);
  --radius: 18px;

  /* BMW M Motorsport inspired accents */
  --m-light: #4DB5FF;
  --m-dark: #003C78;
  --m-red: #E2001A;

  --focus: rgba(77, 181, 255, .35);
  --ok: #17b26a;
  --warn: #f79009;
  --bad: #ef4444;

  --max: 1100px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(77, 181, 255, .18), transparent 60%),
    radial-gradient(900px 500px at 85% -5%, rgba(226, 0, 26, .10), transparent 55%),
    radial-gradient(900px 500px at 60% 110%, rgba(0, 60, 120, .12), transparent 55%),
    var(--bg);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}


.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(247, 248, 251, .75);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand img {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .10));
}

.brand .title {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand .title strong {
  font-size: 16px;
  letter-spacing: .2px;
}

.brand .title span {
  font-size: 12px;
  color: var(--muted);
}

.nav-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navlinks a {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.navlinks a.active {
  color: var(--text);
  background: rgba(255, 255, 255, .75);
  border-color: var(--border);
  box-shadow: 0 6px 20px rgba(13, 18, 32, .06);
}

.navlinks a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .65);
  border-color: var(--border);
  text-decoration: none;
}

.navlinks .btn-nav-auth {
  background: var(--m-dark);
  color: white;
  padding: 10px 20px;
}

.navlinks .btn-nav-auth:hover {
  background: var(--text);
  color: white;
  transform: translateY(-1px);
}

.hero {
  padding: 44px 0 26px;
}

.heroGrid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .heroGrid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cardPad {
  padding: 22px;
}

.ribbon {
  height: 8px;
  background: linear-gradient(90deg, var(--m-light), var(--m-dark) 55%, var(--m-red));
}

.h1 {
  font-size: 36px;
  letter-spacing: -0.4px;
  margin: 0 0 10px;
}

.p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 620px) {
  .kpis {
    grid-template-columns: 1fr;
  }
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(247, 248, 251, .5);
}

.kpi strong {
  display: block;
  font-size: 14px;
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
}

.btnRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(13, 18, 32, .06);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btnPrimary {
  border-color: rgba(0, 60, 120, .22);
  background: linear-gradient(90deg, rgba(77, 181, 255, .20), rgba(0, 60, 120, .14));
  text-align: center;
}

.badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
}

.section {
  padding: 18px 0 40px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.list li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.list li:first-child {
  border-top: none;
}

.dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--m-light), var(--m-red));
}

.footer {
  padding: 26px 0 70px;
  color: var(--muted);
  font-size: 13px;
}

.footer .fine {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.inputRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.input {
  flex: 1 1 320px;
  min-width: 260px;
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .85);
  outline: none;
}

.input:focus {
  box-shadow: 0 0 0 4px var(--focus);
  border-color: rgba(77, 181, 255, .55);
}

.smallHint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.result {
  margin-top: 16px;
  border: 1px dashed rgba(0, 60, 120, .26);
  border-radius: 14px;
  padding: 14px;
  background: rgba(77, 181, 255, .06);
  overflow: auto;
}

pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  color: #0f172a;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(11, 18, 32, .15);
  border-top-color: rgba(0, 60, 120, .75);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
  font-size: 13px;
}

.notice strong {
  color: var(--text);
}

/* Mandatory cookie banner overlay */
.cookieBar {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(11, 18, 32, .45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.cookieBar.show {
  display: flex !important;
}

.cookieBox {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(13, 18, 32, .25);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.cookieBox p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.cookieBox .cookieBtns {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.cookieBox .cookieBtns button {
  flex: 1;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: white;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cookieBox .cookieBtns button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.cookieBox .cookieBtns button.primary {
  border-color: rgba(0, 60, 120, .22);
  background: linear-gradient(90deg, var(--m-light), var(--m-dark));
  color: white;
  border: none;
}

body.cookie-open {
  overflow: hidden;
}

/* Maps page */
.searchRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.searchRow .input {
  flex: 1 1 420px;
}

.mapGroup {
  margin-top: 14px;
}

.mapGroupHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mapList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mapItem {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(247, 248, 251, .45);
}

.mapLink {
  font-weight: 800;
  font-size: 14.5px;
  text-decoration: none;
}

.mapLink:hover {
  text-decoration: underline;
}

.mapMeta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}


/* VIN Selection Overlay (reusing mandatory modal pattern) */
.vinSelectionOverlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  background: rgba(11, 18, 32, .35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.vinSelectionOverlay.show {
  display: flex !important;
}

.vinSelectionBox {
  width: 100%;
  max-width: 650px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(13, 18, 32, .25);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vinOption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(247, 248, 251, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s;
}

.vinOption:hover {
  background: white;
  border-color: var(--m-light);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.vinOptionInfo {
  flex: 1;
  font-size: 14px;
}

.vinOptionInfo code {
  font-family: ui-monospace, sans-serif;
  font-weight: 800;
  color: var(--m-dark);
}

.vinOptionInfo strong {
  color: var(--text);
}

.vinOptionInfo .meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.vinOption .btnUse {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: var(--m-dark);
  color: white;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s;
}

.vinOption .btnUse:hover {
  transform: scale(1.05);
  background: var(--m-light);
}

/* VIN Results Display */
.resultCard {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  margin-top: 24px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  animation: fadeInResult 0.5s ease-out;
}

@keyframes fadeInResult {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vinMainInfo {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.vinLarge {
  font-size: 38px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.1;
}

.vinModelName {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin: 8px 0 0;
}

.vinMetaGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.vinMetaItem {
  display: flex;
  flex-direction: column;
}

.vinMetaLabel {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.vinMetaValue {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* Equipment Columns */
.eqGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 900px) {
  .eqGrid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.eqColumn h3 {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 2px solid var(--m-light);
  padding-bottom: 8px;
  margin: 0 0 16px;
  display: flex;
  justify-content: space-between;
}

.eqColumn h3 span {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.eqList {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eqItem {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.eqItem b {
  font-family: ui-monospace, monospace;
  color: var(--m-dark);
  font-weight: 800;
  display: inline-block;
  min-width: 45px;
}

/* Category chips + pagination */
.chipRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .75);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 900;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.chip:hover {
  color: var(--text);
}

.chip.active {
  color: var(--text);
  border-color: rgba(0, 60, 120, .22);
  background: linear-gradient(90deg, rgba(77, 181, 255, .20), rgba(0, 60, 120, .14));
}

.chipCount {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--border);
  color: var(--muted);
}

.pagerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pagerLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagerInfo {
  color: var(--muted);
  font-size: 12px;
}

.pagerRight {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pageSelect {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .85);
  font-weight: 800;
  color: var(--text);
  outline: none;
}

.pageSelect:focus {
  box-shadow: 0 0 0 4px var(--focus);
  border-color: rgba(77, 181, 255, .55);
}

/* Inline Auth & Stacked Layout */
.auth-zone {
  display: flex;
  align-items: center;
}

.inline-login {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-login .input {
  padding: 6px 12px;
  min-width: 140px;
  flex: none;
  font-size: 13px;
  border-radius: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.logged-as {
  color: var(--muted);
}

.logged-as strong {
  color: var(--text);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  gap: 6px;
}

.reg-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--m-dark);
  margin-left: 4px;
}

.notice-err {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.05);
  color: var(--bad);
}

.inputLabel {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
}

/* Modal System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.0);
  backdrop-filter: blur(0px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  display: flex !important;
  background: rgba(11, 18, 32, 0.4);
  backdrop-filter: blur(8px);
}

.modal-box {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.modal-overlay.show .modal-box {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.modal-content {
  padding: 24px;
  overflow-y: auto;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .nav {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .nav-right {
    align-items: center;
    margin-top: 14px;
  }

  .navlinks {
    justify-content: center;
  }

  .auth-zone {
    justify-content: center;
    margin-top: 10px;
  }

  .inline-login {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Tooltip for History button */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--text);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: var(--shadow);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* History overlay scrollable list */
.historyScrollList {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
}

.historyScrollList::-webkit-scrollbar {
  width: 6px;
}

.historyScrollList::-webkit-scrollbar-track {
  background: transparent;
}

.historyScrollList::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.historyItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(247, 248, 251, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.historyItem:hover {
  background: white;
  border-color: var(--m-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.historyVin {
  font-family: ui-monospace, monospace;
  font-weight: 800;
  color: var(--m-dark);
}

.historyDate {
  font-size: 11px;
  color: var(--muted);
}