/* QTV · Diagnóstico comercial
 * Sistema visual y de movimiento tomado de qtvalga.com:
 *   tokens --qtv-brand-*, capas de fondo por sección (.qtv-bg-layer--*), fluido WebGL,
 *   grano de TV (qtvTvStaticGrain), titulares con máscara (kinetic-line-reveal),
 *   ticker de palabras, botones píldora magnéticos, encabezado flotante de vidrio.
 * Tipografía: Archivo con eje de ancho al 75 % = Archivo Condensed (Black 900 en titulares). */

:root {
  --canvas: #09101c;
  --navy: #0f1a2d;
  --navy-2: #16243a;
  --navy-3: #24354f;
  --navy-light: #182844;
  --orange: #dc580e;
  --orange-light: #f47530;
  --orange-dark: #b8430b;
  --orange-glow: #ffa764;
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.92);
  --muted: #9db0c8;
  --muted-2: #8e9bae;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --glass: rgba(15, 26, 45, 0.62);
  --glass-hi: rgba(24, 40, 68, 0.78);
  --warn: #f5b83d;
  --bad: #ff6a5c;

  --font: "Archivo", "Archivo Condensed", Arial, sans-serif;
  --w: 75%;                 /* Archivo Condensed, como el sitio */

  /* Curvas del sitio */
  --ease-qtv: cubic-bezier(0.165, 0.84, 0.44, 1);   /* --fromanother-ease (fondos, ticker) */
  --ease-motion: cubic-bezier(0.22, 1, 0.36, 1);    /* --qtv-motion-ease */
  --ease-power3: cubic-bezier(0.215, 0.61, 0.355, 1); /* GSAP power3.out (titulares, magnético) */
  --ease-btn: cubic-bezier(0.16, 1, 0.3, 1);        /* botones */
  --ease: var(--ease-motion);

  --radius: 14px;
  --radius-lg: 22px;
  --gutter: 24px;
  --header-space: 108px;

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #070b16;
  color: var(--text);
  font-family: var(--font);
  font-stretch: var(--w);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--orange-light); text-underline-offset: 3px; }
