/* ═══════════════════════════════════════
   PlacaCheck — Design System v2.1
   Civic Alert Direction (Claude Design)
   ═══════════════════════════════════════ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Semantic palette */
  --ok:       oklch(0.68 0.16 155);
  --ok-bg:    oklch(0.95 0.05 155);
  --ok-fg:    oklch(0.35 0.12 155);

  --warn:     oklch(0.74 0.17 75);
  --warn-bg:  oklch(0.96 0.05 80);
  --warn-fg:  oklch(0.40 0.14 60);

  --danger:   oklch(0.62 0.22 25);
  --danger-bg:oklch(0.95 0.04 25);
  --danger-fg:oklch(0.38 0.18 25);

  --info:     oklch(0.62 0.16 245);
  --info-bg:  oklch(0.95 0.04 245);
  --info-fg:  oklch(0.38 0.15 255);

  --hold:     oklch(0.52 0.22 295);
  --hold-bg:  oklch(0.94 0.05 295);
  --hold-fg:  oklch(0.35 0.18 295);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
}

/* ── LIGHT THEME (default) ── */
:root, [data-theme="light"] {
  --bg:          oklch(0.985 0.002 250);
  --bg-surface:  #ffffff;
  --bg-elev:     oklch(0.975 0.003 250);
  --bg-inset:    oklch(0.96 0.004 250);
  --fg:          oklch(0.18 0.01 260);
  --fg-muted:    oklch(0.50 0.01 260);
  --fg-subtle:   oklch(0.65 0.008 260);
  --border:      oklch(0.90 0.005 260);
  --border-strong: oklch(0.82 0.008 260);
  --accent:      oklch(0.58 0.19 255);
  --accent-fg:   #ffffff;
  --shadow-sm:   0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md:   0 4px 16px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:   0 20px 40px rgba(15,23,42,.10), 0 4px 8px rgba(15,23,42,.04);
}

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg:          oklch(0.18 0.015 260);
  --bg-surface:  oklch(0.22 0.018 260);
  --bg-elev:     oklch(0.26 0.02 260);
  --bg-inset:    oklch(0.15 0.015 260);
  --fg:          oklch(0.97 0.003 260);
  --fg-muted:    oklch(0.68 0.01 260);
  --fg-subtle:   oklch(0.55 0.012 260);
  --border:      oklch(0.30 0.02 260);
  --border-strong: oklch(0.38 0.025 260);
  --accent:      oklch(0.72 0.18 255);
  --accent-fg:   oklch(0.12 0.01 260);
  --shadow-sm:   0 1px 2px rgba(0,0,0,.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,.35);
  --shadow-lg:   0 20px 40px rgba(0,0,0,.45);
  --ok-bg:       oklch(0.28 0.06 155); --ok-fg: oklch(0.82 0.14 155);
  --warn-bg:     oklch(0.30 0.07 75);  --warn-fg: oklch(0.85 0.15 80);
  --danger-bg:   oklch(0.30 0.10 25);  --danger-fg: oklch(0.80 0.16 25);
  --info-bg:     oklch(0.28 0.07 245); --info-fg: oklch(0.80 0.13 245);
  --hold-bg:     oklch(0.28 0.08 295); --hold-fg: oklch(0.80 0.16 295);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s, color 0.2s;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input { font-family: inherit; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── LAYOUT ── */
#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* ── SCREENS ── */
.screen { min-height: 100vh; display: flex; flex-direction: column; }
.screen-scroll { flex: 1; overflow-y: auto; -ms-overflow-style: none; scrollbar-width: none; }
.screen-scroll::-webkit-scrollbar { display: none; }

/* ── HEADER (result screen) ── */
.result-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.result-topbar-meta { flex: 1; min-width: 0; }
.result-topbar-meta .label-mono { font-size: 11px; color: var(--fg-muted); font-family: var(--font-mono); letter-spacing: 0.08em; }
.result-topbar-meta .title { font-size: 14px; font-weight: 600; }

/* ── ICON BUTTON ── */
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }

/* ── HOME SCREEN ── */
.home-wrap {
  padding: 24px 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--fg);
  color: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 18px;
  flex-shrink: 0;
}

.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--fg-muted); font-family: var(--font-mono); letter-spacing: 0.06em; margin-top: 1px; }

.home-hero h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--fg);
}

