/* TU-IQ — hoja de estilos única.
   Mobile-first (≥320 px), modo oscuro automático, tokens de docs/marca.md. */

/* =========================================================
   1. Tokens
   ========================================================= */
:root {
  color-scheme: light dark;

  /* Marca */
  --brand-50: #EEF2FF; --brand-100: #E0E7FF; --brand-200: #C7D2FE; --brand-300: #A5B4FC;
  --brand-400: #818CF8; --brand-500: #6366F1; --brand-600: #4F46E5; --brand-700: #4338CA;
  --brand-800: #3730A3; --brand-900: #312E81; --brand-950: #1E1B4B;
  --amber-300: #FCD34D; --amber-400: #FBBF24; --amber-500: #F59E0B; --amber-700: #B45309;

  /* Superficies */
  --bg: #FFFFFF;
  --bg-soft: #F7F8FC;
  --surface: #FFFFFF;          /* tarjetas */
  --surface-2: #F1F3FA;        /* rellenos internos */
  --border: #E2E5EE;
  --border-strong: #CDD2E1;

  /* Texto */
  --text: #2C3345;
  --heading: #1E1B4B;
  --muted: #5B6478;
  --subtle: #8A91A8;

  /* Acción */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-active: #3730A3;
  --primary-strong: #4338CA;
  --on-primary: #FFFFFF;
  --primary-soft: #EEF2FF;
  --primary-line: #C7D2FE;
  --link: #4338CA;

  /* Acento "respuesta" */
  --accent: #F59E0B;
  --on-accent: #1E1B4B;
  --accent-text: #B45309;
  --accent-soft: #FEF3C7;
  --warn-text: #92400E;

  /* Estados */
  --ok: #15803D;     --ok-soft: #DCFCE7;
  --bad: #B91C1C;    --bad-soft: #FEF2F2;

  --focus: #4F46E5;
  --ring: 0 0 0 3px rgb(99 102 241 / .40);

  /* Forma */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(30 27 75 / .06), 0 1px 3px rgb(30 27 75 / .06);
  --shadow: 0 1px 2px rgb(30 27 75 / .05), 0 6px 20px -4px rgb(30 27 75 / .10);
  --shadow-lg: 0 24px 48px -16px rgb(49 46 129 / .30), 0 2px 6px rgb(30 27 75 / .06);

  /* Tipografía */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --fs-xs: clamp(.75rem, .72rem + .15vw, .8125rem);
  --fs-sm: clamp(.875rem, .85rem + .12vw, .9375rem);
  --fs-base: clamp(1rem, .96rem + .2vw, 1.0625rem);
  --fs-lg: clamp(1.125rem, 1.06rem + .33vw, 1.3125rem);
  --fs-xl: clamp(1.25rem, 1.15rem + .5vw, 1.625rem);
  --fs-2xl: clamp(1.625rem, 1.4rem + 1.1vw, 2.5rem);
  --fs-3xl: clamp(2rem, 1.55rem + 2.3vw, 3.5rem);
  --fs-score: clamp(4.25rem, 3rem + 6vw, 7rem);

  --maxw: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0E24;
    --bg-soft: #131230;
    --surface: #1A1838;
    --surface-2: #24214A;
    --border: #2E2B5A;
    --border-strong: #403C78;

    --text: #ECEDF7;
    --heading: #FFFFFF;
    --muted: #A9AEC8;
    --subtle: #6E7491;

    --primary: #5B54E8;          /* blanco encima: 5.41:1 */
    --primary-hover: #4F46E5;
    --primary-active: #4338CA;
    --primary-strong: #818CF8;
    --on-primary: #FFFFFF;
    --primary-soft: #24214A;
    --primary-line: #4B4690;
    --link: #A5B4FC;

    --accent: #FBBF24;
    --accent-text: #FCD34D;
    --accent-soft: #2A1F0B;
    --warn-text: #FCD34D;

    --ok: #4ADE80;   --ok-soft: #0F2E1D;
    --bad: #F87171;  --bad-soft: #3A1418;

    --focus: #A5B4FC;
    --ring: 0 0 0 3px rgb(165 180 252 / .45);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .35);
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 8px 24px -6px rgb(0 0 0 / .45);
    --shadow-lg: 0 24px 56px -16px rgb(0 0 0 / .65);
  }
}

/* =========================================================
   2. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: rgb(79 70 229 / .12); }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
h1, h2, h3 { color: var(--heading); line-height: 1.15; margin: 0 0 .55em; letter-spacing: -.02em; font-weight: 800; text-wrap: balance; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 650; }
::selection { background: var(--brand-200); color: var(--brand-950); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: var(--radius-md);
  font-weight: 650; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
.narrow { max-width: 760px; }
.container.section { padding-left: 16px; padding-right: 16px; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.h3 { font-size: var(--fs-lg); }
.stack > * + * { margin-top: 16px; }
.spaced { margin-top: 20px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-xs); font-weight: 750;
  color: var(--link); margin: 0 0 12px;
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none;
}

/* =========================================================
   3. Cabecera y pie
   ========================================================= */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
