:root {
  --bg: #f6f4ee;
  --surface: #fffefb;
  --ink: #1e2a30;
  --ink-soft: #55666e;
  --line: #e3ded2;
  --accent: #2f4858;
  --accent-2: #b4552e;
  --olive: #6d7c46;
  --ok: #3c7a52;
  --warn: #a4551f;
  --radius: 14px;
  --shadow-1: 0 1px 2px rgba(30, 42, 48, .06), 0 6px 18px rgba(30, 42, 48, .07);
  --shadow-2: 0 2px 6px rgba(30, 42, 48, .08), 0 16px 40px rgba(30, 42, 48, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181c;
    --surface: #1d2329;
    --ink: #eceae3;
    --ink-soft: #a3adb3;
    --line: #30383f;
    --accent: #9fc2d6;
    --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.35);
    --shadow-2: 0 2px 6px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.is-hidden { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: 18px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.brand__logo { width: 30px; height: 30px; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { color: var(--ink-soft); text-decoration: none; font-size: .88rem; letter-spacing: .04em; transition: color .2s; }
.topbar nav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { max-width: 760px; margin: 26px auto 34px; padding: 0 24px; text-align: center; animation: rise .5s ease both; }
.hero__kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .22em; color: var(--accent-2); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
.hero__sub { margin-top: 16px; color: var(--ink-soft); font-size: 1.06rem; max-width: 56ch; margin-inline: auto; }

/* ---------- Tool ---------- */
.tool { max-width: 1080px; margin: 0 auto 64px; padding: 0 20px; scroll-margin-top: 20px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2); overflow: hidden;
}

.screen { padding: clamp(22px, 4vw, 44px); }

/* Intro */
.screen--intro { display: grid; grid-template-columns: auto 1fr; gap: clamp(22px, 4vw, 46px); align-items: center; }
.intro-visual canvas {
  width: clamp(170px, 22vw, 230px); height: auto; border-radius: 50%;
  box-shadow: var(--shadow-1), inset 0 0 0 1px rgba(30,42,48,.04);
  animation: spin-in .7s ease both;
}
.intro-copy h2 { font-size: 1.5rem; letter-spacing: -.02em; margin-bottom: 14px; }
.check-list { list-style: none; display: grid; gap: 10px; margin-bottom: 22px; color: var(--ink-soft); font-size: .95rem; }
.check-list li { display: flex; gap: 10px; align-items: baseline; }
.check-list svg { width: 15px; height: 15px; flex: none; color: var(--ok); transform: translateY(2px); }
.microcopy { margin-top: 12px; font-size: .8rem; color: var(--ink-soft); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 26px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 650; letter-spacing: .03em; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn--primary { background: var(--accent); color: var(--bg); box-shadow: var(--shadow-1); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn--ghost:hover { background: rgba(47,72,88,.07); }

/* Quiz */
.quiz-head { margin-bottom: 22px; }
.quiz-progress { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.progress-track { height: 5px; background: var(--line); border-radius: 99px; margin-top: 9px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 10%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--olive)); transition: width .35s ease; }

.quiz-stage { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: clamp(22px, 4vw, 48px); align-items: center; }
.plate-wrap { position: relative; }
#plateCanvas { width: 100%; height: auto; border-radius: 50%; box-shadow: var(--shadow-2); display: block; }

.answer-q { font-size: 1.25rem; font-weight: 750; letter-spacing: -.01em; margin-bottom: 16px; }
.options-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.opt-btn {
  min-width: 74px; min-height: 54px; padding: 10px 18px; border-radius: 11px;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  font-size: 1.25rem; font-weight: 700; cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.opt-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.opt-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt-btn--none { font-size: .92rem; font-weight: 600; }
.hint-keys { font-size: .78rem; color: var(--ink-soft); }
kbd { border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: .75rem; background: var(--bg); }

/* Resultado */
.screen--result { text-align: center; }
.result-verdict { margin: 0 auto 8px; max-width: 640px; }
.verdict-badge {
  display: inline-block; padding: 7px 18px; border-radius: 99px;
  font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 16px;
}
.verdict-badge--ok { background: rgba(60,122,82,.13); color: var(--ok); }
.verdict-badge--alert { background: rgba(180,85,46,.14); color: var(--accent-2); }
.result-verdict h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.result-verdict p { color: var(--ink-soft); margin-top: 10px; }
.plates-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-size: .85rem; font-weight: 750; border: 1.5px solid var(--line);
}
.chip--pass { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: rgba(60,122,82,.08); }
.chip--fail { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); background: rgba(180,85,46,.1); }
.chip--ctrl { opacity: .65; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }
.disclaimer { margin: 26px auto 0; max-width: 58ch; font-size: .86rem; color: var(--ink-soft); background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 14px 18px; }

/* ---------- Contenido ---------- */
.content { max-width: 780px; margin: 0 auto 56px; padding: 0 24px; }
.content h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); letter-spacing: -.02em; margin-bottom: 14px; }
.content p { color: var(--ink-soft); }
.content--tinted { max-width: none; background: color-mix(in srgb, var(--surface) 55%, var(--bg)); border-block: 1px solid var(--line); padding-block: 44px; }
.content--tinted > article { max-width: 780px; margin: 0 auto; }
.content h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: paso; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1); counter-increment: paso; transition: transform .2s, box-shadow .2s; }
.steps li:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.steps h3::before { content: "0" counter(paso); display: block; font-size: .75rem; font-weight: 800; letter-spacing: .2em; color: var(--accent-2); margin-bottom: 8px; }
.steps p { font-size: .92rem; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; overflow: hidden; }
summary { padding: 15px 20px; font-weight: 650; cursor: pointer; list-style: none; position: relative; transition: background .18s; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 20px; top: 50%; translate: 0 -50%; font-size: 1.2rem; color: var(--accent-2); transition: rotate .25s; }
details[open] summary::after { rotate: 45deg; }
summary:hover { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
details p { padding: 0 20px 16px; font-size: .94rem; }

.cta-final { text-align: center; padding: 10px 24px 70px; }
.cta-final h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.02em; margin-bottom: 20px; }

.footer { border-top: 1px solid var(--line); padding: 28px 24px 36px; text-align: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-bottom: 10px; }
.footer a { color: var(--ink-soft); font-size: .86rem; text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer p { font-size: .8rem; color: var(--ink-soft); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin-in { from { opacity: 0; scale: .85; } to { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .quiz-stage { grid-template-columns: 1fr; }
  .plate-wrap { max-width: 300px; margin: 0 auto; }
  .answer-panel { text-align: center; }
  .options-grid { justify-content: center; }
}
@media (max-width: 720px) {
  .screen--intro { grid-template-columns: 1fr; text-align: center; }
  .intro-visual { display: flex; justify-content: center; }
  .check-list { max-width: 34ch; margin-inline: auto; text-align: left; }
  .topbar nav { display: none; }
}
