/* Paleta extraída directamente de img/logoOTEA.webp: azul marino oscuro del
   rótulo "OTE" + degradado turquesa/menta del ojo y la "A". Sin tokens
   inventados — son los mismos colores que ya lleva la marca. */

:root {
  --bg: #fbfdfc;
  --surface: #ffffff;
  --surface-alt: #eaf7f4;
  --ink: #15304a;
  --ink-dim: #59748a;
  --line: #dbe9e5;
  --line-soft: #ecf5f2;

  --teal-light: #6fe0c8;
  --teal: #2fb6a3;
  --teal-dark: #1c8577;
  --teal-soft: #d8f4ee;

  --navy: #15304a;
  --navy-ink: #0d1f30;

  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 36px;
  --radius-xl: 48px;

  --shadow-sm: 0 2px 8px rgba(21, 48, 74, 0.06);
  --shadow-md: 0 16px 40px -16px rgba(21, 48, 74, 0.22), 0 4px 12px -4px rgba(21, 48, 74, 0.10);
  --shadow-lg: 0 32px 64px -20px rgba(21, 48, 74, 0.30);
  --shadow-teal: 0 24px 56px -20px rgba(47, 182, 163, 0.35), 0 6px 16px -6px rgba(21, 48, 74, 0.12);

  --font-display: 'Outfit', ui-sans-serif, "Segoe UI", Roboto, sans-serif;
  --font-sans: 'Inter', ui-sans-serif, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0c1a20;
    --surface: #10222a;
    --surface-alt: #0a1a1e;
    --ink: #eef7f4;
    --ink-dim: #9fbab2;
    --line: #1f3941;
    --line-soft: #162a30;

    --teal-light: #7fe9d4;
    --teal: #4fd6bf;
    --teal-dark: #2fb6a3;
    --teal-soft: #123430;

    --navy: #eef7f4;
    --navy-ink: #ffffff;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 40px -16px rgba(0, 0, 0, 0.55), 0 4px 12px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 32px 64px -20px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme='dark'] {
  --bg: #0c1a20;
  --surface: #10222a;
  --surface-alt: #0a1a1e;
  --ink: #eef7f4;
  --ink-dim: #9fbab2;
  --line: #1f3941;
  --line-soft: #162a30;

  --teal-light: #7fe9d4;
  --teal: #4fd6bf;
  --teal-dark: #2fb6a3;
  --teal-soft: #123430;

  --navy: #eef7f4;
  --navy-ink: #ffffff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 40px -16px rgba(0, 0, 0, 0.55), 0 4px 12px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 32px 64px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  margin: 0; text-wrap: balance; line-height: 1.12;
}
p { margin: 0; }

:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 2px; border-radius: 4px; }

.oculto { display: none !important; }

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

.envoltorio { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
}
.eyebrow::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--teal); flex: none; }

/* ============ BOTONES ============ */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  padding: 0.95rem 1.7rem; min-height: 52px;
  border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}
.boton.primario {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff; box-shadow: var(--shadow-teal);
}
.boton.primario:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.boton.primario:active { transform: translateY(0); }

.boton.secundario { background: var(--surface); color: var(--ink); border-color: var(--line); }
.boton.secundario:hover { border-color: var(--teal); color: var(--teal-dark); }

/* ============ CABECERA ============ */

