:root {
  --bg: #fafaf9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7e5e4;
  --brand: #16a34a;
  --brand-ink: #14532d;
  --warn: #d97706;
  --bad: #dc2626;
  --plate-blue: #1d3f91;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(15,23,42,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }

.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 960px; margin: 0 auto; padding: 20px 20px; }
.logo { text-decoration: none; font-size: 20px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.logo b { color: var(--brand); }
.logo-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; }
.badge-proto { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; }

main { max-width: 960px; margin: 0 auto; padding: 0 20px 60px; min-height: 70vh; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 20px; border-top: 1px solid var(--line); }

/* HERO */
.hero { text-align: center; padding: 56px 0 24px; }
.hero h1 { font-size: clamp(32px, 6vw, 54px); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 16px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.sub { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 auto 36px; }

/* PLACA MERCOSUL */
.plate-form { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.plate {
  width: min(380px, 100%); border: 3px solid var(--ink); border-radius: 12px; background: #fff; overflow: hidden;
  box-shadow: var(--shadow);
}
.plate-band { background: var(--plate-blue); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .25em; padding: 4px 0; text-align: center; }
.plate input {
  width: 100%; border: 0; outline: 0; text-align: center; font-size: clamp(40px, 9vw, 56px); font-weight: 800; letter-spacing: .08em;
  padding: 6px 10px 10px; text-transform: uppercase; font-family: "Arial Narrow", "Roboto Condensed", ui-sans-serif, sans-serif; color: var(--ink);
}
.plate input::placeholder { color: #cbd5e1; }
.btn {
  background: var(--ink); color: #fff; border: 0; border-radius: 12px; padding: 14px 28px; font-weight: 600; font-size: 16px;
  transition: transform .08s ease, opacity .2s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: wait; }
.btn-brand { background: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; margin: 0; }

.trust { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 28px; }
.trust span::before { content: "✓ "; color: var(--brand); font-weight: 700; }

.demo-plates { margin-top: 18px; font-size: 13px; color: var(--muted); }
.demo-plates button { background: none; border: 1px dashed var(--line); border-radius: 6px; padding: 2px 8px; margin: 2px; color: var(--ink); font-family: monospace; }

/* SECTIONS */
.section { margin-top: 64px; }
.section h2 { font-size: 26px; letter-spacing: -.02em; text-align: center; margin: 0 0 24px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .n { font-weight: 800; color: var(--brand); }
.step h3 { margin: 6px 0 4px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* PREVIEW */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.vehicle-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.mini-plate { border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; text-align: center; min-width: 130px; }
.mini-plate .plate-band { font-size: 7px; padding: 1px 0; }
.mini-plate b { display: block; font-size: 22px; letter-spacing: .06em; padding: 0 8px 2px; font-family: "Arial Narrow", sans-serif; }
.vehicle-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.vehicle-head p { margin: 2px 0 0; color: var(--muted); }

.alert-teaser { margin-top: 20px; padding: 16px 18px; border-radius: 12px; display: flex; gap: 12px; align-items: center; font-weight: 500; }
.alert-teaser.ready { background: #f1f5f9; color: var(--ink); font-weight: 400; }
.alert-teaser .big { font-size: 26px; }

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 28px; }
.tier { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; position: relative; }
.tier.hl { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.tier .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 99px; white-space: nowrap; }
.tier h3 { margin: 0; font-size: 18px; }
.tier .tl { color: var(--muted); font-size: 14px; margin: 2px 0 14px; }
.tier .price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.tier .price small { font-size: 16px; font-weight: 600; color: var(--muted); }
.tier ul { list-style: none; padding: 0; margin: 16px 0 22px; flex: 1; font-size: 14px; }
.tier li { padding: 5px 0; display: flex; gap: 8px; }
.tier li.on::before { content: "✓"; color: var(--brand); font-weight: 700; }
.tier li.off { color: #a8a29e; text-decoration: line-through; }
.tier li.off::before { content: "–"; }

/* MODAL */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; padding: 20px; z-index: 10; animation: fade .15s; }
.modal { background: #fff; border-radius: 18px; max-width: 420px; width: 100%; padding: 28px; }
.modal h3 { margin: 0 0 4px; }
.modal .muted { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.modal input[type=email] { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; margin-bottom: 12px; }
.modal .summary { display: flex; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.pix-box { background: #f5f5f4; border-radius: 10px; padding: 12px; font-size: 13px; color: var(--muted); margin-bottom: 16px; text-align: center; }
@keyframes fade { from { opacity: 0 } }

/* REPORT */
.report-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 760px) { .report-grid { grid-template-columns: 1fr; } }
.score-card { text-align: center; }
.score-ring { --v: 0; --c: var(--brand); width: 150px; height: 150px; border-radius: 50%; margin: 6px auto 12px; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #f1f5f9 0); }
.score-ring > div { width: 118px; height: 118px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.score-ring b { font-size: 40px; letter-spacing: -.03em; line-height: 1; }
.score-ring small { color: var(--muted); font-size: 12px; display: block; }
.verdict { font-weight: 800; font-size: 22px; margin: 0; }
.verdict.good { color: var(--brand); } .verdict.warn { color: var(--warn); } .verdict.bad { color: var(--bad); }
.score-card p { color: var(--muted); font-size: 14px; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 14px; margin-top: 14px; text-align: left; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }

.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert { display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.alert .ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.alert.critical { border-color: #fecaca; background: #fef2f2; } .alert.critical .ico { background: var(--bad); }
.alert.warning { border-color: #fde68a; background: #fffbeb; } .alert.warning .ico { background: var(--warn); }
.alert.ok .ico { background: var(--brand); }
.alert h4 { margin: 0 0 2px; font-size: 15px; }
.alert p { margin: 0; color: #475569; font-size: 14px; }

.km-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 14px; }
.km-chart .bar { flex: 1; background: #bbf7d0; border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.km-chart .bar.drop { background: #fca5a5; }
.km-chart .bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.km-chart .bar em { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 10px; font-style: normal; color: var(--muted); }

.locked { margin-top: 16px; padding: 18px; border: 1px dashed var(--line); border-radius: 12px; }
.locked h4 { margin: 0 0 8px; }
.locked li { color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.loading { text-align: center; padding: 80px 0; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.back { display: inline-block; margin: 8px 0 16px; color: var(--muted); text-decoration: none; font-size: 14px; }

@media print {
  .topbar .badge-proto, .actions, .back, .footer, .locked { display: none !important; }
  body { background: #fff; }
}
