/* =========================================================
   MEJORO MI PENSIÓN — estilos (versión fondo oscuro)
   Los colores de la marca están aquí arriba, en :root.
   ========================================================= */

:root {
  color-scheme: dark;

  /* Colores tomados del logotipo */
  --azul-marca: #5B94E2;      /* "MEJORO" */
  --coral-marca: #F87272;     /* "mi pensión" */
  --turquesa-marca: #40B8C0;  /* líneas de neón */

  /* Base oscura, azul noche como los anuncios */
  --fondo: #0F1626;
  --tinte: #16203A;           /* secciones alternas */
  --panel: #244E8C;           /* recuadro del contacto principal */
  --texto: #EEF2F8;
  --texto-suave: #B4BFD0;
  --azul-claro: #8DB6EE;      /* enlaces y detalles en azul */
  --linea: #2A3755;

  /* WhatsApp */
  --verde-wa: #1B8A4F;
  --verde-wa-hover: #157341;
  --verde-claro: #5FD394;     /* enlaces de WhatsApp sobre fondo oscuro */

  --letra-titulos: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --letra-texto: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --ancho: 68rem;
  --margen: 1.25rem;
  --alto-barra: 4.75rem;
}

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

html {
  font-size: 118.75%;          /* 19 px: lectura cómoda */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--fondo);
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--letra-texto);
  line-height: 1.6;
  /* Espacio para que el botón fijo no tape el final de la página */
  padding-bottom: calc(var(--alto-barra) + env(safe-area-inset-bottom));
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--letra-titulos);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.8rem, 6.2vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 4.6vw, 2.2rem); letter-spacing: -.01em; }
h3 { font-size: 1.12rem; font-weight: 600; line-height: 1.3; margin-bottom: .35em; }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: var(--azul-claro); text-underline-offset: .18em; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--azul-claro);
  outline-offset: 3px;
  border-radius: 6px;
}

.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: var(--margen);
}

/* ---------- Botones ---------- */
.boton-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 3.5rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  background: var(--verde-wa);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s;
}
.boton-wa:hover { background: var(--verde-wa-hover); }
.boton-wa svg { width: 1.4rem; height: 1.4rem; flex-shrink: 0; }
.boton-wa:focus-visible { outline-color: #fff; }

.boton-wa--claro { background: #fff; color: #146C43; }
.boton-wa--claro:hover { background: #E8F3EC; }

.enlace-wa, .enlace-llamar {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.75rem;
  font-weight: 700;
  color: var(--verde-claro);
}
.enlace-wa svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; }
.enlace-llamar { color: var(--azul-claro); }

/* ---------- 1. Primera pantalla ---------- */
.inicio {
  position: relative;
  padding-top: 1.25rem;
  padding-bottom: 4.5rem;
  overflow: hidden;
}
.inicio__rejilla { display: grid; gap: .5rem; }
.inicio__logo { width: 4.4rem; height: auto; }
.inicio h1 { font-size: clamp(1.7rem, 6.2vw, 3.2rem); }
.inicio__marca {
  color: var(--turquesa-marca);
  font-weight: 700;
  margin-bottom: .5rem;
}
.inicio__bajada { color: var(--texto-suave); }
.inicio .boton-wa { width: 100%; margin-top: .25rem; padding-inline: 1rem; }
.inicio__nota { font-size: .9rem; color: var(--texto-suave); margin-top: .75rem; }

/* El camino: una línea de neón que avanza hacia la meta */
.camino {
  position: absolute;
  left: 0; right: 0; bottom: .5rem;
  width: 100%;
  height: 3.5rem;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(64,184,192,.55));
}
.camino__trazo {
  fill: none;
  stroke: var(--turquesa-marca);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 2 10;
  vector-effect: non-scaling-stroke;
}
.camino__meta {            /* la meta: un punto coral al final del camino */
  position: absolute;
  right: calc(1.25% - 9px);
  bottom: calc(.5rem + 3.5rem * .8 - 9px);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--coral-marca);
  box-shadow: 0 0 10px rgba(248,114,114,.7);
}

/* ---------- Secciones ---------- */
.seccion { padding-block: 3.25rem; }
.seccion--tinte { background: var(--tinte); }

/* 2. Servicios: lista con divisiones, no tarjetas */
.servicios { list-style: none; margin: 0; padding: 0; }
.servicios li {
  padding-block: 1.4rem;
  border-top: 1px solid var(--linea);
}
.servicios li:last-child { border-bottom: 1px solid var(--linea); }
.servicios p { color: var(--texto-suave); margin-bottom: .5rem; }
.aviso-precio { margin-top: 1.5rem; font-size: .95rem; color: var(--texto-suave); }

/* 3. Quiénes somos */
.nosotros { display: grid; gap: 1.5rem; }
.nosotros__cifra {
  font-family: var(--letra-titulos);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--azul-claro);
  margin: 0;
  padding-left: 1rem;
  border-left: 4px solid var(--coral-marca);
}
.nosotros__cifra span {
  display: block;
  font-weight: 800;
  font-size: clamp(2.8rem, 13vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--texto);
  margin-bottom: .25rem;
}