a:hover { color: #ffad80; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--orange-light); outline-offset: 3px; border-radius: 8px; }
[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;
}

/* ── Fondo animado (igual que qtvalga.com) ─────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #070b16; }

/* Capas de degradado por sección: se funden al cambiar de sección */
.qbg {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.85s var(--ease-qtv);
  transform: translateZ(0);
}
.qbg.is-active { opacity: 1; }
.qbg--hero    { background-color: #070b16; background-image: radial-gradient(circle at 72% 38%, #dc580e52 0%, #0000 58%), radial-gradient(circle at 18% 70%, #0f1a2dd9 0%, #0000 62%), linear-gradient(135deg, #090f1d 0%, #05080e 100%); }
.qbg--needs   { background-color: #0b162c; background-image: radial-gradient(circle at 25% 30%, #24354fb8 0%, #0000 60%), radial-gradient(circle at 85% 85%, #05080ee6 0%, #0000 60%), linear-gradient(160deg, #162642 0%, #0e1a30 55%, #070d18 100%); }
.qbg--pillars { background-color: #160b05; background-image: radial-gradient(circle at 75% 25%, #dc580e61 0%, #b8430b24 40%, #0000 64%), radial-gradient(circle at 15% 85%, #05080ee6 0%, #0000 60%), linear-gradient(150deg, #271207 0%, #170b05 55%, #090605 100%); }
.qbg--method  { background-color: #0d1729; background-image: radial-gradient(circle at 50% 20%, #24354fa6 0%, #0000 60%), radial-gradient(circle at 82% 88%, #dc580e29 0%, #0000 55%), linear-gradient(170deg, #16243a 0%, #0f1a2d 55%, #070d17 100%); }
.qbg--stats   { background-color: #0b0e14; background-image: radial-gradient(circle at 25% 28%, #e980173d 0%, #0000 58%), radial-gradient(circle at 85% 80%, #1e2522b8 0%, #0000 60%), linear-gradient(160deg, #171c24 0%, #0e1219 55%, #05070b 100%); }
.qbg--trust   { background-color: #091221; background-image: radial-gradient(circle at 72% 30%, #24354f8c 0%, #0000 58%), radial-gradient(circle at 18% 85%, #dc580e24 0%, #0000 56%), linear-gradient(155deg, #132138 0%, #0b1526 55%, #050911 100%); }
.qbg--cta     { background-color: #0a0605; background-image: radial-gradient(at 50% 22%, #eb601480 0%, #dc580e24 45%, #0000 72%), linear-gradient(#1a0b05 0%, #0b0605 55%, #020305 100%); }

/* Líquido del hero: dos manchas naranjas que siguen al cursor con retraso (solo en la portada) */
.bg-liquid { position: absolute; inset: 0; opacity: 0; transition: opacity 0.85s var(--ease-qtv); }
body[data-paso="intro"] .bg-liquid { opacity: 1; }
.bg-liquid-core,
.bg-liquid-echo {
  position: absolute; top: 40%; left: 75%;
  aspect-ratio: 1; width: min(85vw, 1250px);
  background: radial-gradient(#dc580e73 0%, #dc580e33 30%, #0000 68%);
  transform: translate(calc(-50% + var(--lx, 0px)), calc(-50% + var(--ly, 0px)));
  transition: transform 0.65s var(--ease-power3);
  will-change: transform;
}
.bg-liquid-echo {
  width: min(100vw, 1500px);
  background: radial-gradient(#dc580e33, #0000 65%);
  transition-duration: 1.1s;
}

/* Fluido WebGL (mismo shader del sitio; lo dibuja app.js) */
.bg-fluid { position: absolute; inset: 0; opacity: var(--fluido, 1); transition: opacity 0.85s var(--ease-qtv); }
.bg-fluid-canvas { display: block; width: 100%; height: 100%; opacity: 0.7; }

/* Grano de TV vivo */
.bg-noise {
  position: absolute; inset: -12%;
  width: 124%; height: 124%;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  opacity: 0.045;
  animation: grano 0.22s steps(4, end) infinite;
}
@keyframes grano {
  0%   { opacity: 0.04;  transform: translate(0); }
  25%  { opacity: 0.047; transform: translate(-2%, 3%); }
  50%  { opacity: 0.038; transform: translate(3%, -2%); }
  75%  { opacity: 0.049; transform: translate(-3%, -1%); }
  100% { opacity: 0.042; transform: translate(1%, 2%); }
}

/* ── Riel lateral (sección actual) ─────────────────────────────────────── */
.rail {
  position: fixed; z-index: 5;
  left: 14px; bottom: clamp(24px, 5vh, 56px);
  display: none; align-items: center; gap: 14px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0; transition: opacity 0.6s var(--ease-qtv);
}
@media (min-width: 1100px) { .rail { display: flex; } }
body[data-paso="pregunta"] .rail { opacity: 1; }
.rail-index { display: flex; align-items: baseline; gap: 6px; }
.rail-index b { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; display: inline-block; }
.rail-index b.cuenta { animation: cuenta 0.45s var(--ease-motion); }
.rail-sep { opacity: 0.35; }
#railTotal { opacity: 0.55; }
.rail-label { color: rgba(255, 255, 255, 0.7); letter-spacing: 0.14em; border-inline-start: 1px solid rgba(255, 255, 255, 0.22); padding-inline-start: 14px; }
@keyframes cuenta { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Encabezado flotante de vidrio (apple-header del sitio) ─────────────── */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}
.top-inner {
  pointer-events: auto;
  position: relative;
  width: 100%; max-width: 1520px; height: 64px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px 0 24px;
  background: rgba(9, 16, 28, 0.68);
  -webkit-backdrop-filter: blur(28px) saturate(125%) brightness(82%);
  backdrop-filter: blur(28px) saturate(125%) brightness(82%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.28);
  border-radius: 9999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 30px; width: auto; display: block; transition: height 0.3s; }
.brand-text { font-weight: 900; font-size: 24px; color: var(--text); }

.top-tag {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, 0.18);
}
/* Punto vivo (qtvPulseDot) */
.pulse, .eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 10px var(--orange);
  animation: puntoVivo 2s ease-in-out infinite;
}
@keyframes puntoVivo { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

.top-step {
  margin-left: auto;
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
}
.top-step b { color: var(--text); font-weight: 800; display: inline-block; }
.top-step.roll b { animation: cuenta 0.45s var(--ease-motion); }

/* Barra de avance: borde inferior de la píldora */
.progress { position: absolute; left: 24px; right: 24px; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.06); }
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  overflow: hidden;
  background: linear-gradient(90deg, var(--orange-dark), var(--orange) 55%, var(--orange-glow));
  box-shadow: 0 0 14px rgba(244, 117, 48, 0.8);
  transition: width 0.6s var(--ease-motion);
}
.progress-fill::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -120px; width: 120px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: brillo 2.6s ease-in-out infinite;
}
@keyframes brillo { 0% { left: -120px; } 60%, 100% { left: 100%; } }
body[data-paso="intro"] .progress { opacity: 0; }

/* ── Contenedor de pantallas ────────────────────────────────────────────── */
.app {
  min-height: 100vh; min-height: 100dvh;
  display: flex; justify-content: center; align-items: center;
  padding: var(--header-space) var(--gutter) 72px;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.screen { width: 100%; max-width: 780px; }
.screen.wide { max-width: 980px; }
/* Portada a todo lo ancho (como .agency-hero-inner del sitio: min(1520px, 100%)) */
.screen.intro { max-width: min(1520px, 100%); }

/* Entrada de pantallas: ds-fade-up del sitio */
.enter-fwd  { animation: entraAdelante 0.65s var(--ease-motion) both; }
.enter-back { animation: entraAtras 0.65s var(--ease-motion) both; }
.leave-fwd  { animation: saleAdelante 0.16s ease-in both; }
.leave-back { animation: saleAtras 0.16s ease-in both; }
@keyframes entraAdelante { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes entraAtras    { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
@keyframes saleAdelante  { to { opacity: 0; transform: translateY(-18px); } }
@keyframes saleAtras     { to { opacity: 0; transform: translateY(18px); } }

.enter-fwd > :not(h1), .enter-back > :not(h1) { animation: sube 0.65s var(--ease-motion) both; }
.enter-fwd > :nth-child(3), .enter-back > :nth-child(3) { animation-delay: 0.08s; }
.enter-fwd > :nth-child(4), .enter-back > :nth-child(4) { animation-delay: 0.14s; }
.enter-fwd > :nth-child(n+5), .enter-back > :nth-child(n+5) { animation-delay: 0.2s; }
@keyframes sube { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* ── Tipografía (tamaños del sitio) ─────────────────────────────────────── */
.eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 20px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.eyebrow .q-num { color: var(--orange-light); font-variant-numeric: tabular-nums; font-weight: 800; }
.eyebrow .arrow { color: var(--orange-light); }

/* .agency-hero-title */
.hero, .display {
  margin: 0 0 24px;
  font-weight: 900; font-stretch: var(--w);
  font-size: clamp(38px, 4.8vw, 70px);
  line-height: 1.05; letter-spacing: -0.035em; word-spacing: 0.1em;
  color: #fff;
  overflow-wrap: anywhere;
}
.q-title {
  margin: 0 0 14px;
  font-weight: 900; font-stretch: var(--w);
  font-size: clamp(30px, 3.6vw, 50px);
  line-height: 1.06; letter-spacing: -0.03em; word-spacing: 0.08em;
  text-wrap: balance;
}
/* Titular de la portada a todo lo ancho: el tamaño exacto lo calcula ajustarHero() en app.js.
   Este es solo el respaldo mientras carga la fuente. */
.hero[data-fit] { font-size: clamp(40px, 7.2vw, 150px); line-height: 1.02; margin-bottom: 0.2em; white-space: nowrap; }
.hero[data-fit] .k-mask { padding-bottom: 0.1em; }
/* En pantallas anchas, "Descubre dónde" y "se te escapan" van en la misma línea */
.hero--2l .k-mask.l1,
.hero--2l .k-mask.l2 { display: inline-block; vertical-align: bottom; }

/* .text-orange-glow: naranja sólido */
.hero em, .display em, .q-title em, .text-orange { font-style: normal; color: var(--orange); }
/* Separación entre palabras animadas (cada una va en su máscara) */
.k-wmask + .k-wmask { margin-left: 0.04em; }

/* .agency-hero-desc */
.lead {
  margin: 0 0 32px;
  color: var(--text-soft);
  font-size: clamp(17px, 1.35vw, 20px); font-weight: 400; line-height: 1.55;
  max-width: 560px;
  animation: desenfoque 0.7s var(--ease-motion) 0.2s both;
}
.q-help { margin: 0 0 4px; color: var(--muted); font-size: 18px; max-width: 60ch; animation: desenfoque 0.6s var(--ease-motion) 0.15s both; }
@keyframes desenfoque { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }

/* Titulares con máscara (kinetic-line-mask / kinetic-line-reveal del sitio) */
.k-mask { display: block; overflow: hidden; padding-bottom: 0.08em; }
.k-line { display: block; transform-origin: bottom; animation: revela 0.65s var(--ease-power3) var(--d, 0ms) both; }
.k-wmask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.k-word { display: inline-block; animation: revela 0.65s var(--ease-power3) both; animation-delay: calc(var(--i, 0) * 32ms + 60ms); }
@keyframes revela { from { transform: translateY(105%); opacity: 0.72; } to { transform: none; opacity: 1; } }

/* Ticker de palabras (qtv-ticker del sitio) */
.ticker { display: inline-block; vertical-align: baseline; position: relative; overflow: hidden; height: 1.15em; max-width: 100%; }
.ticker-track { display: flex; flex-direction: column; transition: transform 0.65s var(--ease-qtv); }
.ticker-item { display: flex; align-items: center; height: 1.15em; white-space: nowrap; color: var(--orange); }

/* Sello al entrar a una sección nueva (ds-stamp) */
.stamp { display: inline-block; animation: sello 0.5s var(--ease-motion) both; }
@keyframes sello {
  0%   { opacity: 0; transform: scale(1.6) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(0.95) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* ── Opciones ───────────────────────────────────────────────────────────── */
.options { display: grid; gap: 10px; margin-top: 30px; }
@media (min-width: 640px) { .options.cols-2 { grid-template-columns: 1fr 1fr; } }

.opt {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 62px;
  padding: 14px 18px;
  text-align: left;
  font-size: 20px; font-weight: 500; line-height: 1.22;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s, background-color 0.18s, transform 0.25s var(--ease-btn), box-shadow 0.25s;
}
.opt > * { position: relative; z-index: 1; }
.opt:hover { border-color: rgba(244, 117, 48, 0.55); background: var(--glass-hi); transform: translateY(-1px); }
.opt:active { transform: scale(0.99); }
.opt .key {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  font-size: 13px; font-weight: 800;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}
.opt .opt-label { flex: 1; }
.opt .check { flex-shrink: 0; width: 22px; height: 22px; color: var(--orange-light); opacity: 0; transform: scale(0.6); transition: opacity 0.25s, transform 0.25s var(--ease-motion); }
.opt .check path { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 0.35s var(--ease-motion) 0.05s; }
.opt[aria-checked="true"] {
  border-color: var(--orange);
  background: linear-gradient(95deg, rgba(220, 88, 14, 0.26), rgba(220, 88, 14, 0.06) 70%), var(--glass);
  box-shadow: inset 0 0 0 1px var(--orange), 0 14px 36px -18px rgba(244, 117, 48, 0.8);
  animation: bordeVivo 2.4s ease-in-out infinite;
}
.opt[aria-checked="true"] .key { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 0 14px rgba(244, 117, 48, 0.7); animation: pop 0.35s var(--ease-motion); }
.opt[aria-checked="true"] .check { opacity: 1; transform: none; }
.opt[aria-checked="true"] .check path { stroke-dashoffset: 0; }
@keyframes bordeVivo { 0%, 100% { border-color: var(--orange); } 50% { border-color: var(--orange-light); } }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Brillo que sigue al cursor + barrido de luz al elegir */
.opt::before,
.benefit::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(244, 117, 48, 0.16), transparent 62%);
  opacity: 0; transition: opacity 0.3s;
}
.opt:hover::before,
.benefit:hover::before { opacity: 1; }
.opt.picked { animation: elige 0.42s var(--ease-motion); }
.opt.picked::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.22) 48%, rgba(255, 167, 100, 0.18) 52%, transparent 70%);
  transform: translateX(-110%);
  animation: barrido 0.75s var(--ease-motion) forwards;
}
@keyframes elige { 0% { transform: scale(1); } 35% { transform: scale(0.985); } 100% { transform: scale(1); } }
@keyframes barrido { to { transform: translateX(110%); } }

/* Opción múltiple: casillas cuadradas en vez de letras redondeadas */
.options.multi .opt .key { border-radius: 6px; }
/* Campo "Otro": aparece debajo de las opciones al elegir Otro */
.otro-wrap { margin-top: 14px; animation: sube 0.4s var(--ease-motion) both; }
.otro-wrap[hidden] { display: none; }
.otro-input { font-size: clamp(20px, 2.6vw, 24px); }

/* ── Campos ─────────────────────────────────────────────────────────────── */
.fields { display: grid; gap: 26px; margin-top: 32px; }
.field label {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.opt-tag { font-size: 10px; letter-spacing: 0.12em; color: var(--muted-2); font-weight: 600; }

.input {
  width: 100%;
  padding: 10px 0 12px;
  font-size: clamp(24px, 3.4vw, 30px); font-weight: 500; letter-spacing: -0.01em;
  background: transparent;
  border: 0; border-bottom: 2px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s;
}
.input::placeholder { color: rgba(157, 176, 200, 0.42); }
.input:focus { border-bottom-color: var(--orange); }
.input:focus-visible { outline: none; }
.field.invalid .input { border-bottom-color: var(--bad); }

.phone { display: flex; align-items: stretch; gap: 12px; }
.phone .input { flex: 1; min-width: 0; }
.select-wrap { position: relative; flex-shrink: 0; }
.select {
  height: 100%;
  -webkit-appearance: none; appearance: none;
  padding: 10px 26px 12px 0;
  font-size: clamp(21px, 3vw, 25px); font-weight: 600;
  background: transparent;
  border: 0; border-bottom: 2px solid var(--line-strong);
  border-radius: 0;
  cursor: pointer;
}
.select:focus { outline: none; border-bottom-color: var(--orange); }
.select option { background: var(--navy); color: var(--text); }
.select-wrap::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}

.textarea {
  display: block; width: 100%;
  min-height: 150px; margin-top: 30px;
  padding: 18px;
  font-size: 21px; line-height: 1.45;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea::placeholder { color: rgba(157, 176, 200, 0.45); }
.textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(220, 88, 14, 0.18); }
.ta-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 8px; min-height: 22px; }
.count { font-size: 13px; color: var(--muted-2); font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }

.err { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--bad); }
.err:empty { display: none; }
.ta-meta .err { margin: 0; }

.suggest:empty { display: none; }
.suggest { margin-top: 10px; font-size: 15px; color: var(--muted); }
.suggest button {
  padding: 0; background: none; border: 0;
  color: var(--orange-light); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}

/* Honeypot: fuera de pantalla, invisible para personas y lectores de pantalla. */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.turnstile { margin-top: 18px; }

/* ── Botones (agency-btn-primary / agency-btn-glass del sitio) ─────────── */
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  font-size: 16px; font-weight: 700; letter-spacing: 0.018em; word-spacing: 0.12em;
  text-decoration: none;
  border-radius: 9999px; border: 1px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(var(--bx, 0px), calc(var(--by, 0px) + var(--lift, 0px)), 0);
  transition: transform 0.35s var(--ease-power3), background-color 0.25s var(--ease-btn), box-shadow 0.25s var(--ease-btn), border-color 0.25s, color 0.25s;
}
.btn > * { transform: translate3d(calc(var(--bx, 0px) * 0.2), calc(var(--by, 0px) * 0.2), 0); transition: transform 0.35s var(--ease-power3); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary {
  color: #fff;
  background: var(--orange);
  box-shadow: 0 10px 28px -4px rgba(220, 88, 14, 0.45), 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover { color: #fff; background: var(--orange-light); --lift: -2px; box-shadow: 0 16px 36px -4px rgba(220, 88, 14, 0.6), 0 6px 16px rgba(0, 0, 0, 0.3); }
.btn-primary:hover .arrow-icon { transform: translate3d(calc(var(--bx, 0px) * 0.2 + 3px), calc(var(--by, 0px) * 0.2), 0); }
.btn-primary:active { --lift: 0px; }
.btn-primary[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
.btn-ghost {
  color: #fff; font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.22);
  padding: 0 22px;
}
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.5); --lift: -2px; }
.btn-lg { min-height: 58px; padding: 0 32px; font-size: 17px; }
.btn-link {
  background: none; border: 0; padding: 6px 2px; min-height: 0;
  color: var(--muted); font-weight: 600; font-size: 16px; text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { color: var(--text); }

.hint { font-size: 14px; color: var(--muted-2); }
kbd {
  display: inline-block; padding: 1px 7px;
  font: inherit; font-size: 12px; font-weight: 700;
  color: var(--text-soft);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}
@media (pointer: coarse), (hover: none), (max-width: 560px) { .hint { display: none; } }

/* ── Portada ────────────────────────────────────────────────────────────── */
.intro .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.intro .chips li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
}
.intro .chips svg { width: 15px; height: 15px; color: var(--orange-light); }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.privacy { margin: 18px 0 0; font-size: 14px; color: var(--muted-2); max-width: 60ch; }

.benefits { display: grid; gap: 12px; margin-top: 52px; }
@media (min-width: 720px) { .benefits { grid-template-columns: repeat(3, 1fr); } }
.benefit {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 20px 20px 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s var(--ease-btn);
}
.benefit > * { position: relative; z-index: 1; }
.benefit:hover { border-color: rgba(244, 117, 48, 0.4); transform: translateY(-2px); }
.benefit .ico {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 14px;
  color: var(--orange-light);
  background: rgba(220, 88, 14, 0.12);
  border: 1px solid rgba(220, 88, 14, 0.35);
  border-radius: 10px;
}
.benefit .ico svg { width: 20px; height: 20px; }
.benefit h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; word-spacing: 0.08em; }
.benefit p { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.45; }

/* Armonía de la portada: todo escala con el tamaño del titular.
   --h lo fija ajustarHero() en app.js (115px en 1440, 49px en un celular de 390).
   Proporciones como en el hero de qtvalga.com (titular : texto ≈ 5 : 1). */
.intro { --h: clamp(40px, 7.2vw, 150px); }
.intro .eyebrow { font-size: clamp(12px, calc(var(--h) * 0.11), 15px); margin-bottom: clamp(18px, calc(var(--h) * 0.26), 32px); }
.intro .lead { font-size: clamp(18px, calc(var(--h) * 0.21), 27px); max-width: 34em; margin-bottom: clamp(26px, calc(var(--h) * 0.34), 44px); }
.intro .chips { gap: clamp(8px, calc(var(--h) * 0.08), 12px); margin-bottom: clamp(28px, calc(var(--h) * 0.34), 44px); }
.intro .chips li { font-size: clamp(12px, calc(var(--h) * 0.125), 16px); padding: 0.7em 1.2em; gap: 0.65em; }
.intro .chips svg { width: 1.25em; height: 1.25em; }
.intro .cta-row { gap: 0.9em 1.2em; }
.intro .btn-lg { font-size: clamp(17px, calc(var(--h) * 0.165), 22px); min-height: clamp(56px, calc(var(--h) * 0.6), 76px); padding: 0 1.75em; gap: 0.6em; }
.intro .btn-lg svg { width: 1.15em; height: 1.15em; }
.intro .hint { font-size: clamp(14px, calc(var(--h) * 0.12), 16px); }
.intro .privacy { font-size: clamp(14px, calc(var(--h) * 0.125), 16px); max-width: 44em; margin-top: clamp(16px, calc(var(--h) * 0.18), 24px); }
.intro .benefits { margin-top: clamp(44px, calc(var(--h) * 0.6), 80px); gap: clamp(12px, calc(var(--h) * 0.14), 20px); }
.intro .benefit { padding: clamp(20px, calc(var(--h) * 0.22), 30px); }
.intro .benefit .ico { width: clamp(38px, calc(var(--h) * 0.38), 48px); height: clamp(38px, calc(var(--h) * 0.38), 48px); margin-bottom: clamp(14px, calc(var(--h) * 0.14), 18px); }
.intro .benefit .ico svg { width: 50%; height: 50%; }
.intro .benefit h2 { font-size: clamp(22px, calc(var(--h) * 0.22), 30px); }
.intro .benefit p { font-size: clamp(16px, calc(var(--h) * 0.15), 19px); }

/* ── Enviando ───────────────────────────────────────────────────────────── */
.sending { text-align: center; max-width: 540px; }
.scanner { position: relative; width: 132px; height: 132px; margin: 0 auto 30px; }
.scanner svg { width: 100%; height: 100%; overflow: visible; }
.scanner .ring-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 2; }
.scanner .ring-arc { fill: none; stroke: url(#arcGrad); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 90 400; transform-origin: 50% 50%; animation: gira 1.3s linear infinite; }
.scanner .ring-arc.b { stroke-width: 2; stroke-dasharray: 40 400; animation-duration: 2.1s; animation-direction: reverse; opacity: 0.6; }
@keyframes gira { to { transform: rotate(360deg); } }
.pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 30px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  color: var(--text); text-shadow: 0 0 18px rgba(244, 117, 48, 0.7);
}
.checks { display: grid; gap: 10px; margin: 26px auto 0; padding: 0; list-style: none; text-align: left; max-width: 360px; }
.checks li {
  display: flex; align-items: center; gap: 12px;
  font-size: 19px; color: var(--muted);
  opacity: 0;
  animation: aparece 0.4s var(--ease-motion) forwards;
  animation-delay: calc(var(--d) * 0.6s + 0.2s);
}
.checks .tick {
  position: relative; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  animation: tickOn 0.3s var(--ease-motion) forwards;
  animation-delay: calc(var(--d) * 0.6s + 0.65s);
}
.checks .tick::after {
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  animation: tickMark 0.3s var(--ease-motion) forwards;
  animation-delay: calc(var(--d) * 0.6s + 0.75s);
}
@keyframes aparece { to { opacity: 1; } }
@keyframes tickOn { to { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 14px rgba(220, 88, 14, 0.7); } }
@keyframes tickMark { to { transform: rotate(45deg) scale(1); } }

/* ── Gracias ────────────────────────────────────────────────────────────── */
.success { position: relative; width: 92px; height: 92px; margin: 0 0 28px; }
.success svg { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.success-circle {
  fill: rgba(220, 88, 14, 0.14); stroke: var(--orange-light); stroke-width: 3;
  stroke-dasharray: 214; stroke-dashoffset: 214;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  filter: drop-shadow(0 0 10px rgba(244, 117, 48, 0.6));
  animation: dibuja 0.75s var(--ease-motion) 0.15s forwards;
}
.success-check {
  fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: dibuja 0.45s var(--ease-motion) 0.75s forwards;
}
@keyframes dibuja { to { stroke-dashoffset: 0; } }
.success-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--orange-light); opacity: 0;
  animation: anillo 1.6s ease-out 0.85s 2;
}
.success-ring.r2 { animation-delay: 1.25s; }
@keyframes anillo { 0% { transform: scale(0.9); opacity: 0.7; } 100% { transform: scale(2.3); opacity: 0; } }
.sparks i {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--orange-glow); box-shadow: 0 0 8px var(--orange-light);
  opacity: 0;
  animation: chispa var(--t) ease-out 0.85s forwards;
}
.sparks i:nth-child(3n) { background: #fff; width: 4px; height: 4px; margin: -2px 0 0 -2px; }
@keyframes chispa {
  0% { opacity: 1; transform: rotate(var(--a)) translateX(12px) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--r)) scale(0.3); }
}

.result .lead strong { color: var(--text); font-weight: 700; }
.panel {
  margin-top: 38px;
  padding: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.025em; word-spacing: 0.08em; }

.steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 0 0 20px 46px; counter-increment: s; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: -2px;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  font-size: 14px; font-weight: 800;
  color: var(--orange-light);
  border: 1px solid rgba(244, 117, 48, 0.5);
  border-radius: 50%;
  background: rgba(220, 88, 14, 0.1);
}
.steps li::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 2px; width: 1px; background: var(--line-strong); }
.steps li:last-child::after { display: none; }
.steps strong { display: block; font-size: 19px; font-weight: 700; }
.steps span { display: block; font-size: 16px; color: var(--muted); }

