/* Web pública de Trimestra: mismos tokens que la app (docs/ESPECIFICACION.md §9). */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fuentes/manrope-latin.woff2') format('woff2');
}

:root {
  --navy: #10193a;
  --navy-2: #142142;
  --navy-3: #1f2b55;
  --lima: #c3f25c;
  --lima-2: #b5e550;
  --fondo: #f2f3ee;
  --tarjeta: #ffffff;
  --texto: #12172b;
  --texto-2: #646a7d;
  --menu: #aeb6d6;
  --naranja: #f08a3c;
  --radio: 20px;
  --ancho: 1160px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

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

a {
  color: var(--navy);
}

a:focus-visible,
.boton:focus-visible {
  outline: 3px solid var(--lima);
  outline-offset: 3px;
}

.saltar {
  position: absolute;
  left: -9999px;
}

.saltar:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--lima);
  color: var(--navy);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
}

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

/* Cabecera */
.cabecera {
  background: var(--navy);
  color: #fff;
}

.cabecera .contenedor {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  flex-wrap: wrap;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.marca img {
  width: 30px;
  height: 30px;
}

.menu {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
  align-items: center;
}

.menu a {
  color: var(--menu);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 10px;
}

.menu a:hover,
.menu a[aria-current='page'] {
  color: #fff;
  background: var(--navy-3);
}

.acciones {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botones */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  border: 0;
  white-space: nowrap;
}

.boton-lima {
  background: var(--lima);
  color: var(--navy);
}

.boton-lima:hover {
  background: var(--lima-2);
}

.boton-oscuro {
  background: var(--navy);
  color: #fff;
}

.boton-claro {
  background: #fff;
  color: var(--navy);
}

.boton-borde {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--navy-3);
}

.boton-borde:hover {
  background: var(--navy-3);
}

/* Portada */
.portada {
  background: var(--navy);
  color: #fff;
  padding: 56px 0 0;
  overflow: hidden;
}

.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-3);
  color: var(--lima);
  font-weight: 800;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
}

.etiqueta::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lima);
}

h1,
h2,
h3 {
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0;
}

h1 {
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 800;
  margin: 20px 0 18px;
  max-width: 16ch;
}

h1 em {
  font-style: normal;
  color: var(--lima);
}

.entradilla {
  color: var(--menu);
  font-size: clamp(17px, 2vw, 20px);
  max-width: 60ch;
  margin: 0 0 28px;
}

.nota {
  color: var(--menu);
  font-size: 14px;
  margin: 14px 0 0;
}

.captura {
  margin: 48px auto 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 60px rgba(195, 242, 92, 0.12);
  border: 8px solid var(--navy-3);
  border-bottom: 0;
}

/* Secciones */
.seccion {
  padding: 80px 0;
}

.seccion-titulo {
  max-width: 720px;
  margin-bottom: 40px;
}

.seccion-titulo h2 {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
}

.seccion-titulo p {
  color: var(--texto-2);
  margin: 14px 0 0;
  font-size: 18px;
}

.rejilla {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.tarjeta {
  background: var(--tarjeta);
  border-radius: var(--radio);
  padding: 28px;
}

.tarjeta h3 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tarjeta p {
  color: var(--texto-2);
  margin: 0;
}

.icono {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--lima);
  font-weight: 800;
  margin-bottom: 18px;
}

.pasos {
  counter-reset: paso;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pasos li {
  counter-increment: paso;
}

.pasos li::before {
  content: counter(paso);
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--lima);
  color: var(--navy);
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 18px;
}

.dos-columnas {
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: center;
}

.lista-check {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.lista-check li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 14px;
}

.lista-check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lima)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2310193A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

.captura-plana {
  border-radius: 22px;
  border: 8px solid #fff;
  box-shadow: 0 30px 70px rgba(16, 25, 58, 0.15);
}

.banda-oscura {
  background: var(--navy);
  color: #fff;
}

.banda-oscura .seccion-titulo p,
.banda-oscura .tarjeta p {
  color: var(--menu);
}

.banda-oscura .tarjeta {
  background: var(--navy-2);
}

