/* ==========================================================================
   SAVIA — estilos compartidos del sitio (portada y páginas legales).
   Lo propio de la portada está en inicio.css.
   Colores y tipografía de la marca (ver lib/theme.ts en la app).
   ========================================================================== */

:root {
  --ambar: #FFBF00;
  --ambar-oscuro: #E0A800;
  --ambar-suave: #FFF6DB;
  --blanco: #FFFFFF;
  --superficie: #F9FAFB;
  --texto: #111827;
  --secundario: #6B7280;
  --apagado: #9CA3AF;
  --borde: #E5E7EB;

  --azul: #1D9BF0;
  --gris: #9CA3AF;

  --radio: 20px;
  --radio-chico: 12px;
  --sombra: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .06);
  --ancho: 1160px;
  --alto-encabezado: 72px;

  --fuente: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--alto-encabezado) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.65;
  color: var(--texto);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.15rem; }

p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ambar);
  outline-offset: 3px;
  border-radius: 6px;
}

.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 24px;
}

.contenedor--angosto { max-width: 800px; }

.saltar {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--texto);
  color: var(--blanco);
  padding: 10px 16px;
  border-radius: var(--radio-chico);
  text-decoration: none;
}
.saltar:focus { top: 12px; }

/* ---------- Botones ---------- */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 22px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
}

.boton--grande { padding: 14px 28px; font-size: 1rem; }

.boton--primario {
  background: var(--ambar);
  color: var(--texto);
  box-shadow: 0 6px 18px rgba(255, 191, 0, .35);
}
.boton--primario:hover { background: var(--ambar-oscuro); transform: translateY(-1px); }

.boton--secundario {
  background: var(--blanco);
  color: var(--texto);
  border-color: var(--borde);
}
.boton--secundario:hover { border-color: var(--texto); transform: translateY(-1px); }

/* ---------- Encabezado ---------- */

.encabezado {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--alto-encabezado);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}

.encabezado.con-sombra {
  border-bottom-color: var(--borde);
  box-shadow: 0 4px 20px rgba(17, 24, 39, .05);
}

.encabezado__fila {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Imagotipo: isotipo + logotipo, arriba a la izquierda */
.imagotipo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--texto);
  flex-shrink: 0;
}

.imagotipo__isotipo {
  width: 40px;
  height: 40px;
  border-radius: 22%;
}

.imagotipo__palabra {
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: .32em;
  /* El tracking agrega espacio después de la última letra; se compensa. */
  margin-right: -.32em;
}

.menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.menu a:not(.boton) {
  font-size: .92rem;
  font-weight: 600;
  color: var(--secundario);
  text-decoration: none;
  position: relative;
  transition: color .2s;
}

.menu a:not(.boton)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--ambar);
  transform: scaleX(0);
  transition: transform .25s;
}

.menu a:not(.boton):hover,
.menu a.activo { color: var(--texto); }

.menu a:not(.boton):hover::after,
.menu a.activo::after { transform: scaleX(1); }

.menu-boton {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.menu-boton span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--texto);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