header.barra {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
header.barra .envoltorio {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 0.6rem; padding-bottom: 0.6rem;
}

.marca-landing { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.marca-landing img { height: 64px; width: auto; display: block; }
.marca-landing b { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; color: var(--navy); }

nav.principal { display: flex; align-items: center; gap: 2rem; }
nav.principal ul { list-style: none; display: flex; gap: 1.7rem; margin: 0; padding: 0; }
nav.principal a:not(.boton) {
  font-size: 0.92rem; font-weight: 600; color: var(--ink-dim); text-decoration: none;
  transition: color 150ms ease;
}
nav.principal a:not(.boton):hover { color: var(--teal-dark); }

.selector-idioma select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2359748a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 0.6rem center / 16px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.5rem 2.1rem 0.5rem 0.9rem;
  font-size: 0.85rem; font-weight: 600; color: var(--ink);
  cursor: pointer; min-height: 40px;
  transition: border-color 150ms ease;
}
.selector-idioma select:hover { border-color: var(--teal); }

.boton-menu {
  display: none; background: none; border: 1px solid var(--line); border-radius: 8px;
  width: 42px; height: 42px; align-items: center; justify-content: center; cursor: pointer;
  color: var(--ink);
}

/* ============ HERO ============ */

.hero { padding: 4.5rem 0 6rem; overflow: hidden; position: relative; }
.hero::before {
  content: ''; position: absolute; top: -12rem; right: -8rem;
  width: 34rem; height: 34rem; border-radius: 50%;
  background: radial-gradient(circle, var(--teal-light) 0%, transparent 70%);
  opacity: 0.35; filter: blur(10px); pointer-events: none;
}
.hero .envoltorio {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: 3.5rem; align-items: center; position: relative;
}
.hero h1 { font-size: clamp(2.3rem, 1.6rem + 2.8vw, 3.7rem); color: var(--navy); }
.hero .destaque { color: var(--teal-dark); }
.hero .sub { font-size: 1.15rem; color: var(--ink-dim); margin-top: 1.3rem; max-width: 34rem; }
.hero .acciones { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 2.2rem; }

.hero .prueba-social {
  display: flex; align-items: center; gap: 0.9rem;
  margin-top: 2.4rem; font-size: 0.86rem; color: var(--ink-dim);
}
.hero .prueba-social strong { color: var(--navy); }

.hero-foto { position: relative; }
.hero-foto .marco {
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-teal);
  aspect-ratio: 4 / 5;
}
.hero-foto .marco img { width: 100%; height: 100%; object-fit: cover; }
.hero-foto .insignia {
  position: absolute; left: -1.2rem; bottom: 1.6rem;
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 0.9rem 1.2rem; display: flex; align-items: center; gap: 0.7rem;
  max-width: 15rem;
}
.hero-foto .insignia .punto {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--teal-soft); color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
}
.hero-foto .insignia .punto svg { width: 20px; height: 20px; }
.hero-foto .insignia b { display: block; font-size: 0.88rem; color: var(--navy); }
.hero-foto .insignia span { display: block; font-size: 0.76rem; color: var(--ink-dim); }

/* ============ SECCIONES ============ */

section.franja { padding: 6rem 0; }
section.franja.alt { background: var(--surface-alt); }

.cabecera-seccion { max-width: 42rem; margin: 0 auto 3.5rem; text-align: center; }
.cabecera-seccion h2 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); color: var(--navy); margin-top: 0.8rem; }
.cabecera-seccion p { font-size: 1.08rem; color: var(--ink-dim); margin-top: 1rem; }
.cabecera-seccion.izquierda { text-align: left; margin-left: 0; }

/* ---- Cómo funciona: stepper con foto ---- */

.pasos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; counter-reset: paso; }

.tarjeta-paso {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.8rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1.1rem;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.tarjeta-paso:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.tarjeta-paso .num {
  counter-increment: paso; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--teal-dark); color: #fff; font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.tarjeta-paso .num::before { content: counter(paso); }
.tarjeta-paso .foto { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4 / 3; }
.tarjeta-paso .foto img { width: 100%; height: 100%; object-fit: cover; object-position: center 4%; }
.tarjeta-paso h3 { font-size: 1.05rem; color: var(--navy); }
.tarjeta-paso p { font-size: 0.9rem; color: var(--ink-dim); }

/* ---- Reloj inteligente ---- */

.reloj-seccion .envoltorio {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 3.5rem; align-items: center;
}
.reloj-foto { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-teal); aspect-ratio: 3 / 2; }
.reloj-foto img { width: 100%; height: 100%; display: block; object-fit: cover; }

.lista-check { list-style: none; margin: 1.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.lista-check li { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.98rem; color: var(--ink); }
.lista-check svg { width: 22px; height: 22px; flex: none; color: var(--teal-dark); margin-top: 0.1rem; }

/* ---- Familias ---- */

.familias-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; }
.familias-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
.familias-fotos .foto-grande { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 4 / 5; }
.familias-fotos .foto-pequena { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); aspect-ratio: 4 / 5; }
.familias-fotos img { width: 100%; height: 100%; object-fit: cover; }
.familias-fotos .foto-grande img { object-position: 15% 35%; }
.familias-fotos .foto-pequena img { object-position: 55% center; }

/* ---- Ayuntamientos ---- */

.ayto-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.ayto-fotos { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.ayto-fotos .foto { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md); }
.ayto-fotos .foto.baja { aspect-ratio: 16 / 8; }
.ayto-fotos .foto.alta { aspect-ratio: 16 / 10; }
.ayto-fotos img { width: 100%; height: 100%; object-fit: cover; }
.ayto-fotos .foto.alta img { object-position: center 15%; }

