/* ═══════════════════════════════════════════════════════
   CodeRidge — OBD2 Scanner Interface CSS
   Semi-user-friendly: readable labels, scanner aesthetic
   ═══════════════════════════════════════════════════════ */

:root {
  /* Core Palette */
  --bg-primary:    #0a0a0c;
  --bg-card:       #111116;
  --bg-panel:      #13131a;
  --bg-input:      #07070a;
  --bg-scanner:    #0c0c14;

  --border:        #2a2a38;
  --border-light:  #353548;

  /* Brand Colors */
  --orange:        #f96b00;
  --orange-glow:   rgba(249, 107, 0, 0.35);
  --orange-dim:    rgba(249, 107, 0, 0.12);

  --blue:          #0ea5e9;
  --blue-glow:     rgba(14, 165, 233, 0.2);
  --blue-dim:      rgba(14, 165, 233, 0.08);

  --green:         #22c55e;
  --green-glow:    rgba(34, 197, 94, 0.2);
  --green-dim:     rgba(34, 197, 94, 0.08);

  --red:           #ef4444;

  /* Text */
  --text-primary:   #f0f0f5;
  --text-secondary: #9090a8;
  --text-muted:     #555568;

  /* Typography */
  --font-ui:    'Exo 2', sans-serif;
  --font-mono:  'Share Tech Mono', monospace;
  --font-hud:   'Orbitron', monospace;

  /* Misc */
  --radius-sm:  4px;
  --radius-md:  8px;
  --transition: 0.15s ease-out;
}

/* ── RESET & BASE ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle dot-grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Faint scanlines overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 1;   /* ← was 999; must stay below modals */
  opacity: 0.4;
}

body > * { position: relative; z-index: 1; }

a { color: var(--orange); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

/* ── TOP NAVIGATION ───────────────────────────────── */
#topBar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Brand */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.05em;
}

.brand-tagline {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

/* Nav Status */
.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Nav Actions Desktop */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Hide desktop auth buttons on small screens */
@media (max-width: 800px) {
  .desktop-upgrade { display: none !important; }
}
@media (max-width: 600px) {
  .nav-actions { display: none !important; }
}

/* Hamburger Btn (Mobile) */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 1rem;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
}
@media (max-width: 800px) {
  .hamburger-btn { display: flex; }
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-light);
  background: var(--blue-dim);
  border-radius: var(--radius-sm);
}

.user-badge-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.user-badge-email {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--orange-dim);
  color: var(--orange);
  border: 1px solid var(--orange);
}

/* Affiliate Band */
.affiliate-band {
  background: #0d0d12;
  border-top: 1px solid var(--border);
  padding: 0.35rem 1.5rem;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── FULL SCREEN NAV MENU ────────────────────────── */
.nav-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 300;
  opacity: 1;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: flex-end; /* Slides in from right */
}

.nav-menu-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.nav-menu-panel {
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-menu-overlay.hidden .nav-menu-panel {
  transform: translateX(100%);
}

.nav-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.nav-menu-title {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.nav-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.nav-menu-auth {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.nav-menu-user {
  background: var(--bg-input);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nav-user-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.nav-user-email {
  font-size: 0.9rem;
  color: var(--blue);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu-section {
  margin-bottom: 2rem;
}

.nav-menu-section h3 {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.nav-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-menu-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.nav-menu-link:hover, .nav-menu-link:active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--orange);
  color: var(--orange);
}

.nav-pro-badge {
  margin-left: auto;
  font-size: 0.55rem;
  background: var(--orange);
  color: #000;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 800;
}

/* ── BUTTONS ──────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-search, .btn-plan, .btn-plan--primary, .btn-plan--orange, .btn-plan--green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #000;
  font-weight: 800;
}

.btn-primary:hover {
  background: #fff;
  border-color: #fff;
  color: #000;
  box-shadow: 0 0 20px var(--orange-glow);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
}

.btn-search {
  background: var(--blue);
  border-color: var(--blue);
  color: #000;
  font-weight: 800;
  padding: 0 2rem;
  font-size: 0.85rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex-shrink: 0;
}

.btn-search:hover {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 20px var(--blue-glow);
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color var(--transition);
  font-family: var(--font-ui);
}

.link-btn:hover { color: var(--orange); }

/* ── SCANNER HERO ─────────────────────────────────── */
.scanner-hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(14,165,233,0.04) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-scanner) 100%);
}

.scan-sweep {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  box-shadow: 0 0 12px var(--blue);
  animation: sweep 4s ease-in-out infinite;
  opacity: 0.4;
  pointer-events: none;
}

@keyframes sweep {
  0%   { top: -4px; opacity: 0; }
  5%   { opacity: 0.6; }
  95%  { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

.scanner-hero-inner {
  max-width: 860px;
  margin: 0 auto;
}

/* Scanner Display Panel — looks like a physical device screen */
.scanner-display-panel {
  background: var(--bg-panel);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(14,165,233,0.1),
    0 24px 48px rgba(0,0,0,0.6),
    0 0 60px rgba(14,165,233,0.06);
  margin-bottom: 1.5rem;
}

.scanner-display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
  background: #0d0d16;
  border-bottom: 1px solid var(--border);
}

.sdh-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sdh-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  animation: blink-led 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes blink-led {
  0%, 90%, 100% { opacity: 1; }
  95%           { opacity: 0.2; }
}

.sdh-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sdh-version {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--green);
  letter-spacing: 0.15em;
}

.scanner-display-body {
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

/* Hero Text */
.hero-headline {
  font-family: var(--font-hud);
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  text-transform: none;
}

.highlight-orange {
  color: var(--orange);
  text-shadow: 0 0 30px var(--orange-glow);
}

.hero-subtext {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.65;
  font-weight: 400;
}

/* ── SEARCH PANEL ─────────────────────────────────── */
.search-panel {
  position: relative;
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.search-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--blue);
  margin-bottom: 0.5rem;
  text-align: left;
  font-family: var(--font-mono);
}

.search-row {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--blue);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
  box-shadow: 0 0 30px var(--blue-glow), inset 0 0 20px rgba(14,165,233,0.04);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.search-row:focus-within {
  border-color: #fff;
  box-shadow: 0 0 40px var(--blue-glow);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0 1rem;
  gap: 0.75rem;
}

.search-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.5;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  padding: 1rem 0;
  letter-spacing: 0.05em;
}

