/* ============================================================
   EMERGENTE FLOW — réplica animada
   1) BASE: reproduce exactamente la tipografía y cajas del sitio original
   2) ANIMACIONES: todo lo añadido va marcado con /* + */
   ============================================================ */

/* ---------- 1) BASE (idéntica al original) ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

#emergente-flow { font-size: 17px; line-height: 1.5; }
#emergente-flow a { color: inherit; text-decoration: none; }

#emergente-flow h1,
#emergente-flow h2,
#emergente-flow h3,
#emergente-flow h4,
#emergente-flow h5,
#emergente-flow h6 {
  font-family: Poppins, sans-serif;
  color: #030303;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 15px;
}
#emergente-flow h1 { font-size: 32px; font-weight: 600; }
#emergente-flow h2 {
  font-size: clamp(2.75rem, 5vw, 4.9rem);
  line-height: .98;
  letter-spacing: -.05em;
  margin: 14px 0 24px;
}
#emergente-flow h3 { font-size: 21px; }
#emergente-flow h4 { font-size: 20px; font-weight: 400; }

#emergente-flow p { font-size: 17px; line-height: 1.8; margin: 0 0 20px; }
#emergente-flow small { font-size: .8em; }
#emergente-flow strong { font-weight: 700; }
#emergente-flow img { max-width: 100%; height: auto; }

#emergente-flow section { position: relative; }


/* ============================================================
   2) ANIMACIONES
   ============================================================ */

