/* Good Water — paleta tomada del material de marca:
   azul #538DC3 (fondo del logo), cyan #58DDF2 (barras de la infografia). */
:root {
  --azul: #538DC3;        /* marca: solo relleno decorativo, no sostiene texto blanco */
  --azul-hondo: #2B5C8A;
  --azul-tinta: #0F2233;
  --cyan: #58DDF2;
  --cyan-hondo: #0E7A8C;   /* el cyan de marca no llega a 4.5:1 sobre blanco */
  --gris: #A6A6A6;
  --papel: #F4F8FB;
  --sobre-fondo: #FFFFFF;        /* texto que va directo sobre la foto del agua */
  --sobre-fondo-2: #E3EFF7;
  --blanco: #FFFFFF;
  --tenue: #5A6C7B;
  --rojo: #B3261E;
  --ambar: #8A5A00;
  --verde-wsp: #1E7A47;
  --r: 16px;
  --sombra: 0 2px 12px rgba(15, 34, 51, .24);
  /* Velo sobre la foto del agua. El .52 es el mas claro que deja al blanco
     en 5.3:1 contra el pixel mas brillante de la pileta: mas transparente
     que esto y el texto deja de pasar WCAG AA. Lo verifica tools/qa.sh. */
  --velo-a: rgba(8, 28, 45, .52);
  --velo-b: rgba(8, 28, 45, .68);
  --sombra-texto: 0 1px 6px rgba(4, 18, 30, .85);
  --sombra-alta: 0 8px 28px rgba(15, 34, 51, .18);
  --barra-h: 56px;
  --tabs-h: 64px;
}

* { box-sizing: border-box; }

body::before,
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; }
body::before {
  z-index: -2;
  background: #12314A url("media/fondo-1600.webp") center / cover no-repeat;
}
body::after {
  z-index: -1;
  background: linear-gradient(180deg, var(--velo-a), var(--velo-b));
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--sobre-fondo);
  background: #12314A;
  /* tabs + el boton flotante de WhatsApp, que si no tapa la ultima tarjeta */
  padding-bottom: calc(var(--tabs-h) + 76px + env(safe-area-inset-bottom));
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
img, video { max-width: 100%; display: block; }

a { color: var(--azul-hondo); }
:focus-visible { outline: 3px solid var(--azul-hondo); outline-offset: 2px; border-radius: 6px; }