.home-hero p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* Capture buttons */
.capture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-capture-primary,
.btn-capture-secondary {
  padding: 22px 16px;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  min-height: 120px;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn-capture-primary {
  background: var(--fg);
  color: var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.btn-capture-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-capture-primary:active { transform: translateY(0); }

.btn-capture-secondary {
  background: var(--bg-surface);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-capture-secondary:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.btn-capture-secondary:active { transform: translateY(0); }

.btn-capture-primary svg,
.btn-capture-secondary svg { width: 24px; height: 24px; }

.btn-capture-secondary svg { color: var(--fg-muted); }

.capture-label strong { display: block; font-size: 15px; font-weight: 600; }
.capture-label small { font-size: 12px; opacity: 0.7; margin-top: 2px; display: block; }
.btn-capture-secondary .capture-label small { color: var(--fg-muted); opacity: 1; }

/* Divider */
.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.or-divider span {
  font-size: 11px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Plate input */
.plate-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  background: var(--bg-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.plate-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.58 0.19 255 / 0.12);
}

.plate-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 14px;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 50px;
}

.plate-input-wrap input::placeholder {
  color: var(--fg-subtle);
  font-size: 16px;
  letter-spacing: 0.04em;
}

.btn-verify {
  background: var(--fg);
  color: var(--bg-surface);
  padding: 0 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: filter 0.15s, opacity 0.15s;
}

.btn-verify:disabled {
  background: var(--bg-inset);
  color: var(--fg-subtle);
}

.btn-verify:not(:disabled):hover { filter: brightness(1.1); }
.btn-verify svg { width: 15px; height: 15px; }

/* Demo chips */
.chips-section .chips-label {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chip-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}

.chip-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.chip-btn:active { transform: translateY(0); }

.chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-plate { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; }
.chip-label { font-size: 11px; color: var(--fg-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Home footer */
.home-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-subtle);
  padding-top: 8px;
}
.home-footer svg { width: 12px; height: 12px; }

/* ── PROCESSING SCREEN ── */
.processing-wrap {
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
}

.scanning-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scanning-label span {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.scanning-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.scan-preview {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #1a2535;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
}

.scan-preview-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #2a3a4a 0%, #1a2535 100%);
}

.scan-preview-inner {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.scan-preview-label {
  color: rgba(255,255,255,0.35);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

/* Scan overlay corners */
.scan-overlay { position: absolute; inset: 0; pointer-events: none; }

.scan-corner {
  position: absolute;
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.9);
  filter: drop-shadow(0 0 4px rgba(0,0,0,.5));
  animation: scan-pulse 2s ease-in-out infinite;
}

.scan-corner--tl { top: 8%; left: 6%; border-right: none; border-bottom: none; border-top-left-radius: 4px; }
.scan-corner--tr { top: 8%; right: 6%; border-left: none; border-bottom: none; border-top-right-radius: 4px; }
.scan-corner--bl { bottom: 8%; left: 6%; border-right: none; border-top: none; border-bottom-left-radius: 4px; }
.scan-corner--br { bottom: 8%; right: 6%; border-left: none; border-top: none; border-bottom-right-radius: 4px; }

@keyframes scan-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.scan-line {
  position: absolute;
  left: 6%; right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 20%, #fff 50%, var(--accent) 80%, transparent 100%);
  box-shadow: 0 0 12px var(--accent), 0 0 24px var(--accent);
  animation: scan-move 2.4s ease-in-out infinite;
}

@keyframes scan-move {
  0%, 100% { top: 0; opacity: 0; }
  10%, 90% { opacity: 1; }
  50% { top: calc(100% - 2px); }
}

/* Progress steps */
.progress-info { display: flex; flex-direction: column; gap: 12px; }

.progress-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-text { font-size: 15px; font-weight: 600; }
.progress-pct { font-size: 13px; color: var(--fg-muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-inset);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--fg);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.progress-step {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s;
}

.progress-step--active { background: var(--bg-surface); color: var(--fg); }
.progress-step--inactive { background: var(--bg-inset); color: var(--fg-subtle); }

.step-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.step-check { width: 12px; height: 12px; flex-shrink: 0; color: var(--ok); }

/* ── CONFIRM SCREEN ── */
.confirm-wrap {
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
}

.confirm-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.confirm-header-label {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.confirm-thumb {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #1a2535;
  aspect-ratio: 16 / 9;
}

.confirm-thumb-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.confirm-detected-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 5px;
}

.confirm-detected-badge svg { width: 10px; height: 10px; }

.confirm-field label {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 8px;
}

.confirm-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  transition: border-color 0.15s;
  overflow: hidden;
}

.confirm-input-wrap:focus-within { border-color: var(--accent); }

.confirm-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 18px;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.confirm-input-wrap .edit-btn {
  padding: 0 18px;
  color: var(--fg-muted);
  display: flex; align-items: center;
}

.confirm-input-wrap .edit-btn svg { width: 16px; height: 16px; }

.confirm-hint { margin-top: 8px; font-size: 12px; color: var(--fg-muted); }

.confirm-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

.btn-confirm-primary {
  width: 100%;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--fg);
  color: var(--bg-surface);
  font-size: 15px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter 0.15s;
}

.btn-confirm-primary:hover { filter: brightness(1.1); }
.btn-confirm-primary svg { width: 16px; height: 16px; }

.btn-confirm-ghost {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-md);
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: color 0.15s;
}
.btn-confirm-ghost:hover { color: var(--fg); }

