/* ==========================================================================
   VICAM · hoja de estilos única
   Mobile-first: el layout base es para 360px. Las media queries solo AGREGAN
   aire en pantallas grandes; nunca arreglan un mobile roto.
   ========================================================================== */

:root {
  /* Color: un dominante oscuro + un acento de señal. Nada tibio. */
  --bg:         #0a0c0f;
  --bg-2:       #0e1116;
  --surface:    #14181f;
  --surface-2:  #1b212a;
  --border:     #262e3a;
  --border-viv: #384456;
  --text:       #f2f4f7;
  --text-mut:   #949eae;
  --text-ten:   #6b7686;

  --acento:     #ff5c2b;   /* naranja señal: SOLO en lo accionable */
  --acento-ink: #0a0c0f;
  --wsp:        #25d366;   /* verde WhatsApp: solo el CTA de WhatsApp */
  --wsp-ink:    #04220f;

  /* Escala tipográfica fluida */
  --t--1: clamp(0.78rem, 0.76rem + 0.12vw, 0.85rem);
  --t-0:  clamp(1.00rem, 0.97rem + 0.18vw, 1.09rem);
  --t-1:  clamp(1.22rem, 1.13rem + 0.45vw, 1.55rem);
  --t-2:  clamp(1.65rem, 1.40rem + 1.20vw, 2.60rem);
  --t-3:  clamp(2.35rem, 1.75rem + 3.00vw, 4.20rem);

  /* Espacio: escala única de 4px */
  --s1: .25rem;  --s2: .5rem;   --s3: .75rem;  --s4: 1rem;
  --s5: 1.25rem; --s6: 1.5rem;  --s8: 2rem;    --s10: 2.5rem;
  --s12: 3rem;   --s16: 4rem;   --s20: 5rem;

  --r-sm: 6px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --ease: cubic-bezier(.2,.8,.2,1);

  --ancho: 1120px;
  --barra: 76px; /* alto de la barra fija inferior */

  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --texto: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--texto);
  font-size: var(--t-0);
  line-height: 1.6;
  padding-bottom: calc(var(--barra) + env(safe-area-inset-bottom));
  overflow-x: clip;
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.01em;
  text-transform: uppercase;
  margin: 0;
}
h1 { font-size: var(--t-3); }
h2 { font-size: var(--t-2); }
h3 { font-size: var(--t-1); letter-spacing: 0; }

p { margin: 0 0 var(--s4); }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.env { width: 100%; max-width: var(--ancho); margin-inline: auto; padding-inline: var(--s5); }
.seccion { padding-block: var(--s12); }
.mut { color: var(--text-mut); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }

.solo-lectores {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Trama técnica de fondo: atmósfera barata en KB ---------------------- */
.trama {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .16;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 75%);
}

/* ==========================================================================
   Cabecera
   ========================================================================== */
.cab {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.cab__in { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 60px; }

.logo { display: flex; align-items: baseline; gap: var(--s2); text-decoration: none; min-height: 44px; padding-block: var(--s1); }
.logo b {
  font-family: var(--display); font-weight: 800; font-size: 1.6rem;
  letter-spacing: .04em; text-transform: uppercase;
}
.logo span { font-size: .62rem; letter-spacing: .22em; color: var(--text-ten); text-transform: uppercase; }

.rec { display: inline-flex; align-items: center; gap: 6px; font-size: .62rem; letter-spacing: .18em; color: var(--text-ten); text-transform: uppercase; }
.rec::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--acento); animation: latido 2.4s var(--ease) infinite;
}
@keyframes latido { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; padding-block: var(--s10) var(--s12); }
.hero::before {
  content: ''; position: absolute; inset: -10% 0 auto 0; height: 420px; z-index: -1;
  background: radial-gradient(ellipse 140% 100% at 50% 0%, rgba(255,92,43,.17), transparent 62%);
}

.kicker {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono); font-size: var(--t--1);
  letter-spacing: .1em; text-transform: uppercase; color: var(--acento);
  border: 1px solid color-mix(in srgb, var(--acento) 35%, transparent);
  border-radius: var(--r-pill); padding: 6px 14px; margin-bottom: var(--s5);
}

.hero h1 { margin-bottom: var(--s4); }
.hero h1 em { font-style: normal; color: var(--acento); }

.bajada { font-size: var(--t-1); color: var(--text-mut); line-height: 1.35; max-width: 34ch; margin-bottom: var(--s6); }
.bajada strong { color: var(--text); font-weight: 600; }

/* Datos duros del negocio, en mono, como una ficha técnica */
.ficha {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden; margin-bottom: var(--s6);
}
.ficha div { padding: var(--s4) var(--s3); text-align: center; border-right: 1px solid var(--border); }
.ficha div:last-child { border-right: 0; }
.ficha b { display: block; font-family: var(--display); font-size: 1.9rem; font-weight: 800; line-height: 1; }
.ficha span { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-ten); }

