/* ============================================================ Portada
   Estilos exclusivos de la landing (solo los carga portada.html).
   Paleta institucional: navy #242c4f / celeste #0072bb. */

body { overflow-x: clip; }

.lp-titulo, .lp-hero h1, .lp-stat-num, .lp-precio-num, .lp-cierre h2 {
  font-family: Sora, Inter, "Segoe UI", sans-serif;
}

/* Secciones que ocupan todo el ancho de la ventana (se salen del main) */
.lp-bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.lp-contenido { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------- hero */
.lp-hero {
  position: relative; overflow: clip; color: #fff;
  background:
    radial-gradient(1100px 500px at 85% -10%, #14406b 0%, transparent 60%),
    linear-gradient(160deg, #1b2140 0%, var(--navy) 45%, #0d3c5c 100%);
  padding: 72px 0 84px; margin-top: -32px;
}
.lp-orbe {
  position: absolute; border-radius: 50%; filter: blur(70px);
  opacity: .55; pointer-events: none; will-change: transform;
}
.lp-orbe-a { width: 420px; height: 420px; top: -140px; left: -120px;
             background: #0072bb; }
.lp-orbe-b { width: 360px; height: 360px; bottom: -160px; right: 8%;
             background: #155d8f; }
.lp-orbe-c { width: 220px; height: 220px; top: 30%; right: -80px;
             background: #3b9bd8; opacity: .35; }
.lp-hero::after {            /* trama sutil de puntos, da textura */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 70%);
}
.lp-hero-grid {
  position: relative; z-index: 1; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px;
}
.lp-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  padding: 6px 14px; font-size: .8rem; font-weight: 600; color: #cfe4f5;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lp-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
                   background: #4fc08d; box-shadow: 0 0 8px #4fc08d; }
.lp-hero h1 {
  margin: 18px 0 14px; font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.12; letter-spacing: -.02em; font-weight: 800; color: #fff;
}
.lp-grad {
  background: linear-gradient(92deg, #4db2ef 0%, #8fd3ff 55%, #d0ecff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-hero-baja {
  color: #c6d6e6; font-size: 1.08rem; line-height: 1.6; max-width: 560px;
  margin: 0 0 26px;
}
.lp-hero-baja b { color: #fff; }
.lp-hero-arca {
  display: flex; align-items: flex-start; gap: 12px; max-width: 560px;
  margin: 0 0 26px; padding: 13px 16px; border-radius: 12px;
  font-size: .92rem; line-height: 1.5; color: #d3e6f5;
  background: linear-gradient(120deg, rgba(0,114,187,.28),
              rgba(79,178,239,.14));
  border: 1px solid rgba(79,178,239,.45);
  box-shadow: 0 8px 26px rgba(0,40,70,.25);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lp-hero-arca b { color: #fff; }
.lp-hero-arca-ic { font-size: 1.35rem; flex: none; line-height: 1.2; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  border-radius: 10px; padding: 13px 26px; font-weight: 700; font-size: 1rem;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.lp-btn-primario {
  background: linear-gradient(135deg, #0e86d4, var(--azul));
  color: #fff; box-shadow: 0 8px 24px rgba(0,114,187,.45);
}
.lp-btn-primario:hover { transform: translateY(-2px);
                         box-shadow: 0 12px 30px rgba(0,114,187,.6); }
.lp-btn-vidrio {
  background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lp-btn-vidrio:hover { background: rgba(255,255,255,.16);
                       transform: translateY(-2px); }
.lp-micro { margin: 18px 0 0; color: #8fa6bc; font-size: .85rem; }

/* Conversor animado del hero: el .pem se escanea y se vuelve la tabla */
.lp-demo { position: relative; }
.lp-ventana {
  position: relative; border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.97); color: #2a3540;
  box-shadow: 0 30px 60px rgba(5,15,30,.5), 0 4px 14px rgba(5,15,30,.3);
  transform: rotate(1.6deg);
}
.lp-ventana-barra {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid #e4eaf0;
  background: #f4f7fa; font-size: .78rem; color: #6a7684; font-weight: 600;
}
.lp-punto { width: 10px; height: 10px; border-radius: 50%; }
.lp-punto:nth-child(1) { background: #ff5f57; }
.lp-punto:nth-child(2) { background: #febc2e; }
.lp-punto:nth-child(3) { background: #28c840; }
.lp-ventana-nombre { margin-left: 8px; font-variant-numeric: tabular-nums; }

/* Las dos fases (archivos y tabla) se apilan y se cruzan por opacidad */
.lp-demo-cuerpo { position: relative; height: 214px; overflow: hidden; }
.lp-capa {
  position: absolute; inset: 0; margin: 0;
  transition: opacity .45s ease, transform .45s ease;
}

/* Fase 1: las fichas de los .pem */
.lp-archivos { padding: 14px 16px; }
.lp-archivos-tit { margin: 0 0 10px; font-size: .78rem; font-weight: 600;
                   color: #6a7684; }
.lp-file {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  border: 1px solid #e6edf3; border-radius: 10px; margin-bottom: 8px;
  background: #fff;
}
.lp-file-ic { display: inline-flex; width: 30px; height: 30px; flex: none;
  align-items: center; justify-content: center; border-radius: 8px;
  color: var(--azul); background: #eaf4fb; }
.lp-file-ic svg { width: 16px; height: 16px; }
.lp-file-txt { display: flex; flex-direction: column; line-height: 1.25;
               flex: 1 1 auto; }
.lp-file-txt b { font-size: .82rem; color: #2a3540; }
.lp-file-txt small { font-size: .7rem; color: #7a8794; }
.lp-file-ok { display: inline-flex; width: 20px; height: 20px; flex: none;
  align-items: center; justify-content: center; border-radius: 50%;
  color: #fff; background: #1e9e5a; }
.lp-file-ok svg { width: 12px; height: 12px; }

/* Fase 2: la tabla de totales */
.lp-tabla { width: 100%; border-collapse: collapse; font-size: .74rem;
            opacity: 0; transform: translateY(10px); }
.lp-tabla th { background: var(--navy); color: #fff; padding: 6px 10px;
               text-align: left; font-weight: 600; }
.lp-tabla td { padding: 5px 10px; border-bottom: 1px solid #eef2f6; }
.lp-tabla td.n { text-align: right; font-variant-numeric: tabular-nums; }
.lp-tabla tfoot td { font-weight: 700; color: var(--navy);
                     background: #f4f8fb; border-bottom: 0; }

/* Estados que maneja el JS por data-fase */
.lp-demo[data-fase="tabla"] .lp-archivos {
  opacity: 0; transform: translateY(-12px); }
.lp-demo[data-fase="tabla"] .lp-tabla { opacity: 1; transform: none; }
.lp-demo[data-fase="tabla"] .lp-sello {
  opacity: 1; transform: scale(1) rotate(-3deg); }

/* Las fichas aparecen escalonadas cada vez que arranca la fase archivos */
.lp-demo[data-fase="archivos"] .lp-file {
  opacity: 0; transform: translateY(8px);
  animation: lp-file-in .45s ease forwards;
  animation-delay: calc(var(--i) * .32s + .25s);
}
.lp-demo[data-fase="archivos"] .lp-file-ok {
  opacity: 0; transform: scale(.4);
  animation: lp-ok-in .3s ease forwards;
  animation-delay: calc(var(--i) * .32s + .55s);
}
@keyframes lp-file-in { to { opacity: 1; transform: none; } }
@keyframes lp-ok-in  { to { opacity: 1; transform: none; } }

/* Barra de escaneo que recorre las fichas antes de mostrar la tabla */
.lp-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 40px; opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,114,187,0),
              rgba(79,178,239,.28) 60%, rgba(0,114,187,.5));
  box-shadow: 0 2px 12px rgba(0,114,187,.45);
}
.lp-demo[data-fase="scan"] .lp-scan {
  opacity: 1; animation: lp-escanear 1.2s ease-in-out;
}
@keyframes lp-escanear {
  0%   { top: -40px; }
  100% { top: 214px; }
}

.lp-sello {
  position: absolute; right: -14px; bottom: -16px; display: inline-flex;
  align-items: center; gap: 7px; border-radius: 999px; padding: 9px 16px;
  background: rgba(23,105,64,.9); color: #fff; font-size: .8rem;
  font-weight: 700; box-shadow: 0 10px 24px rgba(10,40,25,.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.7) rotate(-3deg);
  transition: opacity .45s ease .35s, transform .45s ease .35s;
}

/* ------------------------------------------------------------ metricas */
.lp-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  width: 100%; margin-top: -46px; position: relative; z-index: 2;
}
.lp-stat {
  background: rgba(255,255,255,.82); border: 1px solid rgba(221,228,234,.9);
  border-radius: 14px; padding: 18px 22px; text-align: center;
  box-shadow: 0 12px 30px rgba(20,55,88,.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lp-stat-num { display: block; font-size: 1.5rem; font-weight: 800;
               color: var(--navy); letter-spacing: -.01em; }
.lp-stat span:last-child { color: var(--gris); font-size: .85rem;
                           line-height: 1.4; display: block; margin-top: 4px; }

/* --------------------------------------------- flujo piloto automatico */
.lp-flujo {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px;
  width: 100%; margin-top: 8px;
}
.lp-nodo {
  position: relative; background: #fff; border: 1px solid var(--borde);
  border-radius: 16px; padding: 22px 20px; text-align: center;
  box-shadow: 0 2px 10px rgba(20,55,88,.05);
}
.lp-nodo-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; color: var(--azul);
  background: linear-gradient(150deg, #e8f3fb, #d4e9f7);
  border: 1px solid #cfe4f3;
}
.lp-nodo-ic svg { width: 23px; height: 23px; }
.lp-nodo h3 { color: var(--navy); font-size: .95rem; margin: 12px 0 6px; }
.lp-nodo p { margin: 0; font-size: .84rem; line-height: 1.5; color: #47525d; }
.lp-nodo:not(:last-child)::after {   /* flecha que une el circuito */
  content: "→"; position: absolute; right: -21px; top: 26px; z-index: 1;
  color: var(--azul); font-size: 1.25rem; font-weight: 700;
}
.lp-flujo-nota {
  width: 100%; text-align: center; color: var(--gris); font-size: .87rem;
  margin: 2px 0 10px;
}

/* ------------------------------------------------------------ secciones */
.lp-cabecera { text-align: center; max-width: 640px; margin: 34px auto 6px; }
.lp-ojal {
  color: var(--azul); font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.lp-titulo { color: var(--navy); font-size: clamp(1.4rem, 2.6vw, 1.9rem);
             font-weight: 800; letter-spacing: -.015em; margin: 8px 0 10px; }
.lp-baja { color: var(--gris); font-size: 1rem; line-height: 1.55; margin: 0; }

/* Tarjetas de funciones */
.lp-grilla {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; width: 100%;
}
.lp-tarjeta {
  position: relative; background: #fff; border: 1px solid var(--borde);
  border-radius: 16px; padding: 24px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(20,55,88,.05);
  transition: transform .22s ease, box-shadow .22s ease,
              border-color .22s ease;
}
.lp-tarjeta::before {      /* brillo superior que aparece al pasar el mouse */
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--azul), #6fc3f2);
  opacity: 0; transition: opacity .22s ease;
}
.lp-tarjeta:hover {
  transform: translateY(-5px); border-color: #bcd7ea;
  box-shadow: 0 18px 40px rgba(20,55,88,.14);
}
.lp-tarjeta:hover::before { opacity: 1; }
.lp-icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; color: var(--azul);
  background: linear-gradient(150deg, #e8f3fb, #d4e9f7);
  border: 1px solid #cfe4f3;
}
.lp-icono svg { width: 22px; height: 22px; }
.lp-tarjeta h3 { color: var(--navy); font-size: 1.02rem; margin: 14px 0 6px; }
.lp-tarjeta p { margin: 0; font-size: .9rem; line-height: 1.55;
                color: #47525d; }
.lp-tarjeta-arca { border-color: #9ccbe8;
  background: linear-gradient(160deg, #f2f9fe 0%, #e7f3fb 100%); }
.lp-tarjeta-arca::before { opacity: 1; }

/* Pasos */
.lp-pasos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
            width: 100%; counter-reset: paso; }
.lp-paso {
  position: relative; background: #fff; border: 1px solid var(--borde);
  border-radius: 16px; padding: 26px 24px 22px;
  box-shadow: 0 2px 10px rgba(20,55,88,.05);
}
.lp-paso::before {
  counter-increment: paso; content: counter(paso, decimal-leading-zero);
  font-family: Sora, Inter, sans-serif; font-weight: 800; font-size: 2rem;
  background: linear-gradient(160deg, var(--azul), #7cc4ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-paso h3 { color: var(--navy); font-size: 1.02rem; margin: 8px 0 6px; }
.lp-paso p { margin: 0; font-size: .9rem; line-height: 1.55; color: #47525d; }
.lp-paso:not(:last-child)::after {   /* flecha que une los pasos */
  content: "→"; position: absolute; right: -15px; top: 30px; z-index: 1;
  color: #9db9cf; font-size: 1.3rem; font-weight: 700;
}

/* ------------------------------------------------------------- precio */
.lp-precio {
  width: 100%; display: grid; overflow: hidden;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  background: #fff; border: 1px solid var(--borde); border-radius: 18px;
  box-shadow: 0 14px 44px rgba(20,55,88,.12);
}
.lp-precio-lado {
  padding: 34px 32px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--navy) 0%, #0d4a70 100%);
}
.lp-precio-lado::after {
  content: ""; position: absolute; width: 260px; height: 260px;
  border-radius: 50%; background: #0072bb; filter: blur(80px);
  opacity: .5; right: -80px; bottom: -100px;
}
.lp-precio-num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em;
                 position: relative; z-index: 1; }
.lp-precio-nota { color: #b9cbdc; margin: 4px 0 22px; position: relative;
                  z-index: 1; }
.lp-precio-lado .lp-btn { position: relative; z-index: 1; }
.lp-precio-detalle { padding: 30px 32px; }
.lp-precio-detalle ul { list-style: none; margin: 0; padding: 0; }
.lp-precio-detalle li {
  position: relative; padding: 9px 0 9px 32px; line-height: 1.5;
  font-size: .95rem; border-bottom: 1px solid #eef2f6;
}
.lp-precio-detalle li:last-child { border-bottom: 0; }
.lp-precio-detalle li::before {
  content: "✓"; position: absolute; left: 0; top: 8px; width: 21px;
  height: 21px; border-radius: 50%; background: #e3f4ea; color: #1e6e42;
  font-weight: 700; font-size: .8rem; display: inline-flex;
  align-items: center; justify-content: center;
}
.lp-contacto { margin: 14px 0 0; color: var(--gris); font-size: .87rem; }

/* --------------------------------------------------------- cierre final */
.lp-cierre {
  position: relative; overflow: clip; text-align: center; color: #fff;
  background: linear-gradient(150deg, #1b2140 0%, var(--navy) 55%,
              #0d3c5c 100%);
  padding: 60px 0 64px; margin-bottom: -32px;
}
.lp-cierre h2 { position: relative; z-index: 1; font-size: clamp(1.4rem,
                2.8vw, 2rem); font-weight: 800; letter-spacing: -.015em;
                margin: 0 0 10px; }
.lp-cierre p { position: relative; z-index: 1; color: #c6d6e6;
               margin: 0 auto 26px; max-width: 520px; line-height: 1.55; }
.lp-cierre .lp-cta { justify-content: center; position: relative; z-index: 1; }

/* --------------------------------------------------- aparicion al scroll */
.lp-reveal { opacity: 0; transform: translateY(22px); }
.lp-reveal.lp-visto { opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s ease; }
.lp-reveal[data-espera="1"].lp-visto { transition-delay: .1s; }
.lp-reveal[data-espera="2"].lp-visto { transition-delay: .2s; }
.lp-reveal[data-espera="3"].lp-visto { transition-delay: .3s; }

/* Animaciones solo si el usuario no pidio reducir movimiento */
@media (prefers-reduced-motion: no-preference) {
  .lp-orbe-a { animation: lp-flotar 11s ease-in-out infinite; }
  .lp-orbe-b { animation: lp-flotar 14s ease-in-out infinite reverse; }
  .lp-orbe-c { animation: lp-flotar 9s ease-in-out infinite; }
  @keyframes lp-flotar {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(30px, -24px); }
  }
  .lp-hero-copy > * { opacity: 0; animation: lp-entrar .7s ease forwards; }
  .lp-hero-copy > *:nth-child(2) { animation-delay: .1s; }
  .lp-hero-copy > *:nth-child(3) { animation-delay: .2s; }
  .lp-hero-copy > *:nth-child(4) { animation-delay: .3s; }
  .lp-hero-copy > *:nth-child(5) { animation-delay: .4s; }
  .lp-hero-copy > *:nth-child(6) { animation-delay: .5s; }
  .lp-hero-visual { opacity: 0; animation: lp-entrar .8s ease .35s forwards; }
  @keyframes lp-entrar {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
  }
  .lp-ventana { animation: lp-mecer 7s ease-in-out 1.2s infinite; }
  @keyframes lp-mecer {
    0%, 100% { transform: rotate(1.6deg) translateY(0); }
    50%      { transform: rotate(1.6deg) translateY(-8px); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .lp-reveal { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ celulares */
@media (max-width: 860px) {
  /* Blur mas liviano: los celulares sufren con desenfoques grandes */
  .lp-orbe { filter: blur(44px); }
  .lp-orbe-c { display: none; }
  .lp-hero { padding: 44px 0 76px; margin-top: -18px; }
  .lp-hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .lp-hero-visual { max-width: 480px; }
  .lp-stats { grid-template-columns: 1fr; margin-top: -40px; }
  .lp-flujo { grid-template-columns: 1fr; row-gap: 26px; }
  .lp-nodo:not(:last-child)::after { content: "↓"; right: auto; left: 50%;
    transform: translateX(-50%); top: auto; bottom: -24px; }
  .lp-pasos { grid-template-columns: 1fr; }
  .lp-paso:not(:last-child)::after { content: "↓"; right: auto; left: 28px;
                                     top: auto; bottom: -22px; }
  .lp-pasos { row-gap: 26px; }
  .lp-precio { grid-template-columns: 1fr; }
  .lp-cierre { margin-bottom: -18px; }
  .lp-cta .lp-btn { width: 100%; justify-content: center; }
}