.banda-oscura .icono {
  background: var(--navy-3);
}

/* Calculadora de ahorro */
.ahorro {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  background: #fff;
  border-radius: 28px;
  padding: clamp(24px, 4vw, 48px);
}

.ahorro h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  margin: 16px 0 12px;
}

.ahorro-texto > p {
  color: var(--texto-2);
  margin: 0 0 24px;
}

.etiqueta-clara {
  background: var(--fondo);
  color: var(--navy);
}

.etiqueta-clara::before {
  background: var(--lima-2);
}

.calculadora {
  display: grid;
  gap: 14px;
}

.calculadora label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
}

.calculadora input {
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  min-height: 52px;
  width: 100%;
  max-width: 220px;
  padding: 0 16px;
  border-radius: 12px;
  border: 2px solid #dfe1d8;
  background: var(--fondo);
  font-variant-numeric: tabular-nums;
}

.calculadora input:focus {
  outline: 3px solid var(--lima);
  outline-offset: 2px;
  border-color: var(--navy);
}

.ahorro-resultado {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comparacion {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.comparacion > div,
.ahorro-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--fondo);
  border-radius: 20px;
  padding: 20px 22px;
}

.ahorro-total {
  background: var(--navy);
  color: #fff;
}

.dato-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--texto-2);
}

.ahorro-total .dato-titulo,
.ahorro-total .dato-nota {
  color: var(--menu);
}

.dato-cifra {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.dato-gris {
  color: var(--texto-2);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--naranja);
}

.dato-lima {
  color: var(--lima);
}

.dato-nota {
  font-size: 14px;
  color: var(--texto-2);
}

.dato-dinero {
  margin-top: 8px;
  font-weight: 800;
  color: #fff;
}

.dato-letra {
  margin: 0;
  font-size: 13px;
  color: var(--texto-2);
}