.search-input::placeholder {
  color: #2a2a38;
  font-size: 0.9rem;
}

.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--bg-input) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ── SEARCH DROPDOWN ──────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0d0d16;
  border: 2px solid var(--blue);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 40;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0,0,0,0.6);
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.search-dropdown-item:last-child { border-bottom: none; }

.search-dropdown-item:hover {
  background: var(--blue-dim);
}

.sdi-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--orange);
  width: 5.5rem;
  flex-shrink: 0;
}

.sdi-title {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdi-sev {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── QUICK CODE CHIPS ─────────────────────────────── */
.quick-codes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quick-codes-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #0d0d16;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.code-chip:hover {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--orange-dim);
}

/* ── STATS ROW ────────────────────────────────────── */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 1rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-hud);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
  display: block;
}

.stat-open { color: var(--green); }

.stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.4rem;
  font-weight: 600;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── FILTER / CATEGORY BAR ────────────────────────── */
.filter-bar {
  position: sticky;
  top: 64px; /* height of navbar */
  z-index: 30;
  background: rgba(10, 10, 12, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.filter-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.filter-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 1.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: var(--font-ui);
}

.filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}

.filter-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
  background: var(--orange-dim);
}

.tab-icon { font-size: 0.85rem; }

.pro-tag {
  font-size: 0.5rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  background: var(--orange);
  color: #000;
  border-radius: 3px;
  letter-spacing: 0.05em;
  margin-left: 0.2rem;
}

/* ── SECTION HEADER ───────────────────────────────── */
.section-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.section-header-inner h2 {
  font-family: var(--font-hud);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.section-header-inner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* ── RESULTS GRID ─────────────────────────────────── */
.results-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* Code Cards */
.code-card-hud {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.code-card-hud::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--border);
  transition: background var(--transition);
}

.code-card-hud:hover {
  border-color: var(--blue);
  background: #14141e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px var(--blue-glow);
}

.code-card-hud:hover::before {
  background: var(--blue);
}

.code-card-hud .code {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--orange);
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.code-card-hud .title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.severity-hud {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  border: 1px solid currentColor;
}

/* ── SEVERITY LEVELS ──────────────────────────────── */
.severity--critical { color: #fff; background: rgba(239,68,68,0.2); border-color: var(--red); }
.severity--high     { color: var(--orange); background: var(--orange-dim); border-color: var(--orange); }
.severity--medium   { color: #f5c400; background: rgba(245,196,0,0.1); border-color: #f5c400; }
.severity--low      { color: var(--green); background: var(--green-dim); border-color: var(--green); }
.severity--info     { color: var(--blue); background: var(--blue-dim); border-color: var(--blue); }

/* ── LOADING STATE ────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── PAGINATION ───────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ── UPGRADE BANNER ───────────────────────────────── */
.upgrade-banner {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--orange-dim), transparent 60%);
  padding: 3rem 1.5rem;
  margin: 2rem 0;
}

.upgrade-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.upgrade-banner-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.upgrade-banner-text {
  flex: 1;
  min-width: 200px;
}

.upgrade-banner-text h3 {
  font-family: var(--font-hud);
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.upgrade-banner-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── MODALS ───────────────────────────────────────── */
.modal-overlay:not(.hidden) {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;          /* above nav (50) and scanlines (1) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;      /* lets the overlay itself scroll if panel is too tall */
}

.modal-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;      /* hard cap — always scrollable */
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
}