.video {
  position: relative; margin-top: 30px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line);
  background: var(--navy);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 10px;
  color: var(--muted); font-size: 16px; text-align: center; padding: 20px;
  background:
    radial-gradient(circle at 50% 45%, rgba(220, 88, 14, 0.22), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 12px, transparent 12px 24px);
}
.video-placeholder .play {
  display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--orange); color: #fff;
  box-shadow: 0 0 40px rgba(220, 88, 14, 0.6);
}
.video-placeholder .play svg { width: 24px; height: 24px; margin-left: 3px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 22px; padding: 14px 16px;
  font-size: 16px; color: var(--text-soft);
  background: rgba(245, 184, 61, 0.08);
  border: 1px solid rgba(245, 184, 61, 0.35);
  border-radius: var(--radius);
}
.notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--warn); }
.notice .btn-link { color: var(--warn); font-size: 16px; padding: 0; }

.result-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 30px; }

.payload { margin-top: 26px; }
.payload summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.payload pre {
  margin: 10px 0 0; padding: 14px;
  max-height: 320px; overflow: auto;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: pre-wrap; word-break: break-word;
}

/* ── Pantallas pequeñas ─────────────────────────────────────────────────── */
@media (max-width: 560px) {
  :root { --gutter: 14px; --header-space: 92px; }
  body { font-size: 18px; }
  .top { padding-top: calc(10px + env(safe-area-inset-top)); }
  .top-inner { height: 56px; padding: 0 16px 0 18px; }
  .brand img { height: 24px; }
  .top-tag { display: none; }
  .progress { left: 18px; right: 18px; }
  .app { align-items: flex-start; padding-left: 16px; padding-right: 16px; }
  .display { font-size: clamp(32px, 8vw, 44px); margin-bottom: 18px; }
  .hero[data-fit] { font-size: clamp(34px, 11vw, 64px); }
  .opt { font-size: 19px; min-height: 58px; padding: 12px 14px; }
  .nav { margin-top: 28px; }
  .nav .btn-primary { flex: 1; }
  .panel { padding: 18px; }
  .btn-lg { width: 100%; }
}

/* ── Reducir movimiento ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .bg-noise { animation: none !important; }
  .checks li { opacity: 1; }
  .sparks, .success-ring, .progress-fill::after { display: none; }
}
