/* Estilos SOLO para la página principal (index.php)
   Se activan con body.home para no afectar el resto del sitio.
*/

body.home {
  font-family: 'Inter', 'Poppins', sans-serif;
  --home-page-bg:
    radial-gradient(circle at 20% 20%, rgba(195, 0, 255, 0.16) 0%, rgba(195, 0, 255, 0) 42%),
    radial-gradient(circle at 80% 70%, rgba(123, 1, 160, 0.14) 0%, rgba(123, 1, 160, 0) 48%),
    linear-gradient(135deg, rgba(253, 251, 255, 1) 0%, rgba(243, 232, 255, 1) 100%);
}

/* Scroll full-screen tipo landing (secciones 100vh) */
body.home {
  height: 100vh;
  overflow: hidden;
}

body.home .home-scroll {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
  background: var(--home-page-bg);
}

body.home .home-section {
  position: relative;
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.1rem, 4.5vw, 3.2rem) clamp(1rem, 5vw, 4rem);
  background: transparent;
}

body.home .home-section-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(40px, 8vw, 120px);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(253, 251, 255, 0.95) 100%);
  pointer-events: none;
}

/* Sin animación de "aparecer" al hacer scroll: todo visible siempre */
body.home .home-animate {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Transiciones modernas y respetuosas con accesibilidad */
body.home .fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: homeFade 900ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

body.home .delay-1 { animation-delay: 120ms; }
body.home .delay-2 { animation-delay: 240ms; }
body.home .delay-3 { animation-delay: 360ms; }

@keyframes homeFade {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body.home {
    overflow: auto;
    height: auto;
  }

  body.home .home-scroll {
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }

  body.home .home-section {
    scroll-snap-align: none;
  }

  body.home .fade-in {
    opacity: 1;
    transform: none;
    animation: none;
  }

  body.home .home-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }

  body.home .pulse-ring {
    animation: none;
  }
}

/* Layout general del home */
body.home #main_container {
  position: relative;
  padding-top: clamp(1rem, 3vw, 2rem);
  padding-bottom: clamp(1.25rem, 3vw, 2.5rem);
}

/* Intro como hero (más bajo que full-screen) */
body.home .home-section.home-intro {
  min-height: clamp(360px, 48vh, 560px);
}

/* =========================================================
   INTRO: título + logos con imagen derecha grande
   (Evitamos layout-shift por typing: logo en absoluto + placeholder)
   ========================================================= */

body.home .home-section.home-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(22px, 4vh, 52px) clamp(18px, 4vw, 72px);
  padding-top: clamp(70px, 10vh, 120px);
  padding-bottom: clamp(10px, 2.2vh, 20px);
  overflow: hidden;
}

body.home .home-section.home-intro .home-intro-logo {
  transform: none;
}

/* Logo IECM: esquina superior izquierda */
body.home .home-section.home-intro .home-intro-logo-1 {
  position: absolute;
  top: clamp(16px, 3vh, 26px);
  left: clamp(16px, 3vw, 30px);
  width: clamp(160px, 14vw, 240px);
  height: auto;
  opacity: 0.98;
  margin: 0;
}

