/* Reset, elementos base y componentes compartidos (botones, panel, card, chips,
   nivel-chip, barra de nivel, checklist, notice). Lo usan stepper y resultado. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 800; line-height: 1.06; color: var(--text); letter-spacing: -0.022em; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 20px; }
p { line-height: 1.65; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* Topbar navy (como el nav del sitio) — compartida por el stepper y el resultado */
.topbar { display: flex; align-items: center; justify-content: center; height: 64px; padding-inline: var(--gutter); border-bottom: 1px solid var(--ink-border); background: color-mix(in srgb, var(--ink) 90%, transparent); backdrop-filter: blur(12px) saturate(140%); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; color: var(--ink-text); }
.brand img { height: 36px; width: auto; display: block; }
.brand:hover { text-decoration: none; }

/* Layout */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--maxw-narrow); }

/* Hero oscuro (navy + glow) — portada, formulario y header de resultado */
.hero-dark {
  position: relative;
  background:
    radial-gradient(1100px 700px at 80% 6%, rgba(30, 143, 246, 0.12), transparent 60%),
    radial-gradient(900px 700px at 6% 94%, rgba(232, 72, 28, 0.08), transparent 58%),
    linear-gradient(168deg, #0A1C48 0%, var(--ink) 55%, #030C22 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: clamp(28px, 5vw, 54px);
  overflow: hidden;
}
.hero-dark h1, .hero-dark h2, .hero-dark .lead { color: #fff; }
.hero-dark .eyebrow { color: var(--accent-coral); }
.hero-dark .hl { color: var(--accent-coral); }
@media print {
  .hero-dark { background: none !important; color: var(--text) !important; padding: 0 !important; border-radius: 0 !important; }
  .hero-dark h1, .hero-dark h2, .hero-dark .lead { color: var(--text) !important; }
  .hero-dark .eyebrow, .hero-dark .hl { color: var(--primary) !important; }
}

/* Tipografía utilitaria */
.eyebrow { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--text-secondary); line-height: 1.6; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.hl { color: var(--primary); font-weight: 600; }
.center { text-align: center; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 26px; border-radius: var(--r-pill); border: 1px solid transparent; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.005em; line-height: 1; transition: transform .25s var(--ease), box-shadow .35s var(--ease), background .25s, border-color .25s, color .25s, filter .2s; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--sh-primary); }
.btn-primary:hover:not([disabled]) { background: var(--accent-dark); text-decoration: none; transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(232, 72, 28, 0.65); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-strong); }
.btn-ghost:hover:not([disabled]) { background: var(--primary-soft); border-color: var(--primary); text-decoration: none; color: var(--primary); }
.btn-accent { background: var(--primary); color: #fff; box-shadow: 0 8px 26px -10px rgba(11, 88, 211, 0.55); }
.btn-accent:hover:not([disabled]) { background: var(--primary-dark); text-decoration: none; transform: translateY(-2px); }
.btn-lg { padding: 16px 32px; font-size: 16px; }

/* Superficies */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--sh-md); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--sh-sm); transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--sh-md); }

/* Pill */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-secondary); font-size: 13px; font-weight: 600; border: 1px solid var(--border); }
.pill.brand { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* Chip de nivel (coloreado por data-nivel; color-mix para el fondo suave) */
.nivel-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: var(--r-pill); font-family: var(--font-display); font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.nivel-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.nivel-chip[data-nivel="1"] { color: var(--lvl-1); background: color-mix(in srgb, var(--lvl-1) 12%, white); }
.nivel-chip[data-nivel="2"] { color: var(--lvl-2); background: color-mix(in srgb, var(--lvl-2) 12%, white); }
.nivel-chip[data-nivel="3"] { color: var(--lvl-3); background: color-mix(in srgb, var(--lvl-3) 14%, white); }
.nivel-chip[data-nivel="4"] { color: var(--lvl-4); background: color-mix(in srgb, var(--lvl-4) 12%, white); }
.nivel-chip[data-nivel="5"] { color: var(--lvl-5); background: color-mix(in srgb, var(--lvl-5) 12%, white); }

/* Barra de nivel (1..5) */
.bar-nivel { display: block; height: 7px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.bar-nivel-fill { display: block; height: 100%; border-radius: var(--r-pill); transition: width .8s var(--ease); }

/* Checklist / marcadores */
.marker-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.marker-item { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.marker-item .mk { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }

/* Aviso */
.notice { background: color-mix(in srgb, var(--lvl-2) 8%, white); border: 1px solid color-mix(in srgb, var(--lvl-2) 30%, white); border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; color: var(--text-secondary); }
.notice code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }

/* Grid helpers */
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .md\:cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Reveal-on-scroll progresivo (CSS scroll-driven; degrada a visible) */
.reveal { opacity: 1; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; animation: reveal-in linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
  }
}
@keyframes reveal-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
