/* =========================================================
   CPPA Digital Solutions — Landing de campaña «Automatización»
   Base: tokens de assets/cppa.css (naranja #FF6B35, Fraunces,
   Inter Tight, JetBrains Mono) con tratamiento de campaña:
   superficies claras, azul noche puntual y brillos dosificados.
   ========================================================= */

:root {
  --navy-950: #070b14;
  --navy-900: #0b1120;
  --navy-800: #121a2e;
  --cream: #f3f1ec;
  --cream-2: #c9ccd3;
  --cream-3: #9aa1ad;
  --pearl: #f4f3f0;
  --paper: #ffffff;
  --ink: #0e1116;
  --ink-2: #474c55;
  --ink-3: #6b7079;
  --line: rgba(14, 17, 22, .09);
  --accent: #ff6b35;
  --accent-hi: #ff8456;
  --accent-deep: #b8410f;
  --accent-wash: #fff3ec;
  --blue: #5b8cff;
  --danger: #b42318;
  --danger-dark: #ff9d8f;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1200px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream);
  background: var(--navy-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body[data-view="quiz"] { background: var(--pearl); }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: rgba(255, 107, 53, .28); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.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 { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--paper); color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Barra superior flotante ---------- */
.topbar {
  position: absolute; z-index: 50; top: 12px; left: 50%;
  width: min(100% - 24px, var(--wrap));
  transform: translateX(-50%);
}
.topbar-inner {
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 10px 0 18px;
  border-radius: 999px;
  background: rgba(9, 13, 24, .62);
  border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 12px 40px -18px rgba(0, 0, 0, .55);
}
body[data-view="quiz"] .topbar-inner { background: rgba(9, 13, 24, .9); }
.brand { flex: none; display: flex; align-items: center; text-decoration: none; margin-right: auto; border-radius: 8px; }
.brand img { height: 32px; width: auto; max-width: none; }
.brand-fallback { font-weight: 700; font-size: 18px; letter-spacing: -.03em; color: var(--cream); }
.brand-fallback small { font-weight: 500; font-size: 12px; color: var(--accent); letter-spacing: .02em; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px 0 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--cream-2); text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: background .2s, color .2s;
}
.topbar-link .ic { width: 16px; height: 16px; }
.topbar-link:hover { background: rgba(255, 255, 255, .08); color: var(--cream); }
.preview-pill {
  font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: #ffd2bd; padding: 8px 11px; border-radius: 999px;
  background: rgba(255, 107, 53, .14); border: 1px solid rgba(255, 107, 53, .3);
  white-space: nowrap;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: -.01em; line-height: 1.15;
  border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease), box-shadow .25s;
}
.btn .ic { width: 18px; height: 18px; stroke-width: 1.9; }
.btn-primary {
  background: var(--accent); color: #160b05;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 12px 30px -12px rgba(255, 107, 53, .75);
}
.btn-primary:hover { background: var(--accent-hi); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 18px 38px -14px rgba(255, 107, 53, .85); }
.btn-primary:active { transform: translateY(0); }
.btn-primary .ic { transition: transform .25s var(--ease); }
.btn-primary:hover .ic { transform: translateX(3px); }
.btn-primary[aria-busy="true"] { opacity: .75; cursor: progress; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 16px; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: rgba(14, 17, 22, .14); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: rgba(14, 17, 22, .28); }
.btn-ghost.on-dark { color: var(--cream); border-color: rgba(255, 255, 255, .2); }
.btn-ghost.on-dark:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .36); }
.link {
  background: none; border: 0; padding: 0; margin-top: 10px;
  font-size: 13px; font-weight: 600; color: #ffb38a;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.link:hover { color: #ffd2bd; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px;
  font: 500 12px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #ffb38a;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--accent); }

/* ---------- Vistas y transiciones ---------- */
.view.is-entering { animation: viewIn .7s var(--ease) both; }
.view.is-leaving { animation: viewOut .32s ease-in both; pointer-events: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.992); } to { opacity: 1; transform: none; } }
@keyframes viewOut { to { opacity: 0; transform: translateY(-10px) scale(.992); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Portada (tarjeta) + pregunta 1 en la misma pantalla ---------- */
.intro {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: min(740px, calc(100svh - 128px));
  padding: 36px 40px 40px; border-radius: 28px;
  background: var(--navy-950); color: var(--cream);
  box-shadow: 0 0 0 1px rgba(140, 170, 255, .1), 0 40px 90px -40px rgba(10, 20, 60, .65);
}
.intro-media { position: absolute; inset: 0; z-index: -2; }
.intro-media img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 35%; animation: settle 2.4s var(--ease) both; }
@keyframes settle { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
.intro::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7, 11, 20, .35) 0%, rgba(7, 11, 20, 0) 22%, rgba(7, 11, 20, .5) 48%, rgba(7, 11, 20, .94) 70%, var(--navy-950) 100%);
}
.intro::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(91, 140, 255, .8) 30%, rgba(255, 107, 53, .95) 60%, transparent 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 18px 1px rgba(91, 140, 255, .35);
  animation: sheen 9s linear infinite;
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.intro h1 {
  margin: 0 0 18px;
  font-weight: 600; font-size: clamp(40px, 4.4vw, 68px); line-height: .98; letter-spacing: -.045em;
  color: var(--cream); text-wrap: balance;
}
.intro h1 em {
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.035em;
  color: var(--accent);
  text-shadow: 0 0 42px rgba(255, 107, 53, .35);
}
.intro-lead { margin: 0 0 20px; max-width: 440px; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.5; color: var(--cream-2); text-wrap: pretty; }
.micro { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--cream-2); }
.micro .ic { width: 17px; height: 17px; color: #ffb38a; }
.start-cue { color: var(--accent-deep); font-weight: 600; }
.reveal { animation: rise .95s var(--ease) both; animation-delay: calc(var(--d, 0) * 110ms + 200ms); }

/* ---------- 01–06 · Diagnóstico ---------- */
.quiz { position: relative; min-height: 100vh; min-height: 100svh; padding: 88px 0 40px; color: var(--ink); background: var(--pearl); isolation: isolate; }
.quiz-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.quiz-bg::before {
  content: ''; position: absolute; inset: 0;
  background: url('../img/ondas-claras-1672.webp') center / cover no-repeat;
  opacity: .62;
}
.quiz-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 30% 40%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 70%);
}
.quiz-shell {
  width: min(100% - 2 * var(--gutter), var(--wrap)); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: stretch;
}
.quiz-panel {
  display: flex; flex-direction: column; min-width: 0;
  min-height: min(740px, calc(100svh - 128px));
  padding: 30px 40px 26px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  backdrop-filter: blur(26px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 40px 90px -40px rgba(24, 38, 74, .32), 0 2px 8px rgba(24, 38, 74, .04);
}
.quiz-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.quiz-count { font: 500 13px var(--mono); color: var(--ink); letter-spacing: .04em; }
.quiz-label { font: 500 12px var(--mono); color: var(--accent-deep); letter-spacing: .12em; text-transform: uppercase; }
.progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 34px; }
.progress i { height: 4px; border-radius: 4px; background: rgba(14, 17, 22, .08); overflow: hidden; position: relative; }
.progress i::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff9a6b);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.progress i.on::after { transform: scaleX(1); }
.progress i.now::after { box-shadow: 0 0 12px rgba(255, 107, 53, .6); }