/* Precios */
.planes {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: stretch;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan.destacado {
  background: var(--navy);
  color: #fff;
}

.plan.destacado p,
.plan.destacado li {
  color: var(--menu);
}

.plan-nombre {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.plan-nombre span {
  background: var(--lima);
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.precio {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.precio small {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--texto-2);
}

.tarjeta.plan .precio {
  color: var(--navy);
}

.tarjeta.plan.destacado .precio {
  color: var(--lima);
}

.plan.destacado .precio small {
  color: var(--menu);
}

.plan .anual {
  font-weight: 700;
  margin: 0;
}

.plan .boton {
  margin-top: auto;
}

.plan ul {
  margin: 0;
  padding-left: 20px;
  color: var(--texto-2);
}

.medida {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

/* Preguntas */
.preguntas details {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 12px;
}

.preguntas summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 18px;
}

.preguntas details p {
  color: var(--texto-2);
  margin: 12px 0 0;
}

/* Llamada final */
.llamada {
  background: var(--navy);
  color: #fff;
  border-radius: 28px;
  padding: clamp(32px, 6vw, 64px);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}

.llamada h2 {
  font-size: clamp(28px, 4vw, 40px);
  max-width: 18ch;
}

.llamada p {
  color: var(--menu);
  margin: 10px 0 0;
}

/* Textos largos (sobre nosotros y legal) */
.texto {
  max-width: 760px;
}

.texto h1 {
  color: var(--navy);
  max-width: none;
  font-size: clamp(34px, 5vw, 48px);
}

.texto h2 {
  font-size: 24px;
  margin: 36px 0 10px;
}

.texto p,
.texto li {
  color: #3a4058;
}

.pendiente {
  background: #fcefd2;
  color: #7a4d00;
  border-radius: 6px;
  padding: 0 6px;
  font-weight: 700;
}

/* Pie */
.pie {
  background: var(--navy);
  color: var(--menu);
  padding: 48px 0 32px;
  font-size: 15px;
}

.pie .contenedor {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.pie h2 {
  color: #fff;
  font-size: 16px;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.pie ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pie li {
  margin-bottom: 8px;
}

.pie a {
  color: var(--menu);
  text-decoration: none;
}

.pie a:hover {
  color: #fff;
  text-decoration: underline;
}

.pie .legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--navy-3);
  padding-top: 20px;
  font-size: 14px;
}

@media (max-width: 760px) {
  .contenedor {
    padding: 0 16px;
  }

  .cabecera .contenedor {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .menu {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  .acciones {
    margin-left: auto;
  }

  .acciones .boton {
    min-height: 44px;
    padding: 0 16px;
    font-size: 15px;
  }

  .seccion {
    padding: 56px 0;
  }

  .captura {
    border-width: 4px;
    border-radius: 14px 14px 0 0;
  }
}

/* --- Movimiento (sin él si el sistema pide menos movimiento) ---------------------------- */
.escena {
  position: relative;
  margin-top: 48px;
  perspective: 1800px;
}

.escena .captura {
  margin-top: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .escena .captura {
    transform: rotateX(var(--giro, 16deg)) scale(var(--escala, 0.94));
    transform-origin: 50% 0;
    transition: transform 0.12s linear;
    will-change: transform;
  }

  .portada h1,
  .portada .entradilla,
  .portada .acciones,
  .portada .etiqueta,
  .portada .nota {
    animation: subir 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .portada .entradilla {
    animation-delay: 0.08s;
  }

  .portada .acciones {
    animation-delay: 0.16s;
  }

  .portada .nota {
    animation-delay: 0.24s;
  }

  .escena {
    animation: subir 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes subir {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Avisos flotantes sobre la captura: se encienden uno tras otro, en bucle. */
.avisos {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.aviso {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 16px 10px 10px;
  border-radius: 16px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 18px 40px rgba(16, 25, 58, 0.28);
  white-space: nowrap;
  opacity: 0;
}

.aviso-icono {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--lima);
  color: var(--navy);
  font-size: 14px;
}

.aviso-icono-oscuro {
  background: var(--navy);
  color: var(--lima);
}

.aviso-1 {
  top: 14%;
  right: -12px;
}

.aviso-2 {
  top: 42%;
  left: -14px;
}

.aviso-3 {
  top: 66%;
  right: 6%;
}

@media (prefers-reduced-motion: no-preference) {
  .aviso {
    animation: aviso 9s infinite;
  }

  .aviso-2 {
    animation-delay: 3s;
  }

  .aviso-3 {
    animation-delay: 6s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aviso-1 {
    opacity: 1;
  }
}

@keyframes aviso {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  6%,
  30% {
    opacity: 1;
    transform: none;
  }
  38%,
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

/* Aparición al bajar: solo si hay JavaScript y no se pide menos movimiento. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .aparecer {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
      transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .aparecer.visible {
    opacity: 1;
    transform: none;
  }

  .rejilla > .aparecer:nth-child(2),
  .planes > .aparecer:nth-child(2) {
    transition-delay: 0.08s;
  }

  .rejilla > .aparecer:nth-child(3),
  .planes > .aparecer:nth-child(3) {
    transition-delay: 0.16s;
  }

  .rejilla > .aparecer:nth-child(4) {
    transition-delay: 0.24s;
  }
}

/* Tarjetas que se elevan y botones con un brillo al pasar por encima. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tarjeta,
  .captura-plana {
    transition:
      transform 0.25s ease,
      box-shadow 0.25s ease,
      opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .tarjeta:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(16, 25, 58, 0.1);
  }

  .banda-oscura .tarjeta:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  }

  .boton {
    position: relative;
    overflow: hidden;
    transition:
      transform 0.2s ease,
      background-color 0.2s ease;
  }

  .boton:hover {
    transform: translateY(-1px);
  }

  .boton-lima::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
    transform: translateX(-120%);
  }

  .boton-lima:hover::after {
    transform: translateX(120%);
    transition: transform 0.7s ease;
  }
}

@media (max-width: 760px) {
  .escena {
    margin-top: 32px;
  }

  .aviso {
    font-size: 12px;
    padding: 6px 10px 6px 6px;
    border-radius: 12px;
  }

  .aviso-icono {
    min-width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .aviso-1 {
    right: 4px;
  }

  .aviso-2 {
    left: 4px;
  }
}