/* ---------- Entrada inicial (hero) ---------- */
.emg-in {
  opacity: 0;
  transform: translateY(26px);
  animation: emgIn .9s cubic-bezier(.16, .84, .32, 1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes emgIn { to { opacity: 1; transform: none; } }

.emg-line {
  display: block;
  overflow: hidden;
  padding-bottom: .14em;
  margin-bottom: -.14em;
}

/* brillo que recorre la segunda línea del titular (color base intacto) */
.emg-grad {
  background: linear-gradient(100deg, #a5a9f0 0%, #a5a9f0 44%, #d7daff 48%, #ffffff 50%, #d7daff 52%, #a5a9f0 56%, #a5a9f0 100%);
  background-size: 300% 100%;
  background-position: 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: emgIn .9s cubic-bezier(.16,.84,.32,1) forwards,
             emgGrad 7s linear infinite 1.2s;
  animation-delay: var(--d, 0ms), 1.2s;
}
@keyframes emgGrad {
  0%, 45%   { background-position: 0% 0; }
  78%, 100% { background-position: 100% 0; }
}

/* ---------- Revelado al hacer scroll ---------- */
.emg-rv {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .85s cubic-bezier(.16,.84,.32,1) var(--d, 0ms),
              transform .85s cubic-bezier(.16,.84,.32,1) var(--d, 0ms);
  will-change: opacity, transform;
}
.emg-rv.emg-on { opacity: 1; transform: none; }

.emg-from-left  { transform: translateX(-46px) translateY(18px); }
.emg-from-right { transform: translateX(46px)  translateY(18px); }

/* lista que aparece escalonada dentro de las tarjetas No es / Sí es */
.emg-li {
  opacity: 0;
  transform: translateX(14px);
  transition: opacity .55s ease, transform .55s ease;
  transition-delay: calc(var(--i, 0) * 90ms + 220ms);
}
.emg-on .emg-li { opacity: 1; transform: none; }

/* pop con rebote (chips de servicios) */
.emg-pop { transform: translateY(18px) scale(.86); }
.emg-rv.emg-pop { transition-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
.emg-rv.emg-pop.emg-on { transform: none; }

/* línea superior de los casos que se dibuja */
.emg-case { position: relative; border-top-color: transparent !important; }
.emg-case::before {
  content: "";
  position: absolute;
  top: -3px; left: 0;
  height: 3px; width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .9s cubic-bezier(.16,.84,.32,1);
  transition-delay: calc(var(--d, 0ms) + 120ms);
}
.emg-case.emg-on::before { transform: scaleX(1); }
.emg-case:nth-of-type(1)::before { background: #0048ff; }
.emg-case:nth-of-type(2)::before { background: #2adda1; }
.emg-case:nth-of-type(3)::before { background: #ff6833; }
.emg-case:nth-of-type(4)::before { background: #68cefa; }
.emg-case { transition-property: opacity, transform; }
.emg-case:hover h3 { color: #2adda1; }
.emg-case h3 { transition: color .3s ease; }

/* ---------- Hero: fondo vivo ---------- */
.emg-hero { overflow: hidden; }
.emg-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(42,221,161,.09), transparent 42%);
  animation: emgDrift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes emgDrift {
  from { transform: translate3d(0,0,0) scale(1); opacity: .75; }
  to   { transform: translate3d(5%, -4%, 0) scale(1.12); opacity: 1; }
}

.emg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 1;
}
.emg-blob-1 { width: 420px; height: 420px; top: -80px; left: -60px;  background: rgba(0,72,255,.26);  animation: emgFloatA 18s ease-in-out infinite; }
.emg-blob-2 { width: 330px; height: 330px; bottom: -70px; left: 32%; background: rgba(42,221,161,.10); animation: emgFloatB 22s ease-in-out infinite; }
.emg-blob-3 { width: 300px; height: 300px; top: 18%; right: -70px;   background: rgba(165,169,240,.14); animation: emgFloatA 26s ease-in-out infinite reverse; }
.emg-blob-4 { width: 460px; height: 460px; bottom: -140px; left: -90px; background: rgba(42,221,161,.10); animation: emgFloatB 24s ease-in-out infinite; }
@keyframes emgFloatA { 50% { transform: translate(60px, 44px) scale(1.14); } }
@keyframes emgFloatB { 50% { transform: translate(-54px, -40px) scale(1.1); } }

/* ---------- Planeta ---------- */
.emg-planet { will-change: transform; }
.emg-ring-1 { animation: emgSpin 34s linear infinite; }
.emg-ring-2 { animation: emgSpin 22s linear infinite reverse; }
.emg-ring-1::after,
.emg-ring-2::after {
  content: "";
  position: absolute;
  top: -4px; left: 50%;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #68cefa;
  box-shadow: 0 0 16px 3px rgba(104,206,250,.8);
}
.emg-ring-2::after { background: #a5a9f0; box-shadow: 0 0 16px 3px rgba(165,169,240,.8); }
@keyframes emgSpin { to { transform: rotate(360deg); } }

.emg-core { animation: emgBreathe 7s ease-in-out infinite; }
@keyframes emgBreathe {
  50% {
    transform: scale(1.045);
    box-shadow: 0 36px 100px rgba(0,72,255,.72);
  }
}
.emg-iso { animation: emgFloatY 5.5s ease-in-out infinite; }
@keyframes emgFloatY { 50% { transform: translateY(-14px); } }

.emg-chip { animation: emgFloatY 4.6s ease-in-out infinite; transition: transform .3s ease; }
.emg-chip-1 { animation-duration: 5.2s; animation-delay: -.8s; }
.emg-chip-2 { animation-duration: 6.1s; animation-delay: -2.2s; }
.emg-chip-3 { animation-duration: 4.8s; animation-delay: -3.4s; }
.emg-planet:hover .emg-chip { transform: scale(1.12); }

/* ---------- Botones y enlaces ---------- */
.emg-btn, .emg-wa, .emg-sticky-cta {
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, background .25s ease;
}
.emg-btn:hover, .emg-wa:hover, .emg-sticky-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(42,221,161,.34);
}
.emg-btn-ghost:hover { background: rgba(255,255,255,.1); box-shadow: 0 16px 36px rgba(255,255,255,.14); }

/* destello que cruza el botón */
.emg-shine { position: relative; overflow: hidden; transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease; }
.emg-shine::after {
  content: "";
  position: absolute;
  top: 0; left: -140%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-20deg);
  animation: emgShine 4.5s ease-in-out infinite;
}
@keyframes emgShine {
  0%, 62% { left: -140%; }
  92%, 100% { left: 160%; }
}
.emg-shine:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.2); }

/* subrayado animado en los enlaces del menú */
.emg-link { position: relative; padding-bottom: 3px; }
.emg-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: #2adda1;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .34s cubic-bezier(.16,.84,.32,1);
}
.emg-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* indicador de scroll al pie del hero */
.emg-scrollcue {
  position: absolute;
  left: 50%; bottom: 26px;
  width: 26px; height: 42px;
  margin-left: -13px;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 14px;
  z-index: 3;
  animation: emgIn 1s ease 1.1s both;
}
.emg-scrollcue span {
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: #2adda1;
  animation: emgWheel 1.9s ease-in-out infinite;
}
@keyframes emgWheel { 0%,100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(14px); opacity: .1; } }

/* ---------- Marquesinas (sustituyen a <marquee>, mismo efecto pero fluido) ---------- */
.emg-marquee { overflow: hidden; }
.emg-track {
  display: flex;
  width: max-content;
  align-items: flex-start;
  animation: emgMarquee linear infinite;
  will-change: transform;
}
.emg-track > span { flex: 0 0 auto; transition: transform .3s ease, box-shadow .3s ease; }
.emg-track > span:hover { transform: translateY(-7px) scale(1.02); box-shadow: 0 22px 44px rgba(0,28,93,.18) !important; }
.emg-marquee:hover .emg-track { animation-play-state: paused; }
@keyframes emgMarquee { to { transform: translateX(-50%); } }
.emg-marquee[data-dir="right"] .emg-track { animation-direction: reverse; }

/* ---------- Tarjetas ---------- */
.emg-card { transition: transform .4s cubic-bezier(.16,.84,.32,1), box-shadow .4s ease, opacity .85s ease; }
.emg-card:hover { transform: translateY(-9px); }
.emg-step:hover { box-shadow: 0 30px 60px rgba(0,28,93,.26) !important; }

.emg-badge { transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.emg-card:hover .emg-badge,
.emg-opt:hover .emg-badge { transform: rotate(360deg) scale(1.12); }

.emg-pill { transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease; cursor: default; }
.emg-pill:hover { transform: translateY(-5px) scale(1.06); box-shadow: 0 14px 30px rgba(0,28,93,.2); }

.emg-ribbon { animation: none; }
.emg-rv.emg-ribbon.emg-on { animation: emgPulse 3.4s ease-in-out 1s infinite; }
@keyframes emgPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,104,51,.45); }
  55% { box-shadow: 0 0 0 16px rgba(255,104,51,0); }
}