@media (min-width: 640px) { .site-header { padding-left: 24px; padding-right: 24px; } }
.brand {
  display: inline-flex; align-items: center; text-decoration: none; color: var(--text);
  min-height: 44px; border-radius: var(--radius-sm);
}
.brand picture { display: block; }
.brand img { height: 30px; width: auto; display: block; }
@media (min-width: 640px) { .brand img { height: 32px; } }
.brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a {
  padding: 10px 12px; border-radius: var(--radius-pill); text-decoration: none;
  color: var(--muted); font-weight: 600; font-size: var(--fs-sm);
  transition: color .15s, background-color .15s;
}
.header-nav a:hover { color: var(--heading); background: var(--surface-2); }
.header-nav a.btn-primary, .header-nav a.btn-primary:hover { color: var(--on-primary); padding: 10px 18px; min-height: 44px; }
.header-nav a.btn-primary { background: var(--primary); }
.header-nav a.btn-primary:hover { background: var(--primary-hover); }
.header-nav .hide-sm { display: none; }
@media (min-width: 640px) { .header-nav .hide-sm { display: inline-block; } }

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: center;
}
.site-footer::before {
  content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px;
  background: url("/icons/favicon.svg") center / contain no-repeat;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; margin-bottom: 6px; }
.site-footer nav a { color: var(--muted); padding: 10px 8px; display: inline-block; text-decoration: none; }
.site-footer nav a:hover { color: var(--heading); text-decoration: underline; }
.site-footer p { margin: 0; color: var(--subtle); }
@media (prefers-color-scheme: dark) { .site-footer p { color: var(--muted); } }

/* =========================================================
   4. Botones
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border-radius: var(--radius-pill); border: 1.5px solid transparent;
  font: inherit; font-weight: 650; font-size: var(--fs-base); line-height: 1.2;
  text-decoration: none; text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .2s, transform .12s var(--ease);
}
.btn:active:not([disabled]) { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-pill); }
.btn-primary {
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 1px 2px rgb(30 27 75 / .15), 0 6px 16px -6px rgb(79 70 229 / .55);
}
.btn-primary:hover:not([disabled]) { background: var(--primary-hover); }
.btn-primary:active:not([disabled]) { background: var(--primary-active); }
.btn-primary:focus-visible { box-shadow: var(--ring), 0 6px 16px -6px rgb(79 70 229 / .55); }
.btn-secondary { background: var(--surface); color: var(--heading); border-color: var(--border-strong); }
.btn-secondary:hover:not([disabled]) { border-color: var(--primary); color: var(--link); }
.btn-ghost { background: transparent; color: var(--link); }
.btn-ghost:hover:not([disabled]) { background: var(--primary-soft); }
.btn-lg { min-height: 56px; padding: 14px 30px; font-size: var(--fs-lg); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn .arrow { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* =========================================================
   5. Tarjetas, avisos, formularios
   ========================================================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
}
@media (min-width: 640px) { .card { padding: 32px; } }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--accent-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius); padding: 16px 18px; font-size: var(--fs-sm); line-height: 1.55;
}
.notice p { margin: 0; }
.notice svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--warn-text); margin-top: 1px; }

.alert {
  border-radius: var(--radius); padding: 14px 16px; margin: 12px 0;
  background: var(--primary-soft); border: 1px solid var(--primary-line); color: var(--text);
}
.alert p { margin: 0 0 10px; }
.alert p:last-child { margin-bottom: 0; }
.alert-error { background: var(--bad-soft); border-color: var(--bad); }

.form-field { display: grid; gap: 6px; margin-bottom: 14px; }
.form-field label { font-weight: 650; color: var(--heading); }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px; font: inherit; font-size: max(16px, 1rem);
  color: var(--text); background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-md);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--subtle); }
.input:hover { border-color: var(--brand-400); }
.input:focus { border-color: var(--primary); outline: none; box-shadow: var(--ring); }
.field-hint { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.field-error { font-size: var(--fs-sm); color: var(--bad); font-weight: 600; }
.field-error:empty { display: none; }

kbd {
  font-family: var(--mono); font-size: .82em; border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px; background: var(--surface-2); color: var(--heading);
}

.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 56px 0; color: var(--muted); text-align: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--primary); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   6. Landing
   ========================================================= */
.hero {
  position: relative; overflow: hidden;
  padding: 24px 0 48px;
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--brand-500) 16%, transparent), transparent 70%),
    radial-gradient(40rem 24rem at -10% 110%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
}
.hero::before {
  /* Retícula de puntos tenue, eco del isotipo */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--brand-500) 22%, transparent) 1.2px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  opacity: .55;
}
.hero > .container { position: relative; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 56px 0 88px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; }
}
.hero h1 { font-size: clamp(2.05rem, 1.3rem + 3.6vw, 3.75rem); letter-spacing: -.03em; line-height: 1.06; margin-bottom: .45em; }
.hero h1 span { color: var(--primary); }
@media (prefers-color-scheme: dark) { .hero h1 span { color: var(--link); } }
.hero .lead { font-size: var(--fs-lg); color: var(--muted); max-width: 36em; margin-bottom: 28px; line-height: 1.55; }
.hero .btn-row { gap: 10px 16px; }
@media (max-width: 479px) { .hero .btn-row .btn-lg { width: 100%; } .hero .btn-row .btn-ghost { width: 100%; } }
.hero-points { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: var(--fs-sm); }
.hero-points li { display: inline-flex; align-items: center; gap: 6px; }
.hero-points svg { width: 18px; height: 18px; color: var(--ok); flex: none; }