/* --- Botones ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 52px; padding: 0 var(--s6);
  font-family: var(--display); font-size: 1.15rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  text-decoration: none; cursor: pointer;
  transition: transform .14s var(--ease), background .14s var(--ease), border-color .14s var(--ease);
}
.btn:active { transform: scale(.985); }
.btn--pri { background: var(--acento); color: var(--acento-ink); }
.btn--wsp { background: var(--wsp); color: var(--wsp-ink); }
.btn--fan { background: transparent; border-color: var(--border); color: var(--text-mut); }
.btn--full { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ==========================================================================
   Cobertura · las 12 localidades
   ========================================================================== */
.cobertura { border-top: 1px solid var(--border); background: var(--bg-2); }
.corredor { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0 var(--s6); padding: 0; list-style: none; }
.corredor li {
  font-family: var(--mono); font-size: var(--t--1);
  padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-mut);
}
.corredor li[data-base] { border-color: var(--acento); color: var(--text); }
.corredor li[data-base]::before { content: '◉ '; color: var(--acento); }

.grupo-tit {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-ten); margin-top: var(--s6);
}

/* ==========================================================================
   Tarjetas de argumento
   ========================================================================== */
.tarjetas { display: grid; gap: var(--s4); margin-top: var(--s8); }
.tarjeta {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: var(--s5);
}
.tarjeta h3 { margin-bottom: var(--s2); }
.tarjeta p { margin: 0; color: var(--text-mut); font-size: .96rem; }
.tarjeta__n {
  font-family: var(--mono); font-size: .7rem; color: var(--acento);
  letter-spacing: .12em; display: block; margin-bottom: var(--s3);
}

/* ==========================================================================
   COTIZADOR
   ========================================================================== */
.cotizador { border-top: 1px solid var(--border); scroll-margin-top: 68px; }

.paso-barra { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s6); }
.paso-barra__pista { flex: 1; height: 4px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.paso-barra__yo { height: 100%; width: 0%; background: var(--acento); border-radius: var(--r-pill); transition: width .35s var(--ease); }
.paso-barra__txt { font-family: var(--mono); font-size: var(--t--1); color: var(--text-ten); white-space: nowrap; }

.pregunta { font-size: var(--t-2); margin-bottom: var(--s2); }
.pregunta-ayuda { color: var(--text-mut); margin-bottom: var(--s6); font-size: .95rem; }

/* Opciones: una columna, targets grandes, pensadas para el pulgar */
.ops { display: grid; gap: var(--s3); margin: 0 0 var(--s6); padding: 0; border: 0; }
.op {
  display: flex; align-items: center; gap: var(--s4);
  width: 100%; min-height: 64px; padding: var(--s4);
  text-align: left; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font: inherit;
  transition: border-color .14s var(--ease), background .14s var(--ease), transform .14s var(--ease);
}
.op:active { transform: scale(.99); }
.op[aria-pressed="true"] { border-color: var(--acento); background: color-mix(in srgb, var(--acento) 10%, var(--surface)); }
.op__ico {
  flex: 0 0 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-sm); background: var(--surface-2);
  font-family: var(--display); font-size: 1.05rem; font-weight: 800; color: var(--acento);
}
.op[aria-pressed="true"] .op__ico { background: var(--acento); color: var(--acento-ink); }
.op__tit { display: block; font-weight: 600; line-height: 1.25; }
.op__sub { display: block; font-size: .82rem; color: var(--text-mut); line-height: 1.3; margin-top: 2px; }

.ops--grupo { gap: var(--s2); }
.ops--grupo .op { min-height: 56px; }

/* Campos del último paso */
.campo { margin-bottom: var(--s4); }
.campo label { display: block; font-size: .85rem; color: var(--text-mut); margin-bottom: var(--s2); }
.campo input {
  width: 100%; min-height: 54px; padding: 0 var(--s4);
  font-size: 16px; /* menos de 16px hace zoom en iOS */
  font-family: var(--texto); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
}
.campo input::placeholder { color: var(--text-ten); }
.campo input:focus { outline: none; border-color: var(--acento); }
.campo[data-error] input { border-color: #ff4444; }
.campo__error { display: none; color: #ff7a7a; font-size: .82rem; margin-top: var(--s2); }
.campo[data-error] .campo__error { display: block; }

.nav-pasos { display: flex; gap: var(--s3); align-items: center; }

/* --- Resultado ----------------------------------------------------------- */
.resultado__caja {
  border: 1px solid var(--acento); border-radius: var(--r-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--acento) 12%, var(--surface)), var(--surface));
  padding: var(--s6) var(--s5); text-align: center; margin-bottom: var(--s5);
}
.resultado__et { font-family: var(--mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-mut); }
.resultado__rango {
  font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3rem);
  line-height: 1.05; margin: var(--s3) 0 var(--s2); font-variant-numeric: tabular-nums;
}
.resultado__nota { font-size: .84rem; color: var(--text-mut); margin: 0; }