#leadForm { flex: 1; display: flex; flex-direction: column; }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step.enter-fwd { animation: stepFwd .5s var(--ease) both; }
.step.enter-back { animation: stepBack .5s var(--ease) both; }
@keyframes stepFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.q-title {
  margin: 0 0 10px; outline: none;
  font-weight: 600; font-size: clamp(30px, 3.1vw, 44px); line-height: 1.05; letter-spacing: -.035em;
  text-wrap: balance;
}
.q-note { margin: 0 0 26px; font-size: 15px; color: var(--ink-3); }

.choices { display: grid; gap: 10px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 12px 14px 12px 16px;
  border-radius: 16px; background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  font-size: 15px; font-weight: 500; line-height: 1.25; color: var(--ink);
  cursor: pointer; user-select: none;
  transition: border-color .2s, background-color .2s, box-shadow .25s, transform .2s var(--ease);
}
.choice:hover { border-color: rgba(14, 17, 22, .22); box-shadow: 0 8px 24px -16px rgba(24, 38, 74, .4); }
.choice:active { transform: scale(.99); }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice .ic { width: 22px; height: 22px; color: var(--ink-3); transition: color .2s; }
.choice > span { flex: 1; min-width: 0; }
.mark {
  flex: none; width: 22px; height: 22px; margin-left: auto;
  display: grid; place-items: center;
  border-radius: 7px; border: 1.5px solid rgba(14, 17, 22, .22); background: var(--paper);
  transition: background-color .2s, border-color .2s, transform .25s var(--ease);
}
.mark::after {
  content: ''; width: 10px; height: 5px; margin-top: -2px;
  border-left: 2px solid #160b05; border-bottom: 2px solid #160b05;
  transform: rotate(-45deg) scale(.4); opacity: 0;
  transition: opacity .15s, transform .25s var(--ease);
}
.single .mark { border-radius: 50%; }
.single .mark::after { width: 8px; height: 8px; margin: 0; border: 0; border-radius: 50%; background: #160b05; transform: scale(.4); }
.choice.is-on {
  border-color: rgba(255, 107, 53, .8);
  background: linear-gradient(180deg, #fff8f4, var(--accent-wash));
  box-shadow: 0 0 0 3px rgba(255, 107, 53, .12), 0 14px 30px -18px rgba(255, 107, 53, .7);
}
.choice.is-on .ic { color: var(--accent-deep); }
.choice.is-on .mark { background: var(--accent); border-color: var(--accent); transform: scale(1.04); }
.choice.is-on .mark::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.single .choice.is-on .mark::after { transform: scale(1); }
.choice.has-focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.tall .choice { min-height: 96px; align-items: flex-start; flex-wrap: wrap; padding-top: 16px; }
.tall .choice > span { flex-basis: calc(100% - 40px); order: 3; font-size: 16px; }
.tall .choice .mark { order: 2; }
.tall .choice .ic { order: 1; }

.other { margin-top: 14px; animation: rise .4s var(--ease) both; }
.other label, .field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--accent-deep); font-weight: 600; }
.other .req { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; margin-left: 6px; }
.opt { font-weight: 400; color: var(--ink-3); }
.other input, .field input, .field select {
  width: 100%; height: 52px; padding: 0 16px;
  border-radius: 12px; border: 1px solid rgba(14, 17, 22, .16); background: var(--paper);
  font-size: 16px; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.other input::placeholder, .field input::placeholder { color: #8a8f97; }
.other input:focus, .field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 107, 53, .16); }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 4px rgba(180, 35, 24, .1) !important; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.select { position: relative; }
.select::after {
  content: ''; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2); transform: rotate(45deg); pointer-events: none;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: 14px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.consent a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

