/* ==========================================================================
   Roomie · Legacy Test Landing
   Fuente de verdad: referencias/figma-legacy-test/figma-export.css.
   Medidas tomadas del frame de 1920 px (contenido de 1184 px). Layout con
   Grid/Flexbox; no se copian las posiciones absolutas del export.
   Componentes adaptados de frontend/erp-test/ (copia independiente).
   ========================================================================== */

:root {
  /* Paleta (nombres del export de Figma) */
  --cod-gray: #0C0C0C;          /* fondo principal */
  --spring-green: #00E879;      /* verde principal */
  --racing-green: #07100B;      /* texto sobre verde */
  --racing-green-2: #132019;    /* opción seleccionada / texto sobre gris claro */
  --alabaster: #FAFAFA;         /* texto principal */
  --pumice: #C6CCC9;
  --conch: #D7DDDA;
  --powder-ash: #B8C0BC;
  --mantle: #949E98;
  --pewter: #9CA6A1;
  --pewter-2: #9AA39E;
  --gunsmoke: #7F8A84;
  --xanadu: #717D76;
  --xanadu-2: #7C8881;
  --xanadu-3: #78837D;
  --label: #76817B;
  --corduroy: #68736D;
  --placeholder: #5D6862;
  --edward: #AEB6B2;
  --tasman: #D5DDD7;
  --emperor: #555555;
  --heavy-metal: #121513;       /* panel oscuro */
  --log-cabin: #101310;         /* opción / KPI */
  --input-bg: #0F1210;
  --track: #2B312D;
  --track-2: #252C28;
  --line: #2A302C;
  --line-2: #303833;
  --line-3: #313833;
  --line-4: #3A443E;
  --section-line: #1E231F;
  --rule: rgba(226, 231, 233, 0.45);   /* Line 6-8 (#E2E7E9, 0.5 px) */
  --lead-band: #B9C2C4;         /* Rectangle 1: banda del Lead Gate */
  --form-panel: #CDCFD0;
  --malachite: #14EA73;
  --lime: #B7FF35;
  --warning: #F7C948;

  /* Tipografía. Neue Haas Grotesk Display Pro no está disponible: Inter temporal. */
  --font-display: "Neue Haas Grotesk Display Pro", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-arial: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-courier: "Courier New", Courier, ui-monospace, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1184px;
  --gutter: clamp(16px, 4vw, 28px);
  --nav-h: 74px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  background: var(--cod-gray);
  color: var(--alabaster);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input { font: inherit; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: 9px;
  background: var(--spring-green); color: var(--racing-green); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--spring-green); outline-offset: 3px; }

/* Separadores Line 5-8 del Figma (1016 px, centrados) */
.rule {
  width: min(1016px, calc(100% - 2 * var(--gutter)));
  height: 0;
  margin: 0 auto;
  border: 0;
  border-top: 1px solid var(--rule);
}
.rule-accent { border-top-color: rgba(0, 232, 121, 0.7); margin-top: 32px; }

/* ---------- Tipografía compartida ---------- */
.eyebrow {
  margin-bottom: 11px;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700; line-height: 13px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--spring-green);
}
.eyebrow-courier { font-family: var(--font-courier); }
.eyebrow-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 42px); font-weight: 700; line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--alabaster);
}
.h2-arial { font-family: var(--font-arial); letter-spacing: -0.04em; }
.h2-calc { max-width: 938px; }