.desglose { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: var(--s5); overflow: hidden; }
.desglose summary {
  padding: var(--s4) var(--s5); cursor: pointer; font-weight: 600; font-size: .95rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 52px;
}
.desglose summary::-webkit-details-marker { display: none; }
.desglose summary::after { content: '+'; font-family: var(--mono); color: var(--acento); font-size: 1.3rem; }
.desglose[open] summary::after { content: '−'; }
.desglose ul { list-style: none; margin: 0; padding: 0 var(--s5) var(--s4); border-top: 1px solid var(--border); }
.desglose li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.desglose li:last-child { border-bottom: 0; }
.desglose li span:last-child { font-family: var(--mono); white-space: nowrap; }
.desglose__pie { padding: var(--s3) var(--s5) var(--s4); font-size: .74rem; color: var(--text-ten); font-family: var(--mono); }

/* Ajuste de cantidad de cámaras */
.ajuste {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: var(--s4) var(--s5); margin-bottom: var(--s5);
}
.ajuste__txt { font-size: .9rem; line-height: 1.3; }
.ajuste__txt b { display: block; font-size: 1rem; }
.ajuste__ctrl { display: flex; align-items: center; gap: var(--s2); }
.ajuste__btn {
  width: 46px; height: 46px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  font-size: 1.4rem; line-height: 1; font-family: var(--mono);
}
.ajuste__btn:active { background: var(--acento); color: var(--acento-ink); }
.ajuste__n { font-family: var(--display); font-weight: 800; font-size: 1.6rem; min-width: 2ch; text-align: center; }

.promo {
  display: flex; gap: var(--s3); align-items: flex-start;
  border: 1px dashed var(--acento); border-radius: var(--r-md);
  padding: var(--s4); margin-bottom: var(--s5);
  background: color-mix(in srgb, var(--acento) 8%, transparent);
}
.promo b { font-family: var(--display); font-size: 1.15rem; letter-spacing: .02em; }
.promo p { margin: 0; font-size: .85rem; color: var(--text-mut); }

.aviso {
  border-left: 3px solid var(--acento); padding: var(--s2) 0 var(--s2) var(--s4);
  font-size: .85rem; color: var(--text-mut); margin-bottom: var(--s5);
}

/* Estado de guardado: la prueba visible de que el dato quedó adentro */
.guardado {
  display: flex; align-items: center; gap: var(--s2);
  font-family: var(--mono); font-size: .74rem; color: var(--text-ten);
  margin-top: var(--s4);
}
.guardado[data-estado="ok"] { color: var(--wsp); }
.guardado[data-estado="error"] { color: #ff7a7a; }
.guardado::before { content: '○'; }
.guardado[data-estado="ok"]::before { content: '●'; }
.guardado[data-estado="error"]::before { content: '△'; }

/* ==========================================================================
   Barra fija inferior · el CTA siempre en la zona del pulgar
   ========================================================================== */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: var(--s3) var(--s5);
  padding-bottom: max(var(--s3), env(safe-area-inset-bottom));
}
.barra__in { display: flex; gap: var(--s3); align-items: center; max-width: var(--ancho); margin-inline: auto; }
.barra .btn { flex: 1; }

/* ==========================================================================
   Pie
   ========================================================================== */
.pie { border-top: 1px solid var(--border); background: var(--bg-2); padding-block: var(--s8); font-size: .86rem; color: var(--text-mut); }
.pie a { color: var(--text-mut); }

/* ==========================================================================
   Escalado a pantallas grandes · solo AGREGA, no arregla
   ========================================================================== */
@media (min-width: 620px) {
  .tarjetas { grid-template-columns: repeat(2, 1fr); }
  .ops--dos { grid-template-columns: repeat(2, 1fr); }
  .ficha b { font-size: 2.4rem; }
}

@media (min-width: 900px) {
  .seccion { padding-block: var(--s16); }
  .hero { padding-block: var(--s16) var(--s20); }
  .hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s12); align-items: center; }
  .tarjetas { grid-template-columns: repeat(3, 1fr); }
  .bajada { font-size: 1.35rem; }
  .ops--tres { grid-template-columns: repeat(3, 1fr); }
  body { padding-bottom: 0; }
  .barra { position: static; border-top: 0; background: transparent; backdrop-filter: none; padding-inline: 0; }
  .barra__in { justify-content: flex-start; }
  .barra .btn { flex: 0 1 auto; min-width: 260px; }
}

/* Reveal escalonado, un solo momento orquestado */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: sube .55s var(--ease) both; }
  .reveal:nth-child(2) { animation-delay: .07s; }
  .reveal:nth-child(3) { animation-delay: .14s; }
  .reveal:nth-child(4) { animation-delay: .21s; }
  @keyframes sube { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