/* paquetes */
.emg-pack { transition: transform .5s cubic-bezier(.16,.84,.32,1), box-shadow .5s ease, opacity .85s ease; }
.emg-pack:hover { transform: translateY(-6px); box-shadow: 0 36px 80px rgba(0,28,93,.2) !important; }

.emg-opt {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.16,.84,.32,1), transform .45s cubic-bezier(.16,.84,.32,1), box-shadow .35s ease;
  transition-delay: var(--d, 0ms), var(--d, 0ms), 0ms;
}
.emg-on .emg-opt { opacity: 1; transform: none; }
.emg-on .emg-opt:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 26px 48px rgba(0,28,93,.2) !important; }

.emg-tag-pulse { animation: emgTag 2.6s ease-in-out infinite; }
@keyframes emgTag { 50% { transform: translateY(-3px) scale(1.04); } }

/* redes sociales */
.emg-social { transition: transform .3s cubic-bezier(.34,1.56,.64,1), background .3s ease, border-color .3s ease, opacity .7s ease; }
.emg-social:hover { transform: translateY(-5px) scale(1.1); background: #0048ff; border-color: #0048ff !important; }

/* ---------- Barra superior flotante ---------- */
#emg-sticky {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: rgba(0, 10, 45, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  transform: translateY(-100%);
  transition: transform .45s cubic-bezier(.16,.84,.32,1);
}
#emg-sticky.emg-show { transform: none; }
.emg-sticky-inner {
  max-width: 1180px;
  margin: auto;
  padding: 12px 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.emg-sticky-inner img { width: 132px; display: block; }
.emg-sticky-inner nav { display: flex; align-items: center; gap: 22px; }
.emg-sticky-inner nav a {
  color: #fff;
  font-family: Outfit, Poppins, Arial, sans-serif;
  font-size: 15px;
  text-decoration: none;
  opacity: .85;
  transition: opacity .25s ease;
}
.emg-sticky-inner nav a:hover { opacity: 1; }
.emg-sticky-cta {
  background: #2adda1;
  color: #001c5d !important;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 100px;
  opacity: 1 !important;
}
@media (max-width: 760px) {
  .emg-sticky-inner nav a:not(.emg-sticky-cta) { display: none; }
}

/* barra de progreso de lectura */
#emg-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  z-index: 1000;
  pointer-events: none;
}
#emg-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2adda1, #68cefa, #0048ff);
  transition: width .12s linear;
}

/* ---------- Accesibilidad: respeta "reducir movimiento" ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .emg-in, .emg-rv, .emg-li, .emg-opt { opacity: 1 !important; transform: none !important; }
  .emg-case::before { transform: scaleX(1) !important; }
  .emg-track { animation: none !important; }
}
