/* Car Scanner — identidade "vidro claro"
   Mesma base do programa no computador: fundo cinza-azulado, cartões brancos, um único azul de destaque.
   Cor só para estado (ponto verde/âmbar/vermelho). Todo o resto é neutro. */
:root {
  --bg: #eef1f6;
  --bg-deep: #e4e8f0;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --hair: rgba(15, 23, 42, 0.07);
  --hair-strong: rgba(15, 23, 42, 0.12);
  --ink: #0f172a;
  --ink2: #475569;
  --ink3: #94a3b8;
  --accent: #2563eb;
  --accent-2: #4f46e5;
  --accent-soft: #e8f0fe;
  --accent-ink: #1d4ed8;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.04), 0 30px 60px -20px rgba(15, 23, 42, 0.22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI Variable Display', 'Segoe UI', Inter, Roboto, system-ui, sans-serif;
  --font-num: 'SF Pro Rounded', ui-rounded, -apple-system, 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  font-size: 15px;
  letter-spacing: -0.006em;
}
/* fundo: luz ambiente bem suave, fixa (é o que o vidro desfoca) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52vw 42vw at 12% -8%, rgba(37, 99, 235, 0.10), transparent 70%),
    radial-gradient(46vw 40vw at 96% 8%, rgba(79, 70, 229, 0.08), transparent 70%),
    radial-gradient(60vw 50vw at 50% 110%, rgba(148, 163, 184, 0.18), transparent 70%),
    linear-gradient(180deg, #f5f7fb 0%, var(--bg) 40%, var(--bg-deep) 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(37, 99, 235, 0.18); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--ink3); }
.soft { color: var(--ink2); }

/* ---------- vidro ---------- */
.glass, .card {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(170%) blur(22px);
  backdrop-filter: saturate(170%) blur(22px);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  border: 1px solid var(--hair);
}
.card { padding: 20px; }

/* ---------- botões ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; cursor: pointer; text-decoration: none !important;
  transition: transform .25s var(--spring), box-shadow .25s var(--ease), background .2s, color .2s, opacity .2s;
  white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #3b7bff, var(--accent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 8px 20px -8px rgba(37, 99, 235, .7), 0 1px 2px rgba(15, 23, 42, .12);
}
.btn-primary:hover { color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 12px 26px -8px rgba(37, 99, 235, .75), 0 1px 2px rgba(15, 23, 42, .12); transform: translateY(-1px); }
.btn-dark { color: #fff; background: linear-gradient(180deg, #1e293b, var(--ink)); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 8px 20px -10px rgba(15, 23, 42, .6); }
.btn-dark:hover { color: #fff; transform: translateY(-1px); }
.btn-glass {
  color: var(--ink); background: var(--glass-strong);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--hair), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.btn-glass:hover { color: var(--ink); background: #fff; transform: translateY(-1px); }
.btn-danger { color: var(--bad); background: rgba(220, 38, 38, .07); box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .2); }
.btn-danger:hover { color: var(--bad); background: rgba(220, 38, 38, .12); }
.btn-sm { height: 36px; padding: 0 15px; font-size: 13.5px; }
.btn-xs { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn .i { width: 16px; height: 16px; }

/* ---------- etiquetas: neutras, cor só no ponto ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px;
  padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink2);
  background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--hair); white-space: nowrap;
}
.pill.accent { color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .15); }
.pill.dark { color: #fff; background: var(--ink); box-shadow: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 119, 6, .14); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }
.dot.live { background: var(--ok); animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 50% { box-shadow: 0 0 0 5px rgba(22, 163, 74, 0); } }

/* ---------- marca: arco de mostrador ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); text-decoration: none !important; font-size: 16px; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 30px; height: 30px; flex: none; display: block; }

.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }

/* entrada em cascata */
.rise { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } * { transition-duration: 0s !important; } }

/* transições entre telas (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .38s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px) scale(.995); filter: blur(2px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px) scale(.995); filter: blur(2px); } }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease); }

/* ---------- gráficos ---------- */
.chart-host { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.chart-grid { stroke: rgba(15, 23, 42, .06); }
.chart-ax { fill: var(--ink3); font: 500 11px var(--font-num); }
.chart-empty { fill: var(--ink3); font: 500 13px var(--font); }
.chart-line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart-area { animation: fadein .9s var(--ease) both; }
@keyframes fadein { from { opacity: 0; } }
.chart-vline { stroke: rgba(15, 23, 42, .25); stroke-dasharray: 3 3; }
.chart-tip {
  position: absolute; top: -6px; transform: translateY(-100%); pointer-events: none; z-index: 5;
  padding: 8px 11px; border-radius: 12px; font-size: 12.5px; white-space: nowrap;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--hair);
  display: flex; flex-direction: column; gap: 3px;
}
.chart-tip div { display: flex; align-items: center; gap: 7px; color: var(--ink2); }
.chart-tip i { width: 8px; height: 8px; border-radius: 3px; }
.chart-tip b { margin-left: auto; padding-left: 10px; color: var(--ink); }