.modal-close:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── DTC DETAIL MODAL CONTENT ─────────────────────── */
.dtc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* .dtc-code-block — container for dtc code + title */

.dtc-code {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
  display: block;
}

.dtc-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.4rem;
  line-height: 1.3;
}

.dtc-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dtc-meta-cell {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.dtc-meta-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
}

.dtc-meta-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dtc-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dtc-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--blue-dim);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.dtc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.dtc-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dtc-list li .li-marker {
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-weight: 700;
}

.dtc-save-bar {
  margin-bottom: 1.5rem;
}

/* ── AUTH MODAL ───────────────────────────────────── */
.auth-modal {
  max-width: 440px !important;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.auth-title {
  font-family: var(--font-hud);
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.form-input::placeholder { color: var(--text-muted); }

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--red);
  font-weight: 600;
}

.auth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auth-footer {
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

/* ── PRICING MODAL ────────────────────────────────── */
.pricing-modal {
  max-width: 1080px !important;
  padding: 2rem !important;
}

.pricing-inner {
  padding: 0.5rem;
}

.pricing-header {
  text-align: center;
  margin-bottom: 2rem;
}

.pricing-title {
  font-family: var(--font-hud);
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.pricing-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Billing Toggle */
.billing-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.billing-toggle {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.billing-btn {
  padding: 0.45rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.billing-btn.active {
  background: #fff;
  color: #000;
}

.billing-btn:not(.active):hover { color: var(--text-primary); }

.save-badge {
  padding: 0.1rem 0.35rem;
  background: var(--green);
  color: #000;
  font-size: 0.55rem;
  font-weight: 800;
  border-radius: 3px;
}

/* Plans Grid — always 4 columns above mobile, 2 on tablet, 1 on phone */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .plans-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.plan-card--highlighted {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue-glow);
}

.plan-card--pro {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange-glow);
}

.plan-card--shop {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green-glow);
}

.plan-recommended {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--orange);
  color: #000;
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.75rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.plan-header {
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
}

.plan-badge {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

.plan-badge--basic    { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue); }
.plan-badge--standard { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue); }
.plan-badge--pro      { background: var(--orange-dim); color: var(--orange); border: 1px solid var(--orange); }
.plan-badge--shop     { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }

.plan-price-row {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.plan-price {
  font-family: var(--font-hud);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.plan-period {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.plan-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.plan-features {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.plan-features li {
  font-size: 0.78rem;
  font-weight: 500;
}

.feature-on  { color: var(--text-secondary); }
.feature-off { color: var(--text-muted); }

/* Plan Buttons */
.btn-plan {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: var(--font-ui);
}

.btn-plan:hover {
  border-color: var(--text-secondary);
  color: #fff;
}

.btn-plan--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #000;
}

.btn-plan--primary:hover {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 16px var(--blue-glow);
}

.btn-plan--orange {
  background: var(--orange);
  border-color: var(--orange);
  color: #000;
}

.btn-plan--orange:hover {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 16px var(--orange-glow);
}

.btn-plan--green {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.btn-plan--green:hover {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 16px var(--green-glow);
}

/* ── FOOTER ───────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: #07070a;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.footer-brand-name {
  font-family: var(--font-hud);
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.footer-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-heading {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links li,
.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text-primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-bottom p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-disclaimer { font-style: italic; }

/* ── TOAST ────────────────────────────────────────── */
.toast-hud {
  background: var(--bg-panel) !important;
  border: 1px solid var(--blue) !important;
  border-radius: var(--radius-md) !important;
  color: #fff !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  padding: 1rem 1.5rem !important;
  font-size: 0.85rem !important;
  pointer-events: auto !important;
}

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 768px) {
  .stats-row { flex-wrap: wrap; }
  .stat-divider { display: none; }
  .stat-item { flex: 0 0 50%; border-bottom: 1px solid var(--border); }
  .nav-status { display: none; }
  .footer-cols { grid-template-columns: 1fr; gap: 2rem; }
  .auth-buttons { grid-template-columns: 1fr; }
  .dtc-meta-row { grid-template-columns: 1fr 1fr; }
  .modal-panel { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .nav-actions .btn-primary { display: none; }
  .hero-headline { font-size: 1.5rem; }
  .scanner-display-body { padding: 1.5rem 1rem; }
  .plans-grid { grid-template-columns: 1fr; }
}

/* ── UTILITY ──────────────────────────────────────── */
.hidden { display: none !important; }

/* Spinner for buttons */
.spinner-sm {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Tailwind compat overrides */
/* .btn-hud — legacy HUD button wrapper (kept for JS compatibility) */
.btn-hud--primary         { background: var(--blue) !important; border-color: var(--blue) !important; color: #000 !important; }
.btn-hud--orange          { background: var(--orange) !important; border-color: var(--orange) !important; color: #000 !important; }