/* ── PERU PLATE ── */
.peru-plate {
  display: inline-flex;
  align-items: stretch;
  background: #fafaf7;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.8),
    inset 0 -2px 4px rgba(0,0,0,.08),
    0 2px 4px rgba(0,0,0,.08);
  font-family: var(--font-mono);
  user-select: none;
}

.peru-plate__flag {
  width: 14%;
  min-width: 22px;
  display: flex;
  flex-direction: column;
  border-right: 1.5px solid #1a1a1a;
}

.peru-plate__flag-top,
.peru-plate__flag-bottom { flex: 1; background: #D91023; }
.peru-plate__flag-mid {
  flex: 1;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.peru-plate__flag-mid span {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.22em;
  color: #1a1a1a;
  letter-spacing: 0.04em;
}

.peru-plate__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.12em 0.6em 0.08em;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f0 100%);
}

.peru-plate__header {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.28em;
  letter-spacing: 0.28em;
  color: #1a1a1a;
  padding-left: 0.28em;
  line-height: 1.6;
  border-bottom: 0.5px solid rgba(0,0,0,.15);
  width: 100%;
  text-align: center;
}

.peru-plate__number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1em;
  letter-spacing: 0.08em;
  color: #0a0a0a;
  line-height: 1;
  margin-top: 0.12em;
  text-shadow: 0 0.5px 0 rgba(255,255,255,.4), 0 -0.5px 0 rgba(0,0,0,.2);
  flex: 1;
  display: flex; align-items: center;
}

.peru-plate__bolt {
  position: absolute;
  width: 0.18em; height: 0.18em;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #888, #333 60%, #1a1a1a);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,.3), 0 0.5px 1px rgba(0,0,0,.3);
}

.peru-plate__bolt--tl { top: 0.22em; left: 0.22em; }
.peru-plate__bolt--tr { top: 0.22em; right: 0.22em; }
.peru-plate__bolt--bl { bottom: 0.22em; left: 0.22em; }
.peru-plate__bolt--br { bottom: 0.22em; right: 0.22em; }

/* ── RESULT SCREEN ── */
.result-body {
  padding: 20px 20px 140px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Alert banner full-bleed */
.alert-banner-full {
  margin: -20px -20px 8px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.alert-banner-full--stolen { background: var(--danger); color: #fff; }
.alert-banner-full--hold { background: var(--hold); color: #fff; }

.alert-stripe {
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    45deg, rgba(0,0,0,.1), rgba(0,0,0,.1) 10px, transparent 10px, transparent 20px
  );
}

.alert-inner {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.alert-icon-box {
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.alert-icon-box svg { width: 26px; height: 26px; }

.alert-content { flex: 1; }
.alert-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; text-transform: uppercase; margin-bottom: 4px; }
.alert-body { font-size: 13px; line-height: 1.45; opacity: 0.95; }

.alert-cta-btn {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alert-cta-btn--stolen { color: var(--danger-fg); }
.alert-cta-btn--hold { color: var(--hold-fg); }
.alert-cta-btn svg { width: 14px; height: 14px; }

/* Plate + status hero */
.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0 8px;
}

/* Status badge large */
.status-badge-lg {
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid;
}

.status-badge-lg--ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok); }
.status-badge-lg--warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn); }
.status-badge-lg--danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger); }
.status-badge-lg--hold { background: var(--hold-bg); color: var(--hold-fg); border-color: var(--hold); }
.status-badge-lg--info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info); }