.menu-boton[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-boton[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-boton[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Elementos comunes ---------- */

.etiqueta {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ambar-oscuro);
  margin-bottom: 14px;
}

.etiqueta--clara { color: var(--ambar); }

.resalte {
  background: linear-gradient(transparent 62%, rgba(255, 191, 0, .45) 62%);
  padding: 0 .05em;
}

.seccion {
  padding: 104px 0;
}

.seccion--suave { background: var(--superficie); }

.seccion__cabecera {
  max-width: 760px;
  margin-bottom: 56px;
}

.seccion__bajada {
  margin-top: 14px;
  color: var(--secundario);
}


/* ---------- Insignias (las mismas de la app) ---------- */

.insignia {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.insignia svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: var(--blanco);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.insignia--azul { background: var(--azul); }
.insignia--gris { background: var(--gris); }
.insignia--ambar { background: var(--ambar); }
.insignia--vacia {
  background: transparent;
  border: 2px dashed var(--borde);
}

.insignia--mini { width: 16px; height: 16px; }
.insignia--chica { width: 22px; height: 22px; }
.insignia--grande { width: 72px; height: 72px; }
.insignia--grande svg { stroke-width: 2.6; }

/* El ✓ de las insignias grandes se dibuja al aparecer. */
.js .insignia--grande .insignia__check {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset .6s .35s cubic-bezier(.65, 0, .35, 1);
}

.js .visible .insignia--grande .insignia__check { stroke-dashoffset: 0; }

.nombre-insignia {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--texto);
  white-space: nowrap;
}


/* ---------- Preguntas ---------- */

.preguntas { display: grid; gap: 12px; }

.pregunta {
  border: 1px solid var(--borde);
  border-radius: var(--radio-chico);
  background: var(--blanco);
  transition: border-color .2s, box-shadow .2s;
}

.pregunta[open] { border-color: var(--ambar); box-shadow: var(--sombra); }

.pregunta summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 56px 20px 24px;
  font-weight: 600;
  position: relative;
}

.pregunta summary::-webkit-details-marker { display: none; }

.pregunta summary::after {
  content: '';
  position: absolute;
  right: 24px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--secundario);
  border-bottom: 2px solid var(--secundario);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .25s;
}

.pregunta[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

.pregunta p {
  padding: 0 24px 22px;
  color: var(--secundario);
}


/* ---------- Pie ---------- */

.pie {
  background: var(--blanco);
  border-top: 1px solid var(--borde);
  padding: 48px 0 28px;
}

.pie__fila {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.imagotipo--pie .imagotipo__isotipo { width: 34px; height: 34px; }
.imagotipo--pie .imagotipo__palabra { font-size: 1.1rem; }

.pie__sigla {
  margin-top: 12px;
  font-size: .85rem;
  color: var(--secundario);
  max-width: 22em;
}

.pie__enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.pie__enlaces a {
  font-size: .92rem;
  font-weight: 600;
  color: var(--secundario);
  text-decoration: none;
}

.pie__enlaces a:hover { color: var(--texto); text-decoration: underline; text-underline-offset: 4px; }

.pie__legal {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--borde);
  font-size: .85rem;
  color: var(--apagado);
}

/* ---------- Páginas legales ---------- */

.legal {
  padding: 96px 0 120px;
  min-height: calc(100vh - var(--alto-encabezado) - 200px);
}

.legal h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 18px; }

.legal__aviso {
  margin-top: 28px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--ambar-suave);
  border-radius: var(--radio);
  padding: 26px 28px;
}

.legal__aviso svg {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--ambar-oscuro);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legal__aviso p + p { margin-top: 8px; color: var(--secundario); }

.legal__volver { margin-top: 36px; }


/* ---------- Animaciones al aparecer ---------- */

.js .revelar {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s cubic-bezier(.16, 1, .3, 1), transform 1s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--d, 0s);
}

.js .revelar.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .revelar { opacity: 1; transform: none; transition: none; }
  .boton { transition: none; }
}

/* ---------- Responsivo ---------- */

@media (max-width: 900px) {
  .menu-boton { display: flex; }

  .menu {
    position: fixed;
    top: var(--alto-encabezado);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 24px;
    background: var(--blanco);
    border-bottom: 1px solid var(--borde);
    box-shadow: 0 16px 30px rgba(17, 24, 39, .08);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }

  .menu.abierto { opacity: 1; transform: none; visibility: visible; }

  .menu a:not(.boton) {
    padding: 14px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--borde);
  }

  .menu a:not(.boton)::after { display: none; }
  .menu__cta { margin-top: 18px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .contenedor { padding: 0 16px; }
  .imagotipo__palabra { letter-spacing: .26em; margin-right: -.26em; }
}
