/* Doet mijn site het? — "De APK voor je website"
   Kenteken-geel, kobaltblauw, keuringsstempels. */

@font-face { font-family: "Anton"; src: url("fonts/anton.woff") format("woff"); font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dmsans.woff") format("woff"); font-weight: 100 1000; font-display: swap; }

:root {
  --cobalt: #1a3fb8;
  --cobalt-d: #122d86;
  --plate: #ffc820;
  --ink: #101b33;
  --paper: #eef2f9;
  --card: #ffffff;
  --muted: #56617a;
  --line: #dbe1ec;
  --soft: #f3f5fa;
  --ok: #0e9f5b;   --ok-bg: #dcf5e8;
  --warn: #c86f00; --warn-bg: #fff0d6;
  --bad: #df2f24;  --bad-bg: #fde4e1;
  --info: #3d5ea8; --info-bg: #e5ecfa;
  --display: "Anton", "Bahnschrift", "DIN Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1428; --card: #141f38; --ink: #e9eefb; --muted: #9aa6c2; --line: #24314f; --soft: #1a2643;
    --ok: #3ddc8f; --ok-bg: #10301f; --warn: #ffb547; --warn-bg: #33250b; --bad: #ff6b60; --bad-bg: #3a1714;
    --info: #9db7f2; --info-bg: #18264a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--body); }
a { color: var(--cobalt); }
@media (prefers-color-scheme: dark) { a { color: var(--info); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--plate); outline-offset: 3px; }

/* ---------- Hero ---------- */
.hero { background: var(--cobalt); color: #fff; padding: 22px 0 70px; position: relative; overflow: hidden; }
.hero::after { /* het asfalt onder de keuringsstraat */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  background: repeating-linear-gradient(90deg, var(--plate) 0 46px, transparent 46px 92px);
  opacity: .9;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.logo svg { width: 34px; height: 34px; }
.logo .lp { fill: var(--plate); stroke: var(--ink); stroke-width: 2; }
.logo .eu { fill: var(--cobalt-d); }
.logo .ck { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.hero h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 9vw, 6.4rem); line-height: .95;
  letter-spacing: .005em; margin: 40px 0 16px; color: #fff;
}
.lead { font-size: 1.15rem; max-width: 34em; margin: 0 0 30px; color: #d9e2ff; }

.plate-form { display: flex; gap: 12px; max-width: 700px; align-items: stretch; }
.plate {
  flex: 1; min-width: 0; display: flex; background: var(--plate); border-radius: 10px;
  border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--plate), 0 14px 30px rgba(5, 15, 50, .35);
}
.plate-eu {
  flex: none; width: 54px; background: #0b3bb0; color: #fff; border-radius: 6px 0 0 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 0 6px;
  font: 700 1rem/1 var(--body); letter-spacing: .04em;
}
.plate-eu svg { width: 30px; height: 30px; }
.plate input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #0d0d0d;
  font: 400 clamp(1.6rem, 4.6vw, 2.6rem)/1 var(--display); text-transform: uppercase; letter-spacing: .07em;
  padding: 14px 18px 12px;
}
.plate input::placeholder { color: rgba(13, 13, 13, .32); }
.plate:focus-within { box-shadow: 0 0 0 3px var(--plate), 0 0 0 7px #fff, 0 14px 30px rgba(5, 15, 50, .35); }
.plate-form button {
  border: 0; border-radius: 12px; background: var(--ink); color: var(--plate); cursor: pointer;
  font: 400 1.6rem/1 var(--display); letter-spacing: .04em; padding: 0 30px; transition: transform .12s;
}
.plate-form button:hover { transform: translateY(-2px) rotate(-1.5deg); }
.plate-form button:active { transform: translateY(1px); }
.plate-form button:disabled { opacity: .6; cursor: progress; }
.hint { color: #c5d2ff; font-size: .95rem; margin: 16px 2px 0; max-width: 46em; }
.hint b { color: #fff; font-weight: 600; }
.hint.error { color: #fff; background: var(--bad); display: inline-block; padding: 6px 12px; border-radius: 8px; font-weight: 600; }

/* De ronde keuringssticker rechts in de hero */
.sticker {
  width: 190px; height: 190px; border-radius: 50%; background: var(--plate); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(9deg);
  box-shadow: inset 0 0 0 8px var(--plate), inset 0 0 0 10px var(--ink), 0 18px 40px rgba(5, 15, 50, .35);
  text-align: center; user-select: none;
}
.sticker-top, .sticker-bot { font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.sticker-big { font: 400 3.6rem/1 var(--display); margin: 2px 0; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .sticker { display: none; } }

/* ---------- Intro ---------- */
.intro { background: var(--card); border-radius: 20px; padding: 28px 32px; margin: -36px auto 48px; position: relative; box-shadow: 0 10px 30px rgba(16, 27, 51, .08); }
.intro h2 { font: 400 2rem/1.1 var(--display); margin: 0 0 18px; letter-spacing: .01em; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 34px; }
.checklist li { position: relative; padding-left: 36px; color: var(--muted); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 6px; border: 2.5px solid var(--ink);
  background: var(--plate) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%23101b33' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.checklist b { color: var(--ink); display: block; }
.intro-foot { margin: 22px 0 0; color: var(--muted); }

/* ---------- Oordeel + stempel ---------- */
#results { margin-top: -36px; position: relative; }
.verdict {
  background: var(--card); border-radius: 20px; padding: 26px 30px; box-shadow: 0 10px 30px rgba(16, 27, 51, .1);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; min-height: 150px; position: relative;
}
.verdict h2 { font: 400 clamp(1.9rem, 4.4vw, 3rem)/1.02 var(--display); margin: 0; letter-spacing: .01em; text-wrap: balance; }
.verdict p { margin: 8px 0 0; color: var(--muted); max-width: 44em; }
.verdict .quip { color: var(--ink); font-weight: 600; }
.score { margin-top: 16px; max-width: 420px; }
.score-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.score-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.score-bar { height: 12px; border-radius: 8px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.score-bar i { display: block; height: 100%; border-radius: 8px; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }

.stamp {
  --c: var(--ok);
  min-width: 190px; padding: 14px 20px 12px; white-space: nowrap; border: 5px solid var(--c); border-radius: 14px; color: var(--c);
  text-align: center; transform: rotate(-11deg); position: relative;
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 5px var(--c);
}
.stamp b { display: block; font: 400 1.9rem/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.stamp small { display: block; font-weight: 700; font-size: .8rem; margin-top: 4px; }
.stamp.warn { --c: var(--warn); }
.stamp.bad { --c: var(--bad); }
.stamp.gold { --c: #c79200; background: radial-gradient(circle at 30% 25%, #fff6cf, transparent 60%); }
@media (prefers-color-scheme: dark) { .stamp.gold { --c: var(--plate); background: none; } }
.stamp.slam { animation: slam .55s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes slam {
  0% { transform: scale(3) rotate(-24deg); opacity: 0; }
  60% { transform: scale(.92) rotate(-9deg); opacity: 1; }
  100% { transform: scale(1) rotate(-11deg); }
}
.verdict.thud { animation: thud .35s .38s ease-out; }
@keyframes thud { 30% { transform: translateY(4px); } 60% { transform: translateY(-2px); } }

.waiting { display: flex; gap: 6px; align-items: center; justify-self: end; padding-right: 20px; }
.waiting i { width: 14px; height: 14px; border-radius: 50%; background: var(--plate); border: 2.5px solid var(--ink); animation: bounce 1s infinite ease-in-out; }
.waiting i:nth-child(2) { animation-delay: .15s; } .waiting i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-10px); } }

@media (max-width: 640px) {
  .verdict { grid-template-columns: 1fr; padding: 22px; }
  .stamp { justify-self: center; min-width: 170px; }
  .waiting { justify-self: start; }
}

.toolbar { display: flex; align-items: center; gap: 8px; margin: 18px 2px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.ghost {
  border: 2px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 14px; border-radius: 10px; cursor: pointer;
  font: 600 .9rem var(--body);
}
.ghost:hover { border-color: var(--ink); }
#party { border-color: var(--plate); background: var(--plate); color: #101b33; }

/* ---------- Kaarten ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 48px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; min-width: 0; border-top: 5px solid var(--line); }
.card.wide { grid-column: 1 / -1; }
.card.ok { border-top-color: var(--ok); } .card.warn { border-top-color: var(--warn); }
.card.bad { border-top-color: var(--bad); } .card.info { border-top-color: var(--info); }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-head > div { min-width: 0; flex: 1; }
.card-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--muted); }
.card-icon svg { width: 22px; height: 22px; }
.card.ok .card-icon { background: var(--ok-bg); color: var(--ok); }
.card.warn .card-icon { background: var(--warn-bg); color: var(--warn); }
.card.bad .card-icon { background: var(--bad-bg); color: var(--bad); }
.card.info .card-icon { background: var(--info-bg); color: var(--info); }
.card h3 { margin: 0; font: 400 1.45rem/1.1 var(--display); letter-spacing: .01em; }
.card .sub { color: var(--muted); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  font-weight: 800; font-size: .78rem; padding: 3px 10px; border-radius: 7px; white-space: nowrap; color: var(--muted);
  border: 2px solid currentColor; transform: rotate(-3deg);
}
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.info { color: var(--info); }

.findings { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 11px; }
.findings li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.findings .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.findings .dot svg { width: 13px; height: 13px; }
.dot.ok { background: var(--ok-bg); color: var(--ok); }
.dot.warn { background: var(--warn-bg); color: var(--warn); }
.dot.bad { background: var(--bad-bg); color: var(--bad); }
.dot.info { background: var(--info-bg); color: var(--info); }
.findings b { font-weight: 650; display: block; }
.findings span { color: var(--muted); font-size: .93rem; overflow-wrap: anywhere; }

details.more { margin-top: 18px; border-top: 2px dashed var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; color: var(--cobalt); font-weight: 700; font-size: .93rem; list-style: none; }
@media (prefers-color-scheme: dark) { details.more summary { color: var(--info); } }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "− "; }
.detail { margin-top: 14px; }
.detail h4 { font-size: .9rem; font-weight: 700; color: var(--ink); margin: 20px 0 8px; }
.detail h4:first-child { margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
td.mono, .mono { font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; }
code.rec { display: block; font-family: var(--mono); font-size: .82rem; background: var(--soft); padding: 10px 12px; border-radius: 10px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .82rem; padding: 3px 9px; border-radius: 8px; background: var(--soft); }
.tag.on { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.tag.off { color: var(--muted); text-decoration: line-through; opacity: .8; }
.ok-t { color: var(--ok); font-weight: 700; } .bad-t { color: var(--bad); font-weight: 700; } .warn-t { color: var(--warn); font-weight: 700; }
.muted { color: var(--muted); }
.cc {
  display: inline-block; font-size: .68rem; font-weight: 800; padding: 1px 5px; border-radius: 4px; margin-right: 6px;
  background: var(--plate); color: #101b33; border: 1.5px solid #101b33; letter-spacing: .03em;
}

.timing { display: grid; gap: 6px; }
.trow { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; font-size: .88rem; }
.trow .bar { height: 10px; background: var(--soft); border-radius: 6px; position: relative; overflow: hidden; }
.trow .bar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--cobalt); }
.trow .v { text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 8px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; }

.probes td .bar { height: 8px; background: var(--soft); border-radius: 6px; min-width: 60px; overflow: hidden; }
.probes td .bar i { display: block; height: 100%; background: var(--cobalt); border-radius: 6px; }
@media (prefers-color-scheme: dark) { .trow .bar i, .probes td .bar i { background: var(--info); } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font: 400 2rem/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.stat span { color: var(--muted); font-size: .84rem; }

/* Laden */
.loading { margin-top: 18px; display: grid; gap: 10px; }
.sk { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: sk 1.3s infinite linear; }
.sk:nth-child(2) { width: 80%; } .sk:nth-child(3) { width: 60%; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading .note { color: var(--muted); font-size: .9rem; font-style: italic; }
.spin { animation: spin 1s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { color: var(--muted); font-size: .88rem; padding-bottom: 48px; }
.foot b { color: var(--ink); }

#fireworks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

@media (max-width: 560px) {
  .plate-form { flex-direction: column; }
  .plate-form button { padding: 14px; }
  .trow { grid-template-columns: 96px 1fr 56px; }
  .card { padding: 18px; }
  .intro { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .sk, .spin, .waiting i, .stamp.slam, .verdict.thud { animation: none; }
  .plate-form button:hover { transform: none; }
}
.verdict .rotating { font-style: italic; margin-top: 10px; }

/* Na een keuring: compacte kop, zodat het oordeel meteen in beeld is */
body.has-results .hero { padding-bottom: 60px; }
body.has-results .hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 22px 0 18px; }
body.has-results .lead, body.has-results .sticker { display: none; }
body.has-results .hero-grid { grid-template-columns: minmax(0, 1fr); }
.hero-main { min-width: 0; }