.rejilla-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.4rem; }
.stat-tarjeta {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm);
}
.stat-tarjeta .valor { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--teal-dark); letter-spacing: -0.02em; }
.stat-tarjeta .etiqueta { font-size: 0.82rem; color: var(--ink-dim); margin-top: 0.2rem; }

.lista-ayto { list-style: none; margin: 1.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.lista-ayto li { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.98rem; }
.lista-ayto svg { width: 22px; height: 22px; flex: none; color: var(--teal-dark); margin-top: 0.1rem; }

/* ---- Dignidad / vida activa ---- */

.dignidad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: stretch; }
.dignidad-grid .foto { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md); position: relative; }
.dignidad-grid .foto.a { aspect-ratio: 4 / 5; }
.dignidad-grid .foto.b { aspect-ratio: 4 / 5; }
.dignidad-grid img { width: 100%; height: 100%; object-fit: cover; }
.dignidad-grid .rotulo {
  position: absolute; left: 1.1rem; bottom: 1.1rem; right: 1.1rem;
  color: #fff; font-weight: 700; font-size: 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}

/* ---- Precio / diferenciador ---- */

.precio-tarjeta {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  border-radius: var(--radius-xl); padding: 2.8rem;
  color: #fff; box-shadow: var(--shadow-teal);
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
}
.precio-tarjeta .cifra { font-family: var(--font-display); font-size: 3.2rem; font-weight: 700; letter-spacing: -0.02em; }
.precio-tarjeta .cifra small { font-size: 1.1rem; font-weight: 600; opacity: 0.85; }
.precio-tarjeta h3 { color: #fff; font-size: 1.3rem; }
.precio-tarjeta p { color: rgba(255,255,255,0.9); margin-top: 0.6rem; font-size: 0.95rem; max-width: 32rem; }

/* ============ PIE ============ */

footer.pie { border-top: 1px solid var(--line); padding: 2.6rem 0; }
footer.pie .envoltorio { display: flex; flex-direction: column; gap: 1.4rem; }
footer.pie .fila-superior { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
footer.pie .marca-landing img { height: 44px; }
footer.pie .marca-landing b { font-size: 1.1rem; }
footer.pie .claim { font-size: 0.84rem; color: var(--ink-dim); margin-top: 0.5rem; max-width: 22rem; }
footer.pie .columnas { display: flex; gap: 3rem; flex-wrap: wrap; }
footer.pie .columna h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-dim); margin-bottom: 0.7rem; }
footer.pie .columna ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
footer.pie .columna a { font-size: 0.9rem; text-decoration: none; color: var(--ink); }
footer.pie .columna a:hover { color: var(--teal-dark); }
footer.pie .fila-inferior {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.4rem; border-top: 1px solid var(--line-soft);
  font-size: 0.8rem; color: var(--ink-dim);
}

/* ============ REVEAL AL HACER SCROLL ============ */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */

@media (max-width: 980px) {
  .hero .envoltorio { grid-template-columns: 1fr; }
  .hero-foto { order: -1; max-width: 26rem; margin: 0 auto; }
  .pasos-grid { grid-template-columns: repeat(2, 1fr); }
  .reloj-seccion .envoltorio { grid-template-columns: 1fr; }
  .reloj-foto { max-width: 24rem; margin: 0 auto; }
  .familias-grid { grid-template-columns: 1fr; }
  .familias-fotos { order: -1; max-width: 26rem; margin: 0 auto; }
  .ayto-grid { grid-template-columns: 1fr; }
  .rejilla-stats { grid-template-columns: repeat(3, 1fr); }
  .dignidad-grid { grid-template-columns: 1fr 1fr; }
  .precio-tarjeta { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 760px) {
  nav.principal ul, nav.principal .boton { display: none; }
  .boton-menu { display: flex; }
  .pasos-grid { grid-template-columns: 1fr; }
  .rejilla-stats { grid-template-columns: 1fr; }
  footer.pie .fila-superior { flex-direction: column; }
}

nav.principal.abierto {
  position: fixed; inset: 88px 0 0 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: flex-start; padding: 2rem 1.5rem;
  gap: 1.6rem; z-index: 49; overflow-y: auto;
}
nav.principal.abierto ul { display: flex; flex-direction: column; gap: 1.2rem; }
nav.principal.abierto ul, nav.principal.abierto .boton { display: flex; }
nav.principal.abierto a:not(.boton) { font-size: 1.15rem; }