.status-icon-box {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.status-icon-box--ok { background: var(--ok); }
.status-icon-box--warn { background: var(--warn); }
.status-icon-box--danger { background: var(--danger); }
.status-icon-box--hold { background: var(--hold); }
.status-icon-box--info { background: var(--info); }
.status-icon-box svg { width: 22px; height: 22px; }

.status-text-label {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.status-text-sub {
  font-size: 13px;
  margin-top: 2px;
  opacity: 0.85;
  line-height: 1.35;
}

/* Result cards */
.result-card {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.result-card-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  text-transform: uppercase;
}

.result-card-header svg { width: 14px; height: 14px; flex-shrink: 0; }
.result-card-header span { flex: 1; }

.result-card-body { padding: 16px; }

/* Vehicle data grid */
.vehicle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.vehicle-field-label {
  font-size: 11px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vehicle-field-value { font-size: 14px; font-weight: 500; margin-top: 2px; word-break: break-word; }

/* Doc list */
.doc-item {
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.doc-item:last-child { border-bottom: none; padding-bottom: 0; }
.doc-item:first-child { padding-top: 0; }

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 14px; font-weight: 600; }
.doc-detail { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.doc-issuer { font-size: 11px; color: var(--fg-subtle); font-family: var(--font-mono); margin-top: 2px; }

.doc-status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.doc-status-pill--ok { background: var(--ok-bg); color: var(--ok-fg); }
.doc-status-pill--warn { background: var(--warn-bg); color: var(--warn-fg); }
.doc-status-pill--danger { background: var(--danger-bg); color: var(--danger-fg); }
.doc-status-pill--hold { background: var(--hold-bg); color: var(--hold-fg); }

/* Fines summary */
.fines-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.fines-stat-num {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  line-height: 1;
}

.fines-stat-num--warn { color: var(--warn-fg); }
.fines-stat-label { font-size: 11px; color: var(--fg-muted); margin-top: 4px; }

.fines-toggle-btn {
  width: 100%;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
  transition: color 0.15s;
}

.fines-toggle-btn:hover { color: var(--fg); }
.fines-toggle-btn svg { width: 16px; height: 16px; transition: transform 0.2s; }
.fines-toggle-btn.is-open svg { transform: rotate(180deg); }

.fines-history { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; animation: slide-up 0.25s ease both; }

.fine-item {
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--bg-inset);
  display: flex;
  align-items: center;
  gap: 12px;
}

.fine-code {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  color: #fff;
}

.fine-code--pending { background: var(--warn); }
.fine-code--paid { background: var(--ok); }

.fine-desc { font-size: 13px; font-weight: 500; }
.fine-date { font-size: 11px; color: var(--fg-muted); margin-top: 1px; }
.fine-amount { font-family: var(--font-mono); font-size: 13px; font-weight: 600; margin-left: auto; white-space: nowrap; }

/* Owner */
.owner-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.owner-avatar {
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  background: var(--bg-inset);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.owner-name { font-size: 15px; font-weight: 600; }
.owner-meta { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.owner-location { font-size: 12px; color: var(--fg-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.owner-location svg { width: 11px; height: 11px; }

/* History timeline */
.timeline { display: flex; flex-direction: column; }

.timeline-item { display: flex; gap: 12px; position: relative; }

.timeline-spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-line {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin-top: 2px;
}

.timeline-content { flex: 1; padding-bottom: 14px; }
.timeline-content:last-child .timeline-spine { }
.timeline-date { font-size: 11px; color: var(--fg-muted); font-family: var(--font-mono); letter-spacing: 0.06em; }
.timeline-event { font-size: 13px; font-weight: 500; margin-top: 1px; }
.timeline-event--danger { color: var(--danger-fg); font-weight: 700; }

/* Result footer */
.result-footer {
  margin-top: 8px;
  padding: 12px;
  font-size: 11px;
  color: var(--fg-subtle);
  text-align: center;
  line-height: 1.5;
}

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  transition: filter 0.15s, transform 0.15s;
  white-space: nowrap;
}

.fab:hover { filter: brightness(1.08); transform: translateX(-50%) translateY(-2px); }
.fab:active { transform: translateX(-50%) translateY(0); }

.fab--normal { background: var(--fg); color: var(--bg-surface); }
.fab--critical {
  background: var(--danger);
  color: #fff;
  animation: fab-glow-critical 1.8s ease-in-out infinite;
}

.fab svg { width: 16px; height: 16px; }

@keyframes fab-glow-critical {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.62 0.22 25 / .6), 0 10px 24px oklch(0.62 0.22 25 / .4); }
  50% { box-shadow: 0 0 0 8px oklch(0.62 0.22 25 / 0), 0 10px 24px oklch(0.62 0.22 25 / .4); }
}

/* ── NOT FOUND ── */
.not-found-wrap {
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.not-found-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 10px;
  gap: 0;
}

.not-found-icon {
  width: 72px; height: 72px;
  border-radius: var(--r-lg);
  background: var(--bg-inset);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.not-found-icon svg { width: 32px; height: 32px; }

.not-found-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.not-found-plate-wrap { margin: 16px 0 8px; }

.not-found-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
  max-width: 280px;
}

/* ── PLATE REVEAL ANIMATION ── */
@keyframes plate-reveal {
  0% { opacity: 0; transform: scale(0.92) translateY(8px); filter: blur(4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
.plate-reveal { animation: plate-reveal 0.6s cubic-bezier(.2,.8,.2,1) both; }

/* ── SLIDE UP ── */
@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── SHAKE ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.shake { animation: shake 0.28s linear; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--fg); }
.theme-toggle svg { width: 14px; height: 14px; }

/* ── DESKTOP ── */
@media (min-width: 768px) {
  body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    min-height: 100vh;
  }

  #app {
    min-height: auto;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  #app::-webkit-scrollbar { display: none; }
}