.skip {
  position: absolute; left: -999px;
  background: var(--blanco); padding: 12px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- barra superior ---------- */
.barra {
  position: sticky; top: 0; z-index: 20;
  height: var(--barra-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  background: var(--azul-hondo);
  color: var(--blanco);
  box-shadow: var(--sombra);
}
.barra__marca { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.barra__marca img { border-radius: 8px; }
.barra__marca span { display: flex; flex-direction: column; line-height: 1.15; }
.barra__marca strong { font-size: 1rem; }
.barra__marca small { font-size: .72rem; opacity: .9; }
.barra__modelo {
  margin-left: auto; min-height: 36px; padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.55); border-radius: 999px;
  background: rgba(255,255,255,.14); color: var(--blanco);
  font: inherit; font-size: .8rem; cursor: pointer;
  max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- layout ---------- */
main { max-width: 680px; margin: 0 auto; padding: 0 0 24px; }
main > .caja > h1,
main > .caja > h2,
main > .caja > p,
.hero,
.progreso small { text-shadow: var(--sombra-texto); }
.progreso small { color: var(--sobre-fondo); }
.tenue-fondo { color: var(--sobre-fondo-2); text-shadow: var(--sombra-texto); }
main > .caja > p a { color: #AEE9F7; }

/* Todo lo que tiene fondo propio vuelve a texto oscuro y sin sombra. */
.tarjeta, .paso-link, .modelo, .faq, .beneficios li, .contacto a, .manual,
table, th, td, .aviso, .boton, .tabs, .instalar {
  text-shadow: none;
}
.tarjeta, .paso-link, .modelo, .faq, .beneficios li, .contacto a, .manual, table {
  color: var(--azul-tinta);
}
.caja { padding: 0 16px; }

/* ---------- portada ---------- */
.hero {
  padding: 36px 16px 32px;
  color: var(--blanco);
  text-shadow: 0 1px 10px rgba(0,0,0,.6);
}
.hero h1 { font-size: 1.75rem; }
.hero p { margin-bottom: 0; opacity: .95; }

/* ---------- tarjetas ---------- */
.tarjeta {
  background: var(--blanco);
  border-radius: var(--r);
  box-shadow: var(--sombra);
  padding: 18px;
  margin: 16px 0;
}
.tarjeta--plana { box-shadow: none; border: 1px solid #DCE6EE; }

.paso-link {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px;
  padding: 14px 16px; margin: 12px 0;
  background: var(--blanco); border: 1px solid #DCE6EE; border-radius: var(--r);
  text-decoration: none; text-align: left;
  box-shadow: var(--sombra);
}
.paso-link__n {
  flex: 0 0 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--papel);
  border: 2px solid var(--azul); color: var(--azul-hondo);
  font-weight: 700;
}
.paso-link[data-hecho="si"] .paso-link__n {
  background: var(--azul-hondo); border-color: var(--azul-hondo); color: var(--blanco);
}
.paso-link__txt { flex: 1 1 auto; min-width: 0; }
.paso-link__txt strong { display: block; }
.paso-link__txt small { color: var(--tenue); font-size: .85rem; }
.paso-link__ir { flex: 0 0 auto; color: var(--tenue); }

/* ---------- progreso ---------- */
.progreso { margin: 4px 0 8px; }
.progreso__barra {
  height: 8px; border-radius: 999px; background: #D9E4EC; overflow: hidden;
}
.progreso__barra i { display: block; height: 100%; background: var(--azul); transition: width .3s; }
.progreso small { color: var(--tenue); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .progreso__barra i { transition: none; } }

/* ---------- modelos ---------- */
.modelos { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.modelo {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 12px 16px;
  background: var(--blanco); border: 2px solid #DCE6EE; border-radius: 12px;
  font: inherit; text-align: left; cursor: pointer;
}
.modelo[aria-pressed="true"] { border-color: var(--azul); background: #EAF3FB; }
.modelo__check { flex: 0 0 22px; width: 22px; height: 22px; color: var(--azul-hondo); visibility: hidden; }
.modelo[aria-pressed="true"] .modelo__check { visibility: visible; }
.modelo small { display: block; color: var(--tenue); font-size: .82rem; }

/* ---------- avisos ---------- */
.aviso {
  border-radius: 12px; padding: 14px 16px; margin: 14px 0;
  border-left: 0; border: 1px solid;
}
.aviso h3 { display: flex; gap: 8px; align-items: flex-start; }
/* sin alto explicito el svg se estira a todo el bloque */
.aviso h3 svg { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; }
.aviso p:last-child { margin-bottom: 0; }
.aviso--critico { background: #FDECEA; border-color: #E8B4AF; color: #5C1512; }
.aviso--clave   { background: #FFF5E0; border-color: #E8CF9C; color: #4A3200; }
.aviso--info    { background: #E8F4FA; border-color: #AFD3E8; color: #11384F; }

/* ---------- video ---------- */
.video {
  margin: 16px 0; border-radius: 12px; overflow: hidden;
  background: #0b1b28;
}
.video video { width: 100%; height: auto; aspect-ratio: 3 / 4; background: #0b1b28; }
.video__pie { padding: 10px 14px; color: #CFE3F0; font-size: .85rem; }

/* ---------- listas ---------- */
.lista-check { list-style: none; margin: 0; padding: 0; }
.lista-check li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid #E6EEF4;
}
.lista-check li:last-child { border-bottom: 0; }
.lista-check svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 3px; color: var(--azul-hondo); }

.lista-pasos { margin: 0; padding-left: 0; list-style: none; counter-reset: p; }
.lista-pasos li {
  counter-increment: p;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0;
}
.lista-pasos li::before {
  content: counter(p);
  flex: 0 0 26px; height: 26px; margin-top: 1px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--azul-hondo); color: var(--blanco);
  font-size: .85rem; font-weight: 700;
}

/* ---------- navegacion entre pasos ---------- */
.nav-pasos { display: flex; gap: 10px; margin: 20px 0 0; }
.boton {
  flex: 1 1 auto; min-height: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; border: 2px solid var(--azul-hondo);
  background: var(--azul-hondo); color: var(--blanco);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.boton--sec { background: var(--blanco); color: var(--azul-hondo); }
.boton:disabled { opacity: .5; cursor: default; }

/* ---------- faq ---------- */
.faq { border: 1px solid #DCE6EE; border-radius: 12px; background: var(--blanco); margin: 10px 0; }
.faq summary {
  min-height: 56px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; font-weight: 600; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: 0 0 10px; height: 10px; margin-left: auto;
  border-right: 2px solid var(--tenue); border-bottom: 2px solid var(--tenue);
  transform: rotate(45deg); transition: transform .2s;
}
.faq[open] summary::after { transform: rotate(-135deg); }
.faq__r { padding: 0 16px 16px; }
.faq__r p { white-space: pre-line; margin-bottom: .8em; }
.faq__r p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* ---------- manual pdf ---------- */
.manual {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; margin: 16px 0; padding: 14px 16px;
  background: var(--blanco); border: 1px solid #DCE6EE; border-radius: 12px;
  text-decoration: none; box-shadow: var(--sombra);
}
.manual svg { flex: 0 0 24px; width: 24px; height: 24px; color: var(--azul-hondo); }
.manual strong { display: block; }
.manual small { color: var(--tenue); font-size: .85rem; }

/* ---------- tabla ---------- */
.tabla-caja { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--blanco); }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #E6EEF4; }
thead th { background: #EAF3FB; font-size: .9rem; }
tbody th { font-weight: 600; }

/* ---------- beneficios ---------- */
.beneficios { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.beneficios li {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--blanco); border-radius: 10px; padding: 12px 14px;
  box-shadow: var(--sombra);
}
.beneficios svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 3px; color: var(--cyan-hondo); }

/* ---------- contacto ---------- */
.contacto { display: grid; gap: 10px; }
.contacto a {
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: 14px 16px; border-radius: 12px; background: var(--blanco);
  border: 1px solid #DCE6EE; text-decoration: none;
}
.contacto svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--azul-hondo); }

/* ---------- tabs inferiores ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--blanco); border-top: 1px solid #DCE6EE;
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--tenue); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tabs a[aria-current="page"] { color: var(--azul-hondo); }
.tabs a { text-shadow: none; }
.tabs svg { width: 22px; height: 22px; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- whatsapp ---------- */
.wsp {
  position: fixed; right: 14px; z-index: 21;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 14px);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 12px 18px;
  border-radius: 999px; background: var(--verde-wsp); color: var(--blanco);
  text-decoration: none; font-weight: 600; font-size: .92rem;
  box-shadow: var(--sombra-alta);
}
.wsp svg { width: 22px; height: 22px; }

/* ---------- banner de instalacion ---------- */
.instalar {
  position: fixed; z-index: 30; left: 10px; right: 10px;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px);
  background: var(--azul-tinta); color: var(--blanco);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--sombra-alta);
}
.instalar p { margin: 0 0 10px; font-size: .92rem; }
.instalar__acciones { display: flex; gap: 10px; }
.instalar button {
  min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 0;
  background: var(--cyan); color: #06303A; font: inherit; font-weight: 700; cursor: pointer;
}
.instalar .es-texto { background: transparent; color: var(--blanco); font-weight: 500; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 560px) {
  .modelos { grid-template-columns: 1fr 1fr; }
}