.micro {
  font-family: var(--font-mono);
  font-size: 12px; line-height: 16px;
  color: var(--gunsmoke);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700; line-height: 16px; letter-spacing: 0.2px;
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, opacity .15s ease;
}
.btn-arial { font-family: var(--font-arial); line-height: 15px; min-height: 45px; }
.btn-primary { background: var(--spring-green); border-color: var(--spring-green); color: var(--racing-green); }
.btn-primary:hover:not(:disabled) { background: #3DF59A; border-color: #3DF59A; transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--line-3); color: var(--alabaster); }
.btn-outline:hover:not(:disabled) { border-color: var(--spring-green); }
.btn-pill { min-height: 38px; padding: 10px 12px; border-radius: 999px; }
.btn:disabled { cursor: not-allowed; opacity: 0.45; }

/* Marcador de componentes pendientes de lógica/integración */
.pending-badge {
  display: inline-flex; align-items: center; flex: none;
  padding: 3px 7px;
  border: 1px solid rgba(247, 201, 72, 0.6);
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.12);
  font-family: var(--font-courier);
  font-size: 10px; font-weight: 700; letter-spacing: 1px; line-height: 12px;
  color: var(--warning);
}
/* Snapshot completo (score + drivers + 4 indicadores): "DIAGNÓSTICO PRELIMINAR". */
.pending-badge.is-ready { border-color: rgba(0, 232, 121, 0.55); background: rgba(0, 232, 121, 0.1); color: var(--spring-green); }
.pending-note {
  margin-top: 12px;
  max-width: 840px;
  font-family: var(--font-mono); font-size: 12px; line-height: 18px;
  color: var(--powder-ash);
}
.pending-note strong { color: var(--alabaster); }
.placeholder { color: var(--gunsmoke); }

/* ---------- Paneles ---------- */
.panel { border-radius: 16px; }
.panel-dark { background: var(--heavy-metal); }
.panel-bordered { border: 1px solid var(--line); }

/* ---------- Navegación ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--cod-gray);
  transition: background-color .2s ease;
}
/* Con JS: transparente arriba (la foto del hero continúa detrás, como en Figma) y
   sólido en cuanto hay scroll (app.js agrega .is-scrolled). Sin JS queda sólido. */
.js .nav:not(.is-scrolled) { background: transparent; }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo img { width: 130px; height: auto; }
.navlinks { display: flex; align-items: center; gap: 12px; }
.navlinks a:not(.btn) {
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px; line-height: 14px;
  color: var(--edward);
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.navlinks a:not(.btn):hover { color: var(--alabaster); background: rgba(255, 255, 255, 0.06); }

/* ---------- Hero ---------- */
/* Hero de una sola columna alineada a la izquierda (80% del contenedor en escritorio:
   ≈ 947 px a 1184 px, suficiente para que el párrafo quede en dos líneas). */
.hero { padding: clamp(40px, 5vw, 72px) 0 clamp(48px, 6vw, 86px); }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; max-width: 80%; }
.hero-copy .eyebrow { margin-bottom: 0; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.3vw, 64px); font-weight: 700; line-height: 0.985;
  letter-spacing: -0.035em;
  color: var(--alabaster);
}
.hero-lead {
  padding-top: 9px;
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.3vw, 17px); line-height: 18px;
  color: var(--pumice);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 14px; }
.hero-actions .btn-outline { background: rgba(12, 12, 12, 0.35); }

.bar i, .progress i {
  display: block; height: 100%;
  width: calc(var(--bar-value, 0) * 1%);
  border-radius: inherit;
  background: var(--spring-green);
  transition: width .4s ease;
}

/* ---------- Secciones ---------- */
.section { padding: 71px 0 72px; }

/* ---------- Problema / contexto ---------- */
/* Una sola card centrada, de hasta 800 px para que las viñetas no queden demasiado largas. */
.pressure-grid {
  display: grid; grid-template-columns: minmax(0, 800px); justify-content: center;
  gap: 18px;
  margin-top: 32px;
  align-items: stretch;
}
.pressure-panel { padding: 24px; }
.panel-title { margin-bottom: 18px; font-size: 22px; font-weight: 700; line-height: 26px; }
.bullets { display: flex; flex-direction: column; gap: 9px; }
.bullets li {
  position: relative;
  padding: 2px 0 2px 19px;
  font-family: var(--font-mono); font-size: 12px; line-height: 20px;
  color: var(--conch);
}
.bullets li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--spring-green);
}