/* Imagen principal derecha: casi media sección */
body.home .home-section.home-intro .home-intro-logo-2 {
  position: absolute;
  right: clamp(12px, 3vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  width: min(58vw, 820px);
  max-width: 100%;
  height: auto;
  max-height: clamp(220px, 58vh, 560px);
  object-fit: contain;
  filter: drop-shadow(0 18px 42px rgba(0,0,0,.28));
  pointer-events: none;
}

body.home .home-section.home-intro .home-intro-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.home .home-section.home-intro .home-title {
  max-width: 100%;
  margin: 0;
}

body.home .home-section.home-intro .home-edition {
  margin: clamp(8px, 1vh, 12px) 0 0 !important;
  line-height: 1.02;
  font-size: clamp(1.05rem, 2.3vw, 1.65rem);
}

body.home .home-section.home-intro .home-subtitle {
  margin: 0 !important;
  line-height: 1.06;
  font-size: clamp(1.0rem, 2.1vw, 1.45rem);
}

/* Si por algún motivo hay estilos globales para <p>, esto asegura que queden pegados */
body.home .home-section.home-intro .home-edition + .home-subtitle {
  margin-top: clamp(0.18rem, 0.6vh, 0.45rem) !important;
}

/* Desplazar un poco a la derecha (solo estos dos textos) */
body.home .home-section.home-intro .home-edition,
body.home .home-section.home-intro .home-subtitle {
  padding-left: 0;
}

@media (max-width: 992px) {
  body.home .home-section.home-intro {
    padding-left: clamp(16px, 5vw, 24px);
    padding-right: clamp(16px, 5vw, 24px);
    padding-top: clamp(78px, 11vh, 126px);
  }

  body.home .home-section.home-intro .home-intro-logo-1 {
    width: clamp(150px, 34vw, 220px);
    left: 50%;
    transform: translateX(-50%);
  }

  body.home .home-section.home-intro .home-intro-logo-2 {
    right: 50%;
    transform: translate(50%, -50%);
    width: min(92vw, 560px);
    max-height: 240px;
    margin: 0;
  }
}

@media (max-width: 480px) {
  body.home .home-section.home-intro {
    padding-top: 92px;
  }

  body.home .home-section.home-intro .home-intro-logo-1 {
    top: 14px;
  }
}

/* Nota: el intro ya se maneja con grid (sin logos absolutos) */

/* =========================================================
   SPLIT: Info izquierda + Hero derecha + divisor
   ========================================================= */

.home-split {
  scroll-snap-align: start;
  min-height: 100vh;
  padding: clamp(6px, 1.2vh, 12px) clamp(14px, 3vw, 44px) clamp(20px, 3.2vh, 42px);
}

.home-split-inner {
  width: min(1400px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: clamp(26px, 3.2vw, 54px);
  padding-top: clamp(0.2rem, 0.9vw, 0.5rem);
}

@media (max-width: 1200px) {
  .home-split-inner {
    width: min(1100px, 100%);
  }

  /* Responsivo/tablet: centrar texto y botón de registro */
  .home-split-right .hero.hero-fullpage .hero-inner {
    text-align: center !important;
    align-items: center;
  }

  body.home .home-split-right .hero h1 {
    text-align: center !important;
    align-self: center;
  }
}

@media (max-width: 992px) {
  .home-split {
    min-height: auto;
    padding-left: clamp(14px, 4vw, 24px);
    padding-right: clamp(14px, 4vw, 24px);
    padding-top: clamp(6px, 1.2vh, 10px);
  }

  .home-split-inner {
    width: 100%;
    padding-top: 0;
  }
}

.home-split-left {
  flex: 1 1 55%;
  min-width: 0;
  padding-bottom: clamp(10px, 2vh, 22px);
}

.home-split-right {
  flex: 1 1 45%;
  min-width: 0;
  display: flex;
  padding-bottom: clamp(10px, 2vh, 22px);
}

.home-split-left .info-section {
  width: 100%;
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-split-right .hero.hero-fullpage {
  width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: visible;
  min-height: clamp(520px, 72vh, 860px);
}

.home-split-right .hero.hero-fullpage .hero-inner {
  width: 100%;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 0 !important;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.home .home-split-right .hero h1 {
  text-align: left;
  margin-top: 0;
  align-self: stretch;
}

/* Botón centrado en su columna */
body.home .home-split-right .btn.btn-portada {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}

/* H1 del registro: más chico y sin gradiente (mismo color que el título del intro) */
body.home .home-split-right .hero.hero-fullpage h1 {
  width: 100%;
  max-width: 100%;
  font-size: clamp(1.15rem, 2.15vw, 2.25rem);
  line-height: 1.12;
  margin-bottom: clamp(0.85rem, 2vw, 1.35rem);
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: var(--dark-purple);
  color: var(--dark-purple);
  white-space: nowrap;
  text-wrap: nowrap;
  overflow: visible;
}

body.home .home-split-right .hero h1 i {
  -webkit-text-fill-color: var(--dark-purple);
  color: var(--dark-purple);
}

/* H3 de info: mismo color que el título del intro */
body.home .home-split-left .info-section h3 {
  color: var(--dark-purple);
}

.home-split-right .btn.btn-portada {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Evitar que el botón se vuelva blanco en hover (home) */
body.home .home-split-right .btn-portada:hover {
  background: var(--light-purple);
}

/* Divisor elegante: delgado -> grueso al centro -> delgado */
.home-split-divider {
  flex: 0 0 28px;
  position: relative;
}

.home-split-divider::before {
  content: "";
  position: absolute;
  inset: 14% auto 14% 50%;
  transform: translateX(-50%);
  width: 18px;
  background: linear-gradient(180deg,
    rgba(255,255,255,.28) 0%,
    rgba(255,255,255,.62) 50%,
    rgba(255,255,255,.28) 100%
  );
  clip-path: polygon(
    45% 0%, 55% 0%,
    70% 50%,
    55% 100%, 45% 100%,
    30% 50%
  );
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.18));
  opacity: .9;
}

/* El hero debe llenar su columna */
.home-split-right .hero.hero-fullpage {
  width: 100%;
}

/* En móvil: apilar como bloque: Intro -> Info -> Registro -> Footer */
@media (max-width: 992px) {
  .home-split-inner {
    flex-direction: column;
    gap: 18px;
  }

  .home-split-divider {
    display: none;
  }

  .home-split-left {
    order: 1;
  }

  .home-split-right {
    order: 2;
  }

  /* En móvil, el título del registro debe poder partirse sin desbordar */
  body.home .home-split-right .hero.hero-fullpage h1 {
    white-space: normal;
    text-wrap: balance;
    font-size: clamp(1.15rem, 4.4vw, 1.75rem);
    line-height: 1.18;
    text-align: center !important;
    align-self: center !important;
  }

  /* Asegurar centrado aunque existan reglas base con text-align:left */
  body.home .home-split-right .hero h1 {
    text-align: center !important;
    align-self: center !important;
  }

  .home-split-right .hero.hero-fullpage {
    min-height: auto;
    align-items: center !important  ;
    justify-content: center;
  }

  .home-split-right .hero.hero-fullpage .hero-inner {
    align-items: center !important;
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
  }

  body.home .home-split-right .btn.btn-portada {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

body.home .home-title {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: clamp(3.6rem, 10.8vw, 8.6rem);
  line-height: 0.88;
  color: var(--dark-purple);
  max-width: 16ch;
}

/* Efecto máquina de escribir (solo home) */
body.home .home-title-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

body.home .home-title-placeholder {
  visibility: hidden;
  white-space: nowrap;
}

body.home .home-title-typing {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 3px solid rgba(42, 10, 77, 0.7);
  padding-right: 8px;
  width: 0;
}

body.home .home-section.is-active .home-title-typing {
  animation: homeTyping 2.2s steps(12, end) 120ms forwards, homeBlink 850ms steps(1) infinite 2.35s;
}

@keyframes homeTyping {
  from { width: 0; }
  to { width: var(--home-typing-width, 100%); }
}

@keyframes homeBlink {
  0%, 50% { border-color: rgba(42, 10, 77, 0.7); }
  50.01%, 100% { border-color: transparent; }
}

body.home .home-edition {
  margin-top: clamp(0.6rem, 1.4vw, 0.9rem);
  margin-bottom: 0.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: clamp(1.35rem, 2.9vw, 2.05rem);
  color: rgba(42, 10, 77, 0.8);
}

body.home .home-subtitle {
  margin-top: 0.05rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  font-size: clamp(1.15rem, 2.6vw, 1.85rem);
  color: rgba(42, 10, 77, 0.78);
  max-width: 52ch;
}

/* Mantener el texto por encima de los logos absolutos */
body.home .home-title,
body.home .home-edition,
body.home .home-subtitle {
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  body.home .home-title-typing {
    border-right-width: 2px;
  }
}

@media (max-width: 420px) {
  body.home .home-title {
    font-size: clamp(2.8rem, 13vw, 4.6rem);
    line-height: 0.92;
    max-width: 100%;
  }
}

/* Sección informativa con look más “editorial” */
body.home .info-section {
  background: transparent;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

body.home .info-section h3 {
  letter-spacing: 0.02em;
}

body.home .info-section .info-text p {
  color: rgba(42, 10, 77, 0.78);
}

/* Features: tarjetas más limpias y centradas */
body.home .features {
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
}

body.home .feature {
  background: transparent;
  border: 1px solid rgba(42, 10, 77, 0.12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.home .feature i {
  filter: drop-shadow(0 10px 20px rgba(123, 1, 160, 0.18));
}

body.home .feature a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  position: relative;
}

body.home .feature a::after {
  content: '→';
  display: inline-block;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.home .feature:hover a::after {
  transform: translateX(6px);
}

/* Separador: transición más “premium” */
body.home .hero-fade-separator {
  height: clamp(22px, 4vw, 56px);
  margin-top: clamp(0.75rem, 2vw, 1.25rem);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 40%,
    var(--glass-bg) 100%
  );
}

@media (max-width: 768px) {
  body.home .info-section {
    border-radius: 22px;
  }

  /* En móvil reducimos aún más el hero para que asome la info */
  body.home .home-section.home-intro {
    min-height: clamp(330px, 44vh, 470px);
  }
}