.form-error { margin: 16px 0 0; font-size: 14px; font-weight: 500; color: var(--danger); }
.form-error:empty { margin: 0; }
.form-error.on-dark { color: var(--danger-dark); }

.quiz-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: auto; padding-top: 22px;
}
.quiz-nav { border-top: 1px solid rgba(14, 17, 22, .07); }
.quiz-nav .btn-primary { min-width: 170px; margin-left: auto; }
.quiz-nav .btn-primary.is-ready { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 4px rgba(255, 107, 53, .14), 0 14px 32px -12px rgba(255, 107, 53, .85); }
#leadForm { margin-bottom: 6px; }
.send-mode { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); text-align: right; }

/* Panel editorial (oscuro) */
.stage {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column;
  padding: 30px 32px 32px; border-radius: 28px;
  background: radial-gradient(ellipse 80% 60% at 80% 0%, rgba(91, 140, 255, .16), transparent 60%), var(--navy-900);
  color: var(--cream);
  box-shadow: 0 0 0 1px rgba(140, 170, 255, .1), 0 40px 90px -40px rgba(10, 20, 60, .65);
}
.stage-waves {
  position: absolute; left: 0; right: 0; bottom: 0; height: 62%; z-index: -1;
  background: url('../img/ondas-oscuras-1672.webp') center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(0deg, #000 35%, transparent);
  mask-image: linear-gradient(0deg, #000 35%, transparent);
  opacity: .85;
}
.stage-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.stage-kicker { font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cream-3); }
.stage-step { font: 500 12px var(--mono); color: #ffb38a; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255, 107, 53, .35); }
.stage-body { flex: 1; display: flex; flex-direction: column; animation: fadeIn .6s ease both; }
.stage-title { margin: 0 0 22px; font-size: clamp(22px, 2vw, 28px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; max-width: 360px; }
.stage-empty { margin: 0; color: var(--cream-3); font-size: 15px; }
.stage-fine { margin: 10px 0 0; font-size: 12.5px; color: var(--cream-3); line-height: 1.5; }

.stage-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stage-tasks li {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
  font-size: 15px; animation: rise .45s var(--ease) both;
}
.stage-tasks li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(255, 107, 53, .8); flex: none; }

.week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 26px; }
.day { display: flex; flex-direction: column-reverse; gap: 6px; }
.day b { margin-top: 6px; text-align: center; font: 500 12px var(--mono); color: var(--cream-3); }
.day i { height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .06); transition: background-color .35s, box-shadow .35s, border-color .35s; }
.day i.on { background: linear-gradient(180deg, #ff8a5c, var(--accent)); border-color: transparent; box-shadow: 0 6px 22px -6px rgba(255, 107, 53, .8); }
.day i.on:nth-of-type(2) { transition-delay: .06s; }
.day i.on:nth-of-type(3) { transition-delay: .12s; }
.stage-figure { margin: 0; font-size: clamp(22px, 2.1vw, 30px); font-weight: 600; letter-spacing: -.025em; }

.stage-time { align-items: center; justify-content: center; text-align: center; }
.watch {
  width: min(78%, 340px); height: auto; aspect-ratio: 1; object-fit: cover; margin: -8px auto 0;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 74%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 74%, transparent 100%);
}
.time-readout { display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.time-value { font-size: clamp(40px, 4.4vw, 60px); font-weight: 600; letter-spacing: -.04em; line-height: 1; color: var(--cream); }
.time-value.is-set { color: var(--cream); text-shadow: 0 0 30px rgba(91, 140, 255, .45); animation: rise .4s var(--ease) both; }
.time-unit { margin-top: 8px; font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cream-3); }

.tool-map { position: relative; flex: 1; min-height: 300px; }
.tool-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tool-lines line { stroke: rgba(255, 255, 255, .1); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke .35s; }
.tool-lines line.on { stroke: rgba(255, 140, 90, .85); filter: drop-shadow(0 0 3px rgba(255, 107, 53, .8)); }
.hub, .tool-node {
  position: absolute; transform: translate(-50%, -50%);
  padding: 9px 14px; border-radius: 999px; white-space: nowrap;
  font-size: 13px; font-weight: 500;
}
.hub { left: 50%; top: 50%; background: var(--cream); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 6px rgba(243, 241, 236, .08), 0 0 40px rgba(91, 140, 255, .35); }
.tool-node { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: var(--cream-3); transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s; }
.tool-node.on { background: rgba(255, 107, 53, .16); border-color: rgba(255, 107, 53, .7); color: var(--cream); box-shadow: 0 0 24px -4px rgba(255, 107, 53, .6); }

.stage-goal {
  margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(32px, 3.4vw, 50px); line-height: 1.08; letter-spacing: -.02em; color: var(--cream-3);
  text-wrap: balance;
}
.stage-goal.is-set { color: #ffc4a6; animation: rise .45s var(--ease) both; }

.stage-summary { margin: 0; display: grid; gap: 0; }
.stage-summary div { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.stage-summary div:last-child { border-bottom: 0; }
.stage-summary dt { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cream-3); margin-bottom: 4px; }
.stage-summary dd { margin: 0; font-size: 15px; color: var(--cream); }

/* ---------- 08 · Escena oscura (confirmación) ---------- */
.view.dark { position: relative; min-height: 100vh; min-height: 100svh; padding: 112px 0 64px; overflow: hidden; isolation: isolate; background: var(--navy-950); color: var(--cream); }
.dark-bg { position: absolute; inset: 0; z-index: -1; }
.done h2 {
  margin: 0 0 16px; outline: none;
  font-weight: 600; font-size: clamp(34px, 4.6vw, 62px); line-height: 1.02; letter-spacing: -.04em; text-wrap: balance;
}

.done { display: flex; align-items: center; }
.dark-bg.neon { background: url('../img/onda-neon-1672.webp') center 75% / cover no-repeat; opacity: .55; }
.dark-bg.neon::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 55% at 50% 42%, rgba(7, 11, 20, .92), rgba(7, 11, 20, .55) 70%, rgba(7, 11, 20, .35)); }
.done-inner { width: min(100% - 2 * var(--gutter), 720px); margin: 0 auto; text-align: center; }
.done-badge {
  display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 26px; border-radius: 50%;
  background: rgba(255, 107, 53, .12); border: 1px solid rgba(255, 107, 53, .5); color: var(--accent);
  box-shadow: 0 0 40px -6px rgba(255, 107, 53, .55);
  animation: rise .6s var(--ease) both;
}
.done-badge .ic { width: 30px; height: 30px; stroke-width: 2; }
.done-text { margin: 0 auto 28px; max-width: 560px; font-size: 18px; line-height: 1.55; color: var(--cream-2); text-wrap: pretty; }
.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.done-actions .btn { white-space: normal; text-align: center; }
.copy-status { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; color: #ffc4a6; }
.done-details { margin: 14px auto 0; max-width: 620px; text-align: left; border-radius: 16px; background: rgba(17, 24, 42, .6); border: 1px solid rgba(255, 255, 255, .09); }
.done-details summary { padding: 16px 20px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--cream-2); }
.done-details summary:hover { color: var(--cream); }
.done-details pre {
  margin: 0; padding: 0 20px 20px; max-height: 300px; overflow: auto;
  font: 13px/1.6 var(--mono); color: var(--cream-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.done-home { display: inline-flex; align-items: center; gap: 6px; margin-top: 26px; font-size: 14px; color: var(--cream-3); text-underline-offset: 3px; }
.done-home .ic { width: 16px; height: 16px; }
.done-home:hover { color: var(--cream); }

/* ---------- Pie ---------- */
.foot { background: var(--navy-950); color: var(--cream-3); border-top: 1px solid rgba(255, 255, 255, .07); }
body[data-view="quiz"] .foot { background: var(--pearl); color: #575c64; border-top-color: var(--line); }
.foot-inner {
  width: min(100% - 2 * var(--gutter), var(--wrap)); margin: 0 auto; padding: 22px 0 calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; font-size: 13px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.foot-links a:hover { color: var(--cream); }
body[data-view="quiz"] .foot-links a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .quiz-panel { padding: 28px 30px 24px; }
  .stage { padding: 26px 26px 28px; }
}

@media (max-width: 900px) {
  .quiz { padding: 82px 0 24px; }
  .quiz-shell { grid-template-columns: 1fr; }

  /* Botones siempre a mano: barra fija al pie del cuestionario */
  .quiz-panel { padding-bottom: 0; }
  .quiz-nav {
    position: sticky; bottom: 0; z-index: 5;
    margin: 0 -30px; padding: 14px 30px calc(14px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-radius: 0 0 28px 28px;
  }

  /* Panel «Tu caso» compacto dentro del cuestionario */
  .stage.is-inline { margin: 20px 0 6px; padding: 18px 18px 20px; border-radius: 20px; }
  .stage.is-inline .stage-top { margin-bottom: 12px; }
  .stage.is-inline .stage-title { font-size: 19px; margin-bottom: 14px; max-width: none; }
  .stage.is-inline .stage-waves { height: 80%; opacity: .7; }
  .stage.is-inline .stage-empty { font-size: 14px; }
  .stage.is-inline .stage-tasks { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .stage.is-inline .stage-tasks li { padding: 8px 12px; font-size: 13.5px; border-radius: 999px; gap: 8px; }
  .stage.is-inline .week { gap: 6px; margin-bottom: 16px; }
  .stage.is-inline .day { gap: 5px; }
  .stage.is-inline .day i { height: 15px; border-radius: 5px; }
  .stage.is-inline .stage-figure { font-size: 21px; }
  .stage.is-inline .stage-time { flex-direction: row; align-items: center; justify-content: flex-start; gap: 18px; text-align: left; }
  .stage.is-inline .watch { width: 120px; margin: 0; flex: none; }
  .stage.is-inline .time-readout { align-items: flex-start; margin: 0; }
  .stage.is-inline .time-value { font-size: 34px; }
  .stage.is-inline .tool-map { min-height: 240px; }
  .stage.is-inline .hub, .stage.is-inline .tool-node { padding: 6px 9px; font-size: 11.5px; }
  .stage.is-inline .stage-goal { font-size: 27px; }
  .stage.is-inline .stage-summary div { padding: 8px 0; }
  .stage.is-inline .stage-summary dd { font-size: 14px; }
  .quiz-panel { min-height: calc(100svh - 106px); }
}

/* Móvil y tableta: portada compacta encima de la pregunta 1 */
@media (max-width: 900px) {
  .intro { min-height: 0; padding: 190px 28px 26px; border-radius: 24px; }
  .intro-media img { object-position: 74% 26%; }
  .intro::before { background: linear-gradient(180deg, rgba(7, 11, 20, .3) 0%, rgba(7, 11, 20, 0) 25%, rgba(7, 11, 20, .7) 55%, rgba(7, 11, 20, .96) 78%); }
}
@media (max-width: 700px) {
  .intro { padding: 92px 18px 18px; border-radius: 22px; }
  .intro .eyebrow { margin-bottom: 10px; font-size: 10.5px; }
  .intro h1 { font-size: clamp(30px, 8.6vw, 38px); margin-bottom: 12px; }
  .intro-lead { display: none; }
  .micro { font-size: 13px; }
  .quiz-shell { gap: 10px; }
}
/* Móviles bajos (iPhone SE y similares): la primera opción debe verse sin scroll */
@media (max-width: 700px) and (max-height: 760px) {
  .intro { padding-top: 44px; }
  .intro h1 { font-size: 28px; margin-bottom: 8px; }
  .intro .eyebrow { margin-bottom: 8px; }
  .quiz { padding-top: 66px; }
  .quiz-panel { padding-top: 16px; }
  .quiz-head { margin-bottom: 10px; }
  .progress { margin-bottom: 16px; }
  .q-title { font-size: 26px; margin-bottom: 6px; }
  .q-note { margin-bottom: 12px; }
}
@media (max-width: 700px) and (max-height: 620px) {
  .intro { padding: 40px 16px 16px; }
  .intro .eyebrow, .intro .micro { display: none; }
  .intro h1 { margin-bottom: 0; }
}

@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .topbar { top: 8px; width: calc(100% - 16px); }
  .topbar-inner { height: 52px; padding: 0 8px 0 14px; gap: 10px; }
  .brand img { height: 28px; }
  .topbar-link { display: none; }
  .preview-pill { font-size: 10px; padding: 7px 10px; }

  .eyebrow { font-size: 11px; margin-bottom: 16px; }

  .quiz { padding: 70px 0 16px; }
  .quiz-shell { width: calc(100% - 16px); }
  .quiz-panel { padding: 20px 18px 0; border-radius: 22px; min-height: calc(100svh - 86px); }
  .progress { margin-bottom: 24px; }
  .q-title { font-size: clamp(27px, 7.6vw, 34px); }
  .q-note { margin-bottom: 18px; font-size: 14px; }
  .cols-2 { grid-template-columns: 1fr; }
  .cols-2.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { min-height: 54px; padding: 10px 12px 10px 14px; font-size: 15px; gap: 10px; border-radius: 14px; }
  .compact .choice { padding-right: 10px; font-size: 14px; }
  .compact .choice .ic { width: 20px; height: 20px; }
  .tall .choice { min-height: 56px; align-items: center; flex-wrap: nowrap; padding-top: 10px; }
  .tall .choice > span { flex-basis: auto; order: 0; font-size: 15px; }
  .tall .choice .mark, .tall .choice .ic { order: 0; }
  .fields { grid-template-columns: 1fr; gap: 14px; }
  .field-full { grid-column: auto; }
  .consent { font-size: 13.5px; }
  .quiz-nav {
    position: sticky; bottom: 0; z-index: 5;
    margin: 0 -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-radius: 0 0 22px 22px;
  }
  .quiz-nav .btn { min-height: 50px; }
  .quiz-nav .btn-primary { flex: 1; min-width: 0; }
  .quiz-nav .btn-ghost { flex: none; padding: 0 16px; }
  .is-last .quiz-nav { border-radius: 0; }
  .is-last .quiz-nav .btn-ghost span { display: none; }
  .send-mode { text-align: left; }

  .view.dark { padding: 84px 0 40px; }
  .done-actions .btn { width: 100%; }
  .done-text { font-size: 16px; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .intro h1 { font-size: 29px; }
  .cols-2.compact { grid-template-columns: 1fr; }
  .quiz-nav .btn-ghost span { display: none; }
}

@media (min-width: 1600px) {
  :root { --wrap: 1320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Aviso de cookies (Meta Pixel solo tras aceptar) ---------- */
.cc {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: 50;
  max-width: 560px; margin-left: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  padding: 18px 20px; border-radius: 18px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 24px 60px -20px rgba(14, 17, 22, .45);
}
.cc[hidden] { display: none; }
.cc-text { flex: 1 1 260px; margin: 0; font-size: 14px; line-height: 1.5; }
.cc-text a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cc-btn { min-height: 44px; padding: 0 20px; font-size: 14px; }