/* ---------- Quick Test ---------- */
.test-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 18px;
  margin-top: 32px;
  align-items: stretch;
}
.steps {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
}
.step {
  display: block;
  width: 100%;
  min-height: 44px; /* 10 pasos (Figma: 51 px para 7): la lista iguala la altura del panel */
  padding: 8px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-display); font-size: 12px; line-height: 14px;
  color: #8C9791; /* Xanadu #717D76 del Figma, aclarado por legibilidad (como en ERP Test) */
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.step-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.step-num { margin-right: 6px; font-family: var(--font-courier); font-weight: 700; color: var(--spring-green); }
.step:hover:not(:disabled) { color: var(--conch); }
.step:disabled { cursor: default; opacity: 0.85; }
.step.is-answered { color: var(--edward); }
.step.is-current { background: #141A16; border-left-color: var(--spring-green); color: #FFFFFF; }

.quiz-panel { min-height: 390px; padding: 24px; }
.progressmeta {
  display: flex; justify-content: space-between; gap: 12px;
  margin-bottom: 9px;
  font-size: 10px; font-weight: 700; line-height: 12px;
  color: var(--xanadu-3);
}
.progress-percent { font-family: var(--font-courier); line-height: 11px; }
.progress { height: 6px; border-radius: 999px; background: var(--track-2); overflow: hidden; }
.quiz-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.qtitle {
  float: left; width: 100%;
  max-width: 820px;
  padding: 0;
  margin: 18px 0 1px;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px); font-weight: 400; line-height: 1.13;
  color: var(--alabaster);
}
.qtitle:focus { outline: none; }
.options { clear: both; display: flex; flex-direction: column; gap: 10px; padding-top: 9px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.option-body {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 50px;
  padding: 15px 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--log-cabin);
  font-size: 16px; line-height: 18px;
  color: var(--alabaster);
  transition: border-color .15s ease, background-color .15s ease;
}
.option-dot {
  flex: none;
  width: 16px; height: 16px;
  border: 1px solid var(--corduroy);
  border-radius: 50%;
  transition: border .15s ease;
}
.option:hover .option-body { border-color: rgba(0, 232, 121, 0.55); }
.option input:focus-visible + .option-body { outline: 2px solid var(--spring-green); outline-offset: 2px; }
.option input:checked + .option-body { background: var(--racing-green-2); border-color: var(--spring-green); }
.option input:checked + .option-body .option-dot { border: 5px solid var(--spring-green); }

.quiz-error {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--log-cabin);
  font-size: 13px;
  color: #FF6B57;
}
.quiz-error[hidden] { display: none; }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 15px; }
.quiz-actions .btn { min-width: 125px; }
.quiz-actions .btn-outline:disabled { opacity: 0.5; }

/* ---------- Readiness Snapshot ---------- */
.score-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  margin-top: 32px;
  align-items: start;
}
.scorebox {
  display: flex; flex-direction: column; align-items: center;
  min-height: 312px;
  padding: 27px 28px 28px;
  border-radius: 18px;
  background: var(--alabaster);
  color: #111111;
  text-align: center;
}
.scorebox-eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; line-height: 13px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--emperor);
}
/* Legacy Risk Score: arco de exposición 0-100 (no es progreso positivo).
   Capas (de arriba a abajo): separadores en 25/50/75 · velo sobre el tramo no alcanzado ·
   bandas oficiales (0-24 verde, 25-49 amarillo, 50-74 naranja, 75-100 rojo; 45° cada una).
   --gauge-deg = score × 1.8deg; lo fija app.js (renderScore). */