/* 4. Pasos sobre el camino */
.pasos {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: paso;
  position: relative;
}
.pasos::before {           /* línea vertical del camino */
  content: "";
  position: absolute;
  left: 1.2rem; top: 1.5rem; bottom: 1.5rem;
  border-left: 3px dotted var(--turquesa-marca);
}
.pasos li {
  position: relative;
  padding: 0 0 1.75rem 3.6rem;
  counter-increment: paso;
}
.pasos li:last-child { padding-bottom: 0; }
.pasos li::before {
  content: counter(paso);
  position: absolute;
  left: 0; top: -.1rem;
  width: 2.45rem; height: 2.45rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--fondo);
  border: 3px solid var(--azul-marca);
  color: var(--texto);
  font-family: var(--letra-titulos);
  font-weight: 700;
}
.pasos li:last-child::before {
  background: var(--coral-marca);
  border-color: var(--coral-marca);
  color: var(--fondo);
  box-shadow: 0 0 12px rgba(248,114,114,.5);
}
.pasos p { color: var(--texto-suave); margin: 0; }

/* 5. Contactos */
.contacto-principal {
  background: var(--panel);
  color: #fff;
  border-radius: 1.25rem;
  padding: 1.6rem 1.4rem;
}
.contacto-principal h3 { font-size: 1.45rem; font-weight: 700; }
.contacto-principal__para { color: #D6E4F8; margin-bottom: .4rem; }
.contacto-principal .boton-wa { width: 100%; margin-top: .25rem; }

.otros-contactos { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.otros-contactos li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--linea);
}
.otros-contactos p { margin: 0; color: var(--texto-suave); }
.otros-contactos h3 { margin-bottom: .15rem; }

/* 6. Preguntas */
.preguntas details { border-top: 1px solid var(--linea); }
.preguntas details:last-child { border-bottom: 1px solid var(--linea); }
.preguntas summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2.25rem 1.1rem 0;
  font-weight: 700;
  position: relative;
}
.preguntas summary::-webkit-details-marker { display: none; }
.preguntas summary::after {
  content: "+";
  position: absolute; right: .25rem; top: .85rem;
  font-size: 1.5rem; line-height: 1;
  color: var(--turquesa-marca);
}
.preguntas details[open] summary::after { content: "–"; }
.preguntas details p { color: var(--texto-suave); padding-bottom: .5rem; }
.preguntas details a { font-weight: 700; color: var(--verde-claro); }

/* 7. Cierre */
.cierre {
  padding-block: 3.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0, rgba(91,148,226,.18), transparent 60%);
}
.cierre p { margin-inline: auto; color: var(--texto-suave); }
.cierre .boton-wa { width: 100%; max-width: 26rem; }

/* Pie */
.pie {
  border-top: 1px solid var(--linea);
  padding-block: 2rem;
  font-size: .92rem;
  color: var(--texto-suave);
}
.pie strong { color: var(--texto); }
.pie a { font-weight: 700; }
.pie__aviso { font-size: .85rem; }

/* Botón fijo inferior (solo celular) */
.barra-wa {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: var(--alto-barra);
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: var(--verde-wa);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 -4px 16px rgba(0,0,0,.45);
  transition: transform .25s ease;
}
.barra-wa svg { width: 1.4rem; height: 1.4rem; }
.barra-wa.oculta { transform: translateY(110%); }
.barra-wa:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* ---------- Pantallas grandes ---------- */
@media (min-width: 52rem) {
  html { font-size: 125%; }
  :root { --margen: 2rem; --alto-barra: 0px; }

  .inicio { padding-top: 3rem; padding-bottom: 6rem; }
  .inicio__rejilla {
    grid-template-columns: 1.35fr 1fr;
    align-items: center;
    gap: 3rem;
  }
  .inicio__logo { order: 2; width: 100%; max-width: 19rem; justify-self: center; }
  .inicio .boton-wa { width: auto; padding-inline: 1.5rem; }
  .camino { height: 5rem; }
  .camino__meta { bottom: calc(.5rem + 5rem * .8 - 9px); }

  .seccion { padding-block: 4.5rem; }
  .servicios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .servicios li, .servicios li:last-child { border-bottom: 0; }
  .servicios li { border-top: 3px solid var(--azul-marca); }

  .nosotros { grid-template-columns: 1fr 1.4fr; align-items: center; gap: 4rem; }

  .pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .pasos::before {
    left: 1.2rem; right: 1.2rem; top: 1.2rem; bottom: auto;
    border-left: 0; border-top: 3px dotted var(--turquesa-marca);
  }
  .pasos li { padding: 3.6rem 0 0; }

  #contacto .contenedor {
    display: grid; grid-template-columns: 1.2fr 1fr; column-gap: 3rem; align-items: start;
  }
  #contacto h2 { grid-column: 1 / -1; }
  .otros-contactos { margin-top: 0; }
  .otros-contactos li:first-child { border-top: 0; padding-top: 0; }
  .contacto-principal { padding: 2rem; }

  /* En escritorio no hace falta el botón fijo: cada sección tiene su enlace
     y así nunca tapa texto. */
  body { padding-bottom: 0; }
  .barra-wa { display: none; }
}

/* ---------- Movimiento: una sola animación, el camino se dibuja ---------- */
@media (prefers-reduced-motion: no-preference) {
  .camino__trazo {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: dibujar-camino 1.8s .3s ease-out forwards;
  }
  .camino__meta { opacity: 0; animation: aparecer .4s 1.9s forwards; }
  @keyframes dibujar-camino { to { stroke-dashoffset: 0; } }
  @keyframes aparecer { to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .barra-wa { transition: none; }
}