/* Datos del test (hechos, no estadísticas de uso) */
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 32px 0 0; padding: 0;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 560px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.facts div { background: var(--surface); padding: 12px 14px; }
.facts dt { font-size: var(--fs-xs); color: var(--muted); }
.facts dd { margin: 0; font-weight: 800; color: var(--heading); font-size: var(--fs-lg); letter-spacing: -.01em; }

/* Ilustración: la matriz que se completa */
.hero-art { width: 100%; max-width: 440px; margin: 0 auto; position: relative; }
.hero-art svg { width: 100%; height: auto; display: block; overflow: visible; }
.hero-art .c-card { fill: var(--surface); stroke: var(--border); }
.hero-art .c-cell { fill: var(--bg-soft); stroke: var(--border); }
.hero-art .c-gap { fill: color-mix(in srgb, var(--accent) 10%, var(--surface)); stroke: var(--accent); stroke-dasharray: 7 6; }
.hero-art .d1 { fill: var(--brand-300); }
.hero-art .d2 { fill: var(--brand-400); }
.hero-art .d3 { fill: var(--brand-500); }
.hero-art .d4 { fill: var(--brand-600); }
.hero-art .d5 { fill: var(--accent); }
.hero-art .c-q { fill: var(--accent-text); font: 800 34px var(--font); }
.hero-art .c-label { fill: var(--muted); font: 600 13px var(--font); letter-spacing: .02em; }
.hero-art .c-pill { fill: var(--primary-soft); }
.hero-art .c-pill-text { fill: var(--link); font: 700 12px var(--font); letter-spacing: .06em; }
.hero-art .c-shadow { fill: var(--brand-600); opacity: .12; filter: blur(18px); }
@media (prefers-color-scheme: dark) {
  .hero-art .d1 { fill: var(--brand-600); }
  .hero-art .d2 { fill: var(--brand-500); }
  .hero-art .d3 { fill: var(--brand-400); }
  .hero-art .d4 { fill: var(--brand-200); }
  .hero-art .c-shadow { fill: #000; opacity: .5; }
}
.hero-art .answer { transform-box: fill-box; transform-origin: center; }
.hero-art .c-gap, .hero-art .c-q { transition: opacity .3s; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art .answer { animation: answer-in 6s var(--ease) 1.2s infinite both; }
  .hero-art .c-q { animation: q-out 6s var(--ease) 1.2s infinite both; }
  .hero-art .dot { transform-box: fill-box; transform-origin: center; animation: dot-in .6s var(--ease) both; }
  .hero-art .dot:nth-of-type(2) { animation-delay: .06s; } .hero-art .dot:nth-of-type(3) { animation-delay: .12s; }
  .hero-art .dot:nth-of-type(4) { animation-delay: .18s; } .hero-art .dot:nth-of-type(5) { animation-delay: .24s; }
  .hero-art .dot:nth-of-type(6) { animation-delay: .30s; } .hero-art .dot:nth-of-type(7) { animation-delay: .36s; }
  .hero-art .dot:nth-of-type(8) { animation-delay: .42s; }
}
@keyframes dot-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes answer-in {
  0%, 8% { transform: scale(0); opacity: 0; }
  16% { transform: scale(1.12); opacity: 1; }
  22%, 86% { transform: scale(1); opacity: 1; }
  96%, 100% { transform: scale(0); opacity: 0; }
}
@keyframes q-out {
  0%, 6% { opacity: 1; } 12%, 88% { opacity: 0; } 96%, 100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .hero-art .c-q { opacity: 0; } }

/* Secciones */
.section { padding: 56px 0; }
@media (min-width: 900px) { .section { padding: 88px 0; } }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head h2 { margin-bottom: .35em; }
.section-head p { color: var(--muted); font-size: var(--fs-lg); line-height: 1.55; margin: 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.steps li { position: relative; padding-top: 76px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 20px; left: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 0 0 6px var(--primary-soft);
}
.steps li:last-child::before { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 6px var(--accent-soft); }
@media (min-width: 640px) { .steps li { padding-top: 92px; } .steps li::before { top: 32px; left: 32px; } }
.steps h3 { margin-bottom: .4em; }
.steps p { margin: 0; color: var(--muted); }

.areas { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .areas { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 960px) { .areas { grid-template-columns: repeat(5, 1fr); } }
.areas .area { padding: 20px; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: start; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.areas .area svg {
  grid-row: span 2; width: 48px; height: 48px; padding: 10px; border-radius: 14px;
  color: var(--primary); background: var(--primary-soft);
}
@media (prefers-color-scheme: dark) { .areas .area svg { color: var(--link); } }
.areas .area h3 { font-size: var(--fs-base); margin: 2px 0 2px; }
.areas .area p { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
@media (min-width: 960px) {
  .areas .area { grid-template-columns: 1fr; gap: 0; }
  .areas .area svg { grid-row: auto; margin-bottom: 14px; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .areas .area:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-line); }
}

.samples { display: grid; gap: 16px; }
@media (min-width: 900px) { .samples { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.sample { display: flex; flex-direction: column; }
.sample h3 { font-size: var(--fs-base); }
.sample .tag {
  align-self: flex-start; display: inline-block; font-size: var(--fs-xs); font-weight: 700; color: var(--link);
  background: var(--primary-soft); border-radius: var(--radius-pill); padding: 3px 12px; margin-bottom: 12px;
}
.sample .sample-media {
  background: var(--surface-2); border-radius: var(--radius); padding: 18px 14px; text-align: center;
  font-size: var(--fs-lg); font-weight: 700; margin-bottom: 14px; color: var(--heading); letter-spacing: .01em;
  min-height: 84px; display: grid; place-items: center;
}
.sample .sample-media svg { width: 100%; max-width: 240px; height: auto; color: var(--heading); }
.sample ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sample li { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; font-size: var(--fs-sm); background: var(--surface); }
.sample details { font-size: var(--fs-sm); color: var(--muted); margin-top: auto; }
.sample summary { cursor: pointer; color: var(--link); font-weight: 650; min-height: 44px; display: inline-flex; align-items: center; border-radius: var(--radius-sm); }
.sample details[open] p { background: var(--ok-soft); color: var(--text); padding: 10px 12px; border-radius: var(--radius-md); margin: 4px 0 0; }

.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: var(--primary-line); box-shadow: var(--shadow); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; position: relative;
  font-weight: 650; color: var(--heading); min-height: 60px; display: flex; align-items: center; border-radius: var(--radius);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--link); border-bottom: 2px solid var(--link);
  transform: translateY(-70%) rotate(45deg); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .faq-body { padding: 0 20px 18px; color: var(--muted); }
.faq .faq-body p:last-child { margin: 0; }

.cta-band { text-align: center; }
.cta-band .notice { text-align: left; margin-bottom: 40px; }
.cta-panel {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-lg); padding: 44px 20px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-900));
  color: #E0E7FF; box-shadow: var(--shadow-lg);
}
.cta-panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(circle, rgb(255 255 255 / .14) 1.4px, transparent 1.8px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, #000 80%);
  mask-image: radial-gradient(ellipse at center, transparent 30%, #000 80%);
}
.cta-panel .cta-title { color: #FFFFFF; }
.cta-panel .muted { color: #C7D2FE; }
.cta-panel .btn-primary { background: #FFFFFF; color: var(--brand-800); box-shadow: 0 10px 24px -10px rgb(0 0 0 / .5); }
.cta-panel .btn-primary:hover { background: var(--brand-50); }
.cta-panel .btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--amber-400); }
.cta-band .btn { margin-top: 8px; }
.cta-title { margin-bottom: .3em; }

/* =========================================================
   7. Test
   ========================================================= */
.test-page { background: var(--bg-soft); }
.test-page .site-header { padding-bottom: 6px; }
.test-page main { display: flex; flex-direction: column; }
.test-page .site-footer { display: none; }
.screen { padding: 8px 0 40px; }

/* Intro */
.intro-head { margin: 8px 0 20px; }
.intro-head h1 { font-size: var(--fs-2xl); margin-bottom: .3em; }
.intro-head p:not(.eyebrow) { color: var(--muted); margin: 0; font-size: var(--fs-lg); }
.intro-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; padding: 0; }
.intro-facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.intro-facts dt { font-size: var(--fs-xs); color: var(--muted); }
.intro-facts dd { margin: 0; font-size: var(--fs-xl); font-weight: 800; color: var(--heading); line-height: 1.2; }
.intro-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.intro-list li { position: relative; padding-left: 30px; line-height: 1.5; }
.intro-list li::before {
  content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand-300); box-shadow: 0 0 0 4px var(--primary-soft);
}
.intro-list li:nth-child(2)::before { background: var(--brand-400); }
.intro-list li:nth-child(3)::before { background: var(--brand-500); }
.intro-list li:nth-child(n+4)::before { background: var(--brand-600); }
.intro-list li.kbd-hint { color: var(--muted); font-size: var(--fs-sm); }
.intro-list li.kbd-hint::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@media (hover: none) { .intro-list li.kbd-hint { display: none; } }
#start-row { margin-top: 8px; }
@media (max-width: 479px) { #start-row .btn { width: 100%; } }
.screen > .container > .muted.small { margin-top: 16px; }

/* Barra fija */
.test-bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: calc(8px + env(safe-area-inset-top)) 0 12px;
}
.test-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-count { font-weight: 700; font-size: var(--fs-sm); color: var(--heading); font-variant-numeric: tabular-nums; }
.timer {
  display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums; font-weight: 750; font-size: 1.05rem; color: var(--heading);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 6px 14px 6px 10px;
  box-shadow: var(--shadow-sm);
}
.timer svg { width: 18px; height: 18px; color: var(--link); }
.timer.is-low { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.timer.is-low svg { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) {
  .timer.is-low svg { animation: tick 1s steps(2, jump-none) infinite; }
}
@keyframes tick { 50% { opacity: .35; } }
.progress { height: 6px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; margin-top: 10px; }
.progress > span {
  display: block; height: 100%; width: 0; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-500), var(--primary));
  transition: width .35s var(--ease);
}
@media (prefers-color-scheme: dark) { .progress > span { background: linear-gradient(90deg, var(--brand-500), var(--brand-300)); } }

/* Pregunta */
.question { padding-top: 18px; }
@media (max-width: 479px) { .q-media { padding: 12px; } .q-media svg { max-height: 38vh; } }
@media (prefers-reduced-motion: no-preference) {
  #screen-question:not([hidden]) .question { animation: rise .35s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.q-domain {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-xs); font-weight: 750; text-transform: uppercase; letter-spacing: .09em; color: var(--link);
  margin: 0 0 8px;
}
.q-domain::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.q-domain:empty { display: none; }
.q-stem { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 18px; outline: none; text-wrap: pretty; }
.q-media {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 18px; text-align: center; color: var(--heading); box-shadow: var(--shadow-sm);
}
.q-media.is-text {
  font-size: clamp(1.3rem, 1rem + 2vw, 1.85rem); font-weight: 750; letter-spacing: .03em; line-height: 1.4;
  overflow-wrap: anywhere; white-space: pre-line; padding: 22px 18px; font-variant-numeric: tabular-nums;
}
.q-media svg { display: block; width: 100%; max-width: 440px; max-height: min(44vh, 440px); height: auto; margin: 0 auto; }
/* Las figuras del banco están dibujadas para fondo claro: en oscuro, un "papel" claro */
@media (prefers-color-scheme: dark) {
  .q-media:not(.is-text) { background: #F7F8FC; border-color: #F7F8FC; }
}

.options { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .options { gap: 12px; } }
.options.is-long { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .options.has-svg.n6, .options.has-svg.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .options.has-svg.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.option { position: relative; display: block; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-box {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; height: 100%; padding: 10px 14px 10px 10px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: border-color .15s, background-color .15s, box-shadow .2s, transform .12s var(--ease);
}
@media (hover: hover) { .option-box:hover { border-color: var(--brand-400); box-shadow: var(--shadow); } }
.option-box:active { transform: scale(.985); }
.option-key {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  background: var(--surface-2); color: var(--muted);
  transition: background-color .15s, color .15s, transform .2s var(--ease);
}
.option-text { font-size: var(--fs-lg); font-weight: 650; color: var(--heading); overflow-wrap: anywhere; line-height: 1.3; }
.option-svg { flex: 1; display: flex; justify-content: center; color: var(--heading); }
.option-svg svg { width: 100%; max-width: 128px; height: auto; max-height: 128px; display: block; }
.options.has-svg .option-box { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 8px 10px; }
.options.has-svg .option-key { width: 28px; height: 28px; font-size: .8rem; }
@media (prefers-color-scheme: dark) {
  .options.has-svg .option-svg { background: #F7F8FC; border-radius: var(--radius-md); padding: 6px; }
}
/* Seleccionada */
.option input:checked + .option-box {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 0 0 1.5px var(--primary) inset, 0 6px 18px -8px rgb(79 70 229 / .55);
}
@media (prefers-color-scheme: dark) { .option input:checked + .option-box { border-color: var(--brand-400); box-shadow: 0 0 0 1.5px var(--brand-400) inset; } }
.option input:checked + .option-box .option-key { background: var(--primary); color: #FFFFFF; }
.option input:checked + .option-box::after {
  /* marca de verificación */
  content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.options:not(.has-svg) .option input:checked + .option-box::after { top: 50%; margin-top: -10px; right: 12px; }
.options:not(.has-svg) .option-box { padding-right: 38px; }
@media (prefers-reduced-motion: no-preference) {
  .option input:checked + .option-box .option-key { animation: pop .3s var(--ease); }
}
@keyframes pop { 50% { transform: scale(1.18); } }
.option input:focus-visible + .option-box { outline: 3px solid var(--focus); outline-offset: 2px; }

.q-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 22px; }
.q-actions .btn { width: 100%; padding-inline: 12px; }
.q-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.q-tools .btn { min-height: 44px; padding: 8px 14px; font-size: var(--fs-sm); }
.flag-btn[aria-pressed="true"] { color: var(--warn-text); background: var(--accent-soft); }
.flag-btn svg, .q-tools svg { width: 18px; height: 18px; }

/* Revisión */
.review-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.review-summary div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 6px; text-align: center; }
.review-summary strong { display: block; font-size: var(--fs-2xl); font-weight: 800; color: var(--heading); line-height: 1.1; font-variant-numeric: tabular-nums; }
.review-summary small { color: var(--muted); font-size: var(--fs-xs); }
.review-summary div:first-child strong { color: var(--primary); }
@media (prefers-color-scheme: dark) { .review-summary div:first-child strong { color: var(--link); } }
.review-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-sm); color: var(--muted); margin: 8px 0 16px; padding: 0; list-style: none; }
.review-legend span { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: -3px; margin-right: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); position: relative; }
.review-legend .lg-answered { background: var(--primary); border-color: var(--primary); }
.review-legend .lg-flagged::after { content: ""; position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.review-grid { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.review-grid button {
  width: 100%; min-height: 48px; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--heading); font: inherit; font-weight: 700; cursor: pointer; position: relative;
  font-variant-numeric: tabular-nums; transition: transform .12s var(--ease), border-color .15s;
}
.review-grid button:hover { border-color: var(--primary); }
.review-grid button:focus-visible { outline: none; box-shadow: var(--ring); }
.review-grid button.is-answered { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.review-grid button.is-flagged::after {
  content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg-soft);
}
#screen-review h1 { font-size: var(--fs-2xl); margin-top: 16px; }
@media (max-width: 479px) { #screen-review .btn-row .btn { width: 100%; } }

/* =========================================================
   8. Resultado
   ========================================================= */
.result-grid { display: grid; gap: 16px; padding-top: 8px; }
@media (min-width: 900px) { .result-grid { grid-template-columns: 1.1fr .9fr; align-items: start; gap: 24px; } }
.result-hero { text-align: center; position: relative; overflow: hidden; isolation: isolate; }
.result-hero::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 220px; z-index: -1;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--brand-500) 22%, transparent) 1.3px, transparent 1.8px) 0 0 / 20px 20px,
    radial-gradient(28rem 14rem at 50% 0, color-mix(in srgb, var(--brand-500) 14%, transparent), transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.result-hero .eyebrow { font-size: var(--fs-xs); justify-content: center; }
.result-hero h1.eyebrow { margin: 0; }
.iq-value {
  font-size: var(--fs-score); font-weight: 850; line-height: 1; letter-spacing: -.04em;
  color: var(--primary); margin: 12px 0 10px; font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) { .iq-value { color: var(--link); } }
@media (prefers-reduced-motion: no-preference) {
  #result:not([hidden]) .iq-value { animation: score-in .8s var(--ease) both .1s; }
  #result:not([hidden]) .badge { animation: rise .5s var(--ease) both .45s; }
}
@keyframes score-in { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
.iq-range { color: var(--muted); margin-bottom: 14px; font-size: var(--fs-sm); }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px 7px 12px; border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--link); font-weight: 750; border: 1px solid var(--primary-line);
}
.badge::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.badge:empty { display: none; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 24px 0 8px; }
.stats:has(> [hidden]) { grid-template-columns: minmax(0, 260px); justify-content: center; }
.stats div { background: var(--surface-2); border-radius: var(--radius); padding: 14px 12px; text-align: center; }
.stats dt { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; }
.stats dd { margin: 2px 0 0; font-weight: 800; font-size: var(--fs-xl); color: var(--heading); font-variant-numeric: tabular-nums; }
.bell { margin: 20px 0 0; }
.bell figcaption { margin-top: 8px; line-height: 1.5; }
.bell svg { width: 100%; height: auto; display: block; overflow: visible; }
.bell .axis { stroke: var(--border-strong); stroke-width: 1.5; }
.bell .curve { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; }
.bell .area { fill: var(--primary); opacity: .16; }
.bell .tick { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.bell .marker { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 3 3; }
.bell .ci-band { fill: var(--accent); opacity: .35; }
.bell .marker-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.bell .marker-label { fill: var(--heading); font-weight: 800; font-size: 13px; font-family: var(--font); }
@media (prefers-color-scheme: dark) { .bell .curve { stroke: var(--link); } .bell .area { fill: var(--link); opacity: .14; } }
@media (prefers-reduced-motion: no-preference) {
  .bell .curve { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.2s var(--ease) .2s forwards; }
  .bell .marker-dot { transform-box: fill-box; transform-origin: center; animation: dot-in .5s var(--ease) 1.1s both; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

#domains-card h2, #cert-card h2 { font-size: var(--fs-xl); }
.domains { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 16px; }
.domain-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; font-weight: 600; color: var(--heading); }
.domain-row .bar { grid-column: 1 / -1; height: 10px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.domain-row .bar span {
  display: block; height: 100%; width: 0; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-400), var(--primary));
  transition: width .9s var(--ease);
}
@media (prefers-color-scheme: dark) { .domain-row .bar span { background: linear-gradient(90deg, var(--brand-500), var(--brand-300)); } }
.domain-row .val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }

#cert-card { border-color: var(--primary-line); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 140px); }
#result .section { padding: 32px 0 0; }
#result-actions { justify-content: flex-start; }
#no-result { text-align: center; }
#no-result .container { max-width: 560px; }

/* =========================================================
   9. Certificado
   ========================================================= */
.cert-wrap { padding: 8px 16px 24px; }
.cert-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 20px; }
@media (max-width: 479px) { .cert-actions .btn { width: 100%; } }
#copy-status { text-align: center; min-height: 1.5em; margin: -8px 0 12px; }
.cert-scroller { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px 12px; }
.cert-hint { text-align: center; margin: 4px 0 0; }
.cert {
  --cert-ink: #1E1B4B;
  --cert-text: #2C3345;
  --cert-muted: #5B6478;
  --cert-line: #DCE0EE;
  --cert-brand: #4338CA;
  position: relative;
  background: #FFFFFF; color: var(--cert-text);
  width: 100%; max-width: 1040px; margin: 0 auto;
  aspect-ratio: 297 / 210;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  padding: 2.6%;
  container-type: inline-size;
  overflow: hidden;
}
.cert::before {
  /* esquina con la retícula de puntos de la marca */
  content: ""; position: absolute; right: 4.2cqw; top: 4.2cqw; width: 18cqw; height: 14cqw; pointer-events: none;
  background-image: radial-gradient(circle, rgb(99 102 241 / .13) .32cqw, transparent .4cqw);
  background-size: 2.2cqw 2.2cqw;
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 10%, transparent 75%);
  mask-image: radial-gradient(circle at 100% 0, #000 10%, transparent 75%);
}
.cert::after {
  content: ""; position: absolute; left: 4.2cqw; bottom: 4.2cqw; width: 18cqw; height: 14cqw; pointer-events: none;
  background-image: radial-gradient(circle, rgb(245 158 11 / .16) .32cqw, transparent .4cqw);
  background-size: 2.2cqw 2.2cqw;
  -webkit-mask-image: radial-gradient(circle at 0 100%, #000 10%, transparent 75%);
  mask-image: radial-gradient(circle at 0 100%, #000 10%, transparent 75%);
}
.cert-frame {
  position: relative; z-index: 1; height: 100%;
  border: .55cqw solid transparent;
  border-image: linear-gradient(135deg, #6366F1, #3730A3 60%, #F59E0B) 1;
  padding: 3cqw 5cqw 2.4cqw;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
}
.cert-frame::before {
  content: ""; position: absolute; inset: .8cqw; border: 1px solid var(--cert-line); pointer-events: none;
}
.cert-logo { height: 4.6cqw; width: auto; display: block; margin: 0 auto; }
.cert-kicker { font-size: 1.25cqw; letter-spacing: .32em; text-transform: uppercase; color: var(--cert-brand); font-weight: 700; margin: 1.6cqw 0 0; }
.cert-title { font-size: 3.7cqw; font-weight: 700; margin: .5cqw 0 0; letter-spacing: -.005em; color: var(--cert-ink); font-family: Georgia, "Times New Roman", serif; }
.cert-pre { font-size: 1.55cqw; color: var(--cert-muted); margin: 0 0 .4cqw; }
.cert-name {
  font-size: 4.3cqw; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400;
  color: var(--cert-ink); margin: 0 auto; padding: 0 3cqw .6cqw; border-bottom: 1.5px solid var(--cert-line);
  max-width: 100%; min-width: 50%; overflow-wrap: anywhere; line-height: 1.2;
}
.cert-body { font-size: 1.55cqw; color: var(--cert-muted); margin: 1.2cqw 0 0; }
.cert-body strong { color: var(--cert-ink); }
.cert-score { display: flex; justify-content: center; align-items: stretch; gap: 0; margin: 1.6cqw 0 0; }
.cert-score div { display: flex; flex-direction: column; padding: 0 3.4cqw; }
.cert-score div + div { border-left: 1.5px solid var(--cert-line); }
.cert-score strong { font-size: 4.6cqw; line-height: 1.05; color: var(--cert-brand); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cert-score span { font-size: 1.15cqw; text-transform: uppercase; letter-spacing: .16em; color: var(--cert-muted); margin-top: .3cqw; }
.cert-foot { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 2cqw; margin-top: 1cqw; font-size: 1.15cqw; color: var(--cert-muted); }
.cert-foot .left { text-align: left; }
.cert-foot .right { text-align: right; }
.cert-foot strong { color: var(--cert-ink); display: block; font-size: 1.4cqw; margin-top: .2cqw; }
.cert-seal {
  width: 6cqw; height: 6cqw; padding: 1.8cqw; box-sizing: content-box;
  /* sin border-radius: en un <img> recortaría el isotipo */
  background: radial-gradient(circle closest-side, #FFFFFF calc(100% - 2px), var(--cert-line) calc(100% - 1.5px), #F7F8FC calc(100% - 1px), transparent 100%);
}
.cert-code { font-family: var(--mono); color: var(--cert-ink); letter-spacing: .04em; }
.cert-disclaimer { font-size: .95cqw; color: var(--cert-muted); margin: 1.4cqw 0 0; max-width: 92%; line-height: 1.5; }
.cert-verify-url { font-family: var(--mono); word-break: break-all; color: var(--cert-ink); }
.cert-url-box { margin: 20px auto 0; max-width: 1040px; }
.cert-url { font-family: var(--mono); font-size: .8rem; word-break: break-all; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-md); color: var(--text); }

@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff !important; color: #000; }
  body { display: block; min-height: 0; padding: 0; }
  .no-print, .site-header, .site-footer, .skip-link { display: none !important; }
  .cert-wrap { padding: 0; }
  .container { max-width: none; padding: 0; }
  .cert-scroller { overflow: visible; padding: 0; }
  .cert {
    width: 297mm; height: 210mm; max-width: none; min-width: 0 !important; aspect-ratio: auto;
    border-radius: 0; box-shadow: none; margin: 0; padding: 8mm;
    page-break-inside: avoid; break-inside: avoid;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .card { box-shadow: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   10. Verificar
   ========================================================= */
.verify-card { text-align: center; }
.verify-icon { width: 72px; height: 72px; margin: 0 auto 14px; display: block; padding: 8px; border-radius: 50%; }
.verify-ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.verify-ok .verify-icon { color: var(--ok); background: var(--ok-soft); }
.verify-bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.verify-bad .verify-icon { color: var(--bad); background: var(--bad-soft); }
.verify-data {
  display: grid; grid-template-columns: auto 1fr; gap: 0; text-align: left; max-width: 440px; margin: 20px auto 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.verify-data dt, .verify-data dd { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.verify-data dt:last-of-type, .verify-data dd:last-of-type { border-bottom: 0; }
.verify-data dt { color: var(--muted); background: var(--surface-2); font-size: var(--fs-sm); }
.verify-data dd { margin: 0; font-weight: 650; color: var(--heading); overflow-wrap: anywhere; }
.verify-form { display: grid; gap: 10px; margin-top: 16px; text-align: left; }
.verify-card .btn-row, .error-page .btn-row { justify-content: center; }
.verify-card + .verify-card, .verify-card + .verify-form, #v-loading + .verify-card { margin-top: 16px; }
.section > .container > h1 + .card, .verify-form { margin-top: 16px; }
.container.narrow.section { padding-top: 24px; }
.container.narrow.section > h1 { font-size: var(--fs-2xl); }

/* =========================================================
   11. Páginas legales
   ========================================================= */
.legal { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px 24px; }
.legal h1 { font-size: var(--fs-2xl); margin-top: 16px; }
.legal h2 { font-size: var(--fs-xl); margin-top: 2em; scroll-margin-top: 16px; padding-top: 1.2em; border-top: 1px solid var(--border); }
.legal h3 { font-size: var(--fs-lg); margin-top: 1.5em; }
.legal p, .legal li { color: var(--text); }
.legal ul, .legal ol { padding-left: 1.3em; margin: 0 0 1em; }
.legal li { margin-bottom: .4em; }
.legal li::marker { color: var(--link); }
.legal a { overflow-wrap: anywhere; }
.legal-updated {
  display: inline-block; color: var(--muted); font-size: var(--fs-sm);
  background: var(--surface-2); border-radius: var(--radius-pill); padding: 4px 12px;
}
.legal table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; margin-bottom: 1em; font-size: var(--fs-sm); }
.legal th, .legal td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--surface-2); color: var(--heading); }

/* =========================================================
   12. 404 y sin conexión
   ========================================================= */
.error-page { text-align: center; padding: 48px 0; }
.error-page .big {
  font-size: clamp(4.5rem, 3rem + 10vw, 8rem); font-weight: 850; line-height: 1; letter-spacing: -.04em; margin-bottom: 12px;
  color: var(--primary);
}
@media (prefers-color-scheme: dark) { .error-page .big { color: var(--link); } }
.error-page h1, .offline-page h1 { font-size: var(--fs-2xl); }

.offline-page { text-align: center; padding: 32px 16px 16px; }
.offline-page .lead { color: var(--muted); font-size: var(--fs-lg); }
.offline-page .btn-row { justify-content: center; margin-top: 8px; }
.offline-page .alert { text-align: left; }
.offline-art { width: 112px; height: 112px; margin: 0 auto 20px; display: block; }
.offline-art .c-dot { fill: var(--primary); opacity: .85; }
.offline-art .c-gap { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 6 6; }
@media (prefers-color-scheme: dark) { .offline-art .c-dot { fill: var(--link); } }
@media (prefers-reduced-motion: no-preference) {
  .offline-art .c-gap { animation: dash 8s linear infinite; }
}
@keyframes dash { to { stroke-dashoffset: -120; } }

/* =========================================================
   13. Ajustes móviles y PWA
   ========================================================= */
html:has(body.test-page) { overscroll-behavior-y: contain; }
input, select, textarea { font-size: max(16px, 1rem); }
button, .btn, .option-box, summary { touch-action: manipulation; }
@media (max-width: 399px) { .option-svg svg { max-width: 96px; max-height: 96px; } }
/* Teléfonos bajos: que la figura deje ver enunciado y opciones */
@media (max-height: 640px) { .q-media svg { max-height: 34vh; } .q-media { padding: 10px; } }

.pwa-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  pointer-events: none;
}
.pwa-dock:empty { display: none; }
.pwa-dock > * { pointer-events: auto; }
.pwa-banner {
  width: 100%; max-width: 560px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
}
@media (prefers-reduced-motion: no-preference) { .pwa-banner { animation: rise .35s var(--ease) both; } }
.pwa-banner-text { flex: 1 1 220px; min-width: 0; }
.pwa-banner-text strong { display: block; color: var(--heading); }
.pwa-banner-text p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.pwa-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.pwa-btn { min-height: 44px; padding: 8px 16px; }
.pwa-share-icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; color: var(--link); }
.pwa-dock > .pwa-status { pointer-events: none; }
.pwa-status {
  margin: 0; max-width: 100%;
  padding: 6px 14px; border-radius: var(--radius-pill); line-height: 1.35;
  font-size: .85rem; font-weight: 600; text-align: center;
  background: var(--ok-soft); color: var(--text); border: 1px solid var(--ok);
  box-shadow: var(--shadow);
}
.pwa-status.is-offline { background: var(--accent-soft); border-color: var(--accent); }
.has-pwa-banner body { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.has-pwa-status body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
@media print { .pwa-dock { display: none !important; } }

/* =========================================================
   14. Movimiento reducido
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* Notas de supervisión que insertan certificado.js y verificar.js */
.cert-supervision { color: var(--cert-ink); font-weight: 700; }
.verify-supervision { margin: 16px auto 0; max-width: 440px; }