@property --gauge-deg { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
.gauge {
  --gauge-deg: 0deg;
  position: relative;
  width: 205px; height: 105px;
  margin-top: 14px;
  border-radius: 205px 205px 0 0;
  background:
    conic-gradient(from -90deg at 50% 100%,
      transparent 0deg 44.25deg, var(--alabaster) 44.25deg 45.75deg,
      transparent 45.75deg 89.25deg, var(--alabaster) 89.25deg 90.75deg,
      transparent 90.75deg 134.25deg, var(--alabaster) 134.25deg 135.75deg,
      transparent 135.75deg),
    conic-gradient(from -90deg at 50% 100%,
      transparent 0deg var(--gauge-deg), rgba(250, 250, 250, 0.74) var(--gauge-deg) 180deg, transparent 180deg),
    conic-gradient(from -90deg at 50% 100%,
      #00E879 0deg 45deg, #F7C948 45deg 90deg, #FF9F1A 90deg 135deg, #FF5252 135deg 180deg, transparent 180deg);
}
.gauge::after {
  content: ""; position: absolute; left: 25px; right: 25px; bottom: 0; height: 75px;
  border-radius: 160px 160px 0 0;
  background: var(--alabaster);
}
/* Sin las 10 respuestas: escala completa desaturada (estado propio del score, no el del Snapshot). */
.scorebox[data-score-state="pending"] .gauge { --gauge-deg: 180deg; filter: grayscale(1); opacity: 0.35; }
/* Animación sutil del relleno sólo entre resultados (prefers-reduced-motion la desactiva). */
.scorebox[data-score-state="ready"] .gauge { transition: --gauge-deg .6s ease; }
/* Composición propia de Legacy: el puntaje queda debajo del arco. */
.gauge-text { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: -11px; position: relative; }
.gauge-text b { font-family: var(--font-mono); font-size: 38px; font-weight: 700; line-height: 50px; color: #111111; white-space: nowrap; }
.gauge-text b small { margin-left: 1px; font-size: 18px; font-weight: 700; line-height: 1; color: var(--emperor); } /* sin alterar la altura de la línea */
/* Nivel: tonos oscuros de cada banda (≥ 4.5:1 sobre la tarjeta). El nombre siempre va en texto. */
.gauge-text span { font-family: var(--font-mono); font-size: 11px; font-weight: 700; line-height: 15px; letter-spacing: 1px; color: #8A5A00; text-transform: uppercase; }
.scorebox[data-level="controlado"] .gauge-text span { color: #0B7A43; }
.scorebox[data-level="friccion"] .gauge-text span { color: #8A5A00; }
.scorebox[data-level="exposicion"] .gauge-text span { color: #A84300; }
.scorebox[data-level="critica"] .gauge-text span { color: #B3261E; }
/* Anuncio para lectores de pantalla (sin espacio visual). */
.score-sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.scorebox { position: relative; }
/* min-height = 5 líneas (texto más largo por nivel): evita saltos de layout al pasar de pendiente a resultado. */
.scorebox-copy { max-width: 240px; min-height: calc(23px * 5); margin-top: 5px; font-size: 16px; line-height: 23px; color: var(--emperor); }

.drivers-panel { padding: 23px 24px 30px; }
.drivers li + li { border-top: 1px solid var(--section-line); }
.driver {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 16px 0;
}
.driver-num { font-family: var(--font-courier); font-size: 11px; font-weight: 700; line-height: 12px; color: var(--spring-green); padding-top: 3px; }
.driver strong { display: block; font-size: 16px; font-weight: 700; line-height: 19px; color: var(--alabaster); }
.driver p { margin-top: 4px; font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: var(--mantle); }
.driver.is-placeholder strong { color: var(--mantle); }
.driver p { overflow-wrap: anywhere; }
/* Severidad dentro de la descripción: sólo visible cuando la insignia se oculta (≤ 640px);
   en escritorio queda sólo para lectores de pantalla (la insignia es aria-hidden). */
.driver-sev {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* Insignia de severidad de los drivers calculados (PDF: B fricción moderada, C problema relevante,
   D exposición crítica). Contraste del texto sobre el panel: 11.73 / 10.78 / 8.03 : 1. */
.driver[data-severity] .badge { border-color: currentColor; white-space: nowrap; text-transform: uppercase; }
.driver[data-severity="B"] .badge { color: #F7C948; }
.driver[data-severity="C"] .badge { color: #FFB86B; }
.driver[data-severity="D"] .badge { color: #FF8A7A; }
/* Fila sin foco relevante: discreta y sin insignia, para no parecer un driver real. */
.driver.is-empty strong { color: var(--mantle); }
.driver.is-empty .badge { visibility: hidden; }
/* Fila 03 reservada (no calculada): más discreta que los drivers calculados. */
.driver.is-reserved strong { color: var(--edward); }
.driver.is-reserved .badge { border-style: dashed; }
/* Alertas prioritarias: texto explícito, 8.03:1 sobre el panel. */
.drivers-panel { position: relative; }
.drivers-alert {
  margin-top: 2px; padding-top: 14px;
  border-top: 1px solid var(--section-line);
  font-family: var(--font-mono); font-size: 12px; line-height: 18px;
  color: #FF8A7A;
}
.drivers-alert strong { font-weight: 700; }
.drivers-alert[hidden] { display: none; }
.badge {
  padding: 7px 10px;
  border: 1px solid var(--line-4);
  border-radius: 999px;
  font-family: var(--font-courier); font-size: 10px; line-height: 11px;
  color: var(--pewter);
}

.indicators { margin-top: 18px; padding: 30px 24px 24px; }
.indicators .eyebrow { margin-bottom: 22px; }
.bars { display: flex; flex-direction: column; gap: 20px; }
.bars li { position: relative; } /* contexto del texto accesible [data-dimension-sr] */
/* El valor nunca se parte y reserva el ancho de "100%" también en pendiente ("—"),
   para que el nombre ocupe las mismas líneas antes y después del resultado (320px). */
.bars .barhead b { flex: none; min-width: 4.2ch; white-space: nowrap; text-align: right; }
.barhead { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bars .barhead span, .bars .barhead b { font-size: 13px; font-weight: 700; line-height: 16px; }
.bar { height: 9px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar i { background: linear-gradient(90deg, #00E879 0%, #B7FF35 100%); }

.cta-box {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: center;
  margin-top: 18px;
  padding: 52px 34px 34px;
  border: 1px solid #24412F;
  border-radius: 20px;
  background: linear-gradient(99.66deg, #132019 0%, #0D0F0E 100%);
}
.cta-box .eyebrow { margin-bottom: 9px; }
.cta-box h3 {
  max-width: 612px;
  padding-bottom: 9px;
  font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; line-height: 1.2; letter-spacing: 0.03em;
  color: var(--alabaster);
}
.cta-box .placeholder-text { color: var(--mantle); }
.cta-box-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- ROI / TCO Calculator ---------- */
.section-calc { padding-bottom: 84px; }
.calc-lead {
  max-width: 840px;
  padding-top: 7px;
  font-family: var(--font-arial); font-size: 16px; line-height: 27px;
  color: var(--powder-ash);
}
.tco-grid {
  display: grid; grid-template-columns: minmax(0, 641fr) minmax(0, 525fr);
  gap: 18px;
  margin-top: 21px;
  align-items: stretch;
}
/* Contenido centrado en vertical: la tarjeta iguala la altura de las dos tarjetas apiladas. */
.tco-panel { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 23px 24px 24px; }
.tco-panel .eyebrow { margin-bottom: 0; }
.big-number {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.4vw, 58px); font-weight: 700; line-height: 69px;
}
.calc-amount { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Slider nativo: clases propias (no se reutiliza .bar, compartida con el Snapshot).
   Track con el mismo degradado de las barras; --calc-fill lo actualiza calculator.js. */
.calc-slider {
  --calc-fill: 0%;
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: pan-y; /* arrastre horizontal sin bloquear el scroll vertical */
}
.calc-slider::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00E879 0%, #B7FF35 var(--calc-fill), var(--track) var(--calc-fill));
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px; height: 24px;
  margin-top: -7.5px;
  border: 3px solid var(--spring-green);
  border-radius: 50%;
  background: var(--alabaster);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.calc-slider::-moz-range-track { height: 9px; border-radius: 999px; background: var(--track); }
.calc-slider::-moz-range-progress { height: 9px; border-radius: 999px; background: linear-gradient(90deg, #00E879 0%, #B7FF35 100%); }
.calc-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border: 3px solid var(--spring-green);
  border-radius: 50%;
  background: var(--alabaster);
}
.calc-slider:focus { outline: none; }
.calc-slider:focus-visible { outline: 2px solid var(--spring-green); outline-offset: 4px; border-radius: 6px; }
.calc-range {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px;
  color: #9AA39E;
  font-variant-numeric: tabular-nums;
}
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 11px; }
/* Dos resultados: apilados a la derecha en escritorio, misma altura entre sí. */
.calc-kpis { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; }
.kpi {
  display: flex; flex-direction: column; gap: 9px;
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--track);
  border-radius: 13px;
  background: var(--log-cabin);
}
.kpi small {
  font-family: var(--font-courier); font-size: 10px; font-weight: 700; line-height: 11px;
  text-transform: uppercase;
  color: var(--xanadu-2);
}
.kpi small.kpi-label-mono { font-family: var(--font-mono); }
/* Montos en una sola línea y con cifras de ancho fijo (no "bailan" al arrastrar el slider). */
.kpi b { font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; line-height: 34px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-note { font-family: var(--font-mono); font-size: 11px; line-height: 16px; color: #9AA39E; }
/* Lectores de pantalla: anuncio del ahorro sin ocupar espacio visual. */
.calc-sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.calc-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding-top: 9px; margin-top: 12px; }

/* ---------- Lead Gate (banda gris claro: Rectangle 1 del Figma) ---------- */
.section-lead { border-top: 1px solid var(--section-line); background: var(--lead-band); }
/* Figma pinta este H2 en #FAFAFA sobre #B9C2C4 (contraste ≈1.7:1). Se usa el verde
   oscuro del eyebrow para que sea legible; ver notas de la etapa. */
.h2-dark { color: var(--racing-green-2); }
.lead-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
  align-items: stretch;
}
.form-panel {
  padding: 24px 24px 26px;
  background: var(--form-panel);
  box-shadow: -101px 125px 64px rgba(0, 0, 0, 0.01), -57px 70px 54px rgba(0, 0, 0, 0.05), -25px 31px 40px rgba(0, 0, 0, 0.09), -6px 8px 22px rgba(0, 0, 0, 0.1);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 10px; font-weight: 700; line-height: 12px; color: var(--label); }
.field input {
  width: 100%;
  min-height: 46px;
  padding: 13px 14px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--input-bg);
  font-family: var(--font-arial); font-size: 16px; line-height: 18px;
  color: var(--alabaster);
}
.field input::placeholder { color: var(--placeholder); }
.field input:focus { outline: none; border-color: var(--spring-green); box-shadow: 0 0 0 3px rgba(0, 232, 121, 0.22); }
.field input[aria-invalid="true"] { border-color: #C62828; }
.field-error:empty { display: none; }
.field-error { font-size: 11px; font-weight: 700; line-height: 14px; color: #B3261E; }

/* Campo trampa anti-bots: fuera de pantalla (no display:none, que algunos bots omiten) */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Consentimiento (aviso de privacidad) sobre el panel claro del formulario */
.field-check { margin-top: 4px; }
.field .check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; font-weight: 400; line-height: 17px;
  color: #2B312D;
  cursor: pointer;
}
.field .check input {
  flex: none;
  width: 18px; height: 18px; min-height: 0;
  margin: 0; padding: 0;
  accent-color: var(--racing-green);
  cursor: pointer;
}
.field .check input:focus-visible { outline: 2px solid var(--racing-green); outline-offset: 2px; box-shadow: none; }
.check a { color: var(--racing-green); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* Título, descripción y CTA agrupados y centrados en vertical dentro de la altura de la card. */
.recommendation-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px 25px 24px;
  box-shadow: 114px 217px 98px rgba(0, 0, 0, 0.01), 64px 122px 83px rgba(0, 0, 0, 0.05), 29px 54px 61px rgba(0, 0, 0, 0.09), 7px 14px 34px rgba(0, 0, 0, 0.1);
}
.recommendation {
  font-size: clamp(22px, 2.3vw, 28px); font-weight: 700; line-height: 1.21;
  color: #FFFFFF;
}
.recommendation-lead {
  max-width: 471px;
  padding: 16px 0 18px;
  font-size: 16px; line-height: 27px; letter-spacing: 0.03em;
  color: var(--powder-ash);
}
/* CTA centrado horizontalmente en el panel (266 px de ancho), a continuación de la descripción.
   Separación de 28 px con el último texto: 18 px de la descripción o de la alerta + 10 px aquí. */
.recommendation-panel .drivers-alert { margin-bottom: 18px; }
.form-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
/* Sin descripción visible (estado pendiente): misma separación de 28 px entre el título y el CTA. */
.recommendation-lead[hidden] ~ .form-actions { margin-top: 28px; }
.form-actions .btn { min-width: 266px; }
.form-status { min-height: 18px; max-width: 420px; font-size: 13px; line-height: 18px; color: var(--powder-ash); text-align: right; }
.form-status.is-error { color: #FF8A7A; }
.form-actions .btn[aria-busy="true"] { cursor: progress; opacity: 0.7; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--section-line); background: var(--cod-gray); }
.footer-inner {
  display: grid; grid-template-columns: minmax(0, 405px) minmax(0, 721px);
  justify-content: space-between; gap: 32px;
  padding-top: 48px; padding-bottom: 40px;
}
.footer-brand { display: flex; flex-direction: column; gap: 18px; }
.footer-logo img { width: 142px; height: auto; }
.footer-brand p { max-width: 230px; font-size: 14.1px; line-height: 23px; color: #9BA69E; }
.footer-contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 28px; align-content: start; }
.contact {
  display: flex; align-items: flex-start; gap: 12px;
  min-width: 0;
  text-decoration: none;
  transition: transform .2s ease;
}
.contact:hover { transform: translateY(-1px); }
.contact:hover span:last-child { color: #FFFFFF; }
.contact-icon {
  display: flex; align-items: center; justify-content: center; flex: 0 0 34px;
  width: 34px; height: 34px;
  border: 1px solid rgba(20, 234, 115, 0.24);
  border-radius: 10px;
  background: rgba(20, 234, 115, 0.055);
  font-family: "Inter", Arial, sans-serif; font-size: 10.9px; font-weight: 800; line-height: 17px; letter-spacing: 0.435px;
  color: var(--malachite);
}
.contact span:last-child {
  min-width: 0; padding-top: 6px;
  font-size: 14.1px; line-height: 22px;
  color: var(--tasman);
  overflow-wrap: anywhere;
}
.footer-tagline {
  padding: 20px 0 44px;
  border-top: 1px solid var(--section-line);
  font-size: 11px; line-height: 12px;
  color: #657069;
}

/* ---------- Fondos de la landing (export de Figma) ----------
   Posiciones del frame de 1920 px, relativas al borde superior del nav:
   - legacy-test-hero-background (pexels-insaanustudio, 1921×1171): y = -108 → 1062,
     detrás de nav, Hero y parte de Problema/Contexto.
   - legacy-test-background (pexels-googledeepmind rotada 90°, 1920×3244): y = 57 → 3301,
     detrás de Problema → inicio de la Calculadora.
   Ambas fotos son opacas; la del hero va encima y se funde hacia abajo con mask-image.
   <main> se extiende bajo el nav (margen negativo) para que la foto quede detrás. */
body > main {
  --hero-bg-h: 55.34vw;     /* 1062.5 / 1920 */
  --texture-top: 2.99vw;    /* 57.5 / 1920 */
  --texture-h: 168.96vw;    /* 3244 / 1920 */
  position: relative;
  isolation: isolate;
  margin-top: calc(-1 * var(--nav-h));
  padding-top: var(--nav-h);
  background-color: var(--cod-gray);
}
body > main::before,
body > main::after {
  content: "";
  position: absolute; left: 0; right: 0;
  background-repeat: no-repeat;
  pointer-events: none;
}
/* Textura (capa inferior) */
body > main::before {
  z-index: -2;
  top: var(--texture-top);
  height: var(--texture-h);
  background-image: url("../assets/legacy-test-background.webp");
  background-size: cover;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 88%, transparent 100%);
}
/* Foto del hero (capa superior). Se recorta el desfase superior (-108 px) con background-position. */
body > main::after {
  z-index: -1;
  top: 0;
  height: var(--hero-bg-h);
  background-image: url("../assets/legacy-test-hero-background.webp");
  background-size: cover;
  background-position: center bottom;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 70%, transparent 100%);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .navlinks a:not(.btn) { padding-inline: 8px; }
}

/* Tablet */
@media (max-width: 1024px) {
  /* Fotos con altura mínima para que la textura no se vea diminuta; la textura cubre
     hasta el Lead Gate (que tiene fondo propio). */
  body > main { --hero-bg-h: max(55.34vw, 760px); --texture-top: 0px; }
  body > main::before { height: auto; bottom: 0; }
  .hero-copy { max-width: none; }
  .test-shell { grid-template-columns: 1fr; }
  .steps { padding: 10px; }
  .steps ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .score-grid { grid-template-columns: 1fr; }
  .scorebox { width: 100%; max-width: 420px; margin-inline: auto; min-height: 0; }
  .cta-box { grid-template-columns: 1fr; padding: 32px 28px; }
  .cta-box-actions { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .tco-grid { grid-template-columns: 1fr; }
  .calc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* resultados lado a lado bajo el slider */
  .lead-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .navlinks a:not(.btn) { display: none; }
  .pressure-grid { grid-template-columns: 1fr; }
  /* Pasos del quiz: sólo indicadores numerados (una fila de 10; la pregunta completa sigue en el panel) */
  .steps ol { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .step { min-height: 0; padding: 9px 2px; border-left: 0; border-bottom: 2px solid var(--line); text-align: center; }
  .step.is-current { border-bottom-color: var(--spring-green); }
  .step-num { margin: 0; }
  .step-label { display: none; }
}

/* Móvil */
@media (max-width: 640px) {
  body > main::before { background-image: url("../assets/legacy-test-background-960.webp"); }
  body > main::after { background-image: url("../assets/legacy-test-hero-background-960.webp"); }
  :root { --nav-h: 62px; }
  .nav-logo img { width: 104px; }
  .btn-pill { font-size: 11px; padding: 8px 12px; min-height: 34px; }
  .hero { padding-bottom: 48px; }
  .hero-lead { line-height: 20px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { width: 100%; }
  .section { padding: 52px 0 56px; }
  .pressure-grid, .test-shell, .score-grid, .lead-grid { margin-top: 24px; }
  /* Pasos del quiz: dos filas de cinco indicadores numerados */
  .steps ol { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .qtitle { font-size: 20px; }
  /* Altura estable entre preguntas: los botones quedan abajo y no saltan al avanzar */
  .quiz-panel { display: flex; flex-direction: column; min-height: 590px; padding: 18px 16px; }
  .quiz-panel form { display: flex; flex: 1; flex-direction: column; }
  .quiz-actions { margin-top: auto; }
  .quiz-actions .btn { min-width: 0; flex: 1; padding-inline: 10px; white-space: nowrap; }
  .driver { grid-template-columns: 28px minmax(0, 1fr); }
  .driver .badge { display: none; }
  .driver-sev { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; }
  .cta-box { padding: 26px 18px; }
  .cta-box-actions { flex-direction: column; }
  .cta-box-actions .btn { white-space: normal; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .calc-kpis { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; } /* una columna: montos completos en una línea */
  .kpi { min-height: 0; padding: 14px; }
  .kpi b { font-size: 20px; line-height: 26px; }
  .form-panel { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .recommendation-panel { padding: 22px 18px; }
  .form-actions { align-items: stretch; }
  .form-actions .btn { width: 100%; min-width: 0; }
  .form-status { max-width: none; text-align: left; }
  .footer-contacts { grid-template-columns: 1fr; }
}
