@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --azul: #0f3986;
  --azul-oscuro: #0b2864;
  --rosa: #dd0a48;
  --texto: #142647;
  --muted: #586a86;
  --claro: #edf4fc;
  --borde: #e2e9f3;
  --sombra: 0 16px 42px rgba(15, 57, 134, .10);
  --ancho: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'DM Sans', Arial, sans-serif; color: var(--texto); background: #fff; line-height: 1.55; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
section { scroll-margin-top: 96px; }
.mw { max-width: none; }

/* Encabezado y portada */
body > header {
  position: relative; z-index: 30; display: flex; align-items: center;
  justify-content: space-between; width: 100%; min-height: 88px;
  padding: 12px max(28px, calc((100vw - var(--ancho)) / 2));
  background: #fff; box-shadow: 0 4px 22px rgba(15, 57, 134, .08);
}
body > header .logo { width: auto; max-width: 210px; flex: 0 0 auto; }
body > header .logo img { display: block; width: min(210px, 100%); height: auto; object-fit: contain; }
.nav { display: block; position: static; width: auto; height: auto; padding: 0; background: transparent; }
.nav-list { display: flex; align-items: center; gap: clamp(18px, 2.5vw, 42px); margin: 0; padding: 0; list-style: none; }
.nav-list li { list-style: none; }
.nav-list a { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--azul-oscuro); font-size: .86rem; font-weight: 800; text-transform: uppercase; letter-spacing: .015em; transition: color .2s; }
.nav-list a:hover, .nav-list a:focus-visible { color: var(--rosa); }
.nav-list .icon-tab { display: none; }
.nav-list li:first-child a { padding: 10px 17px; border: 1.5px solid var(--azul); border-radius: 11px; }
.nav-list li:first-child a:hover { background: var(--azul); color: #fff; }
.abrir-menu, .container-cerrar { display: none; }

.main {
  position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(18px, 4vw, 76px);
  width: 100%; min-height: clamp(420px, 47vw, 610px); padding: 62px max(30px, calc((100vw - var(--ancho)) / 2));
  background: radial-gradient(circle at 97% 13%, #e8f2fd 0 13%, transparent 13.2%),
              radial-gradient(circle at 1% 89%, #fce4ec 0 13%, transparent 13.2%), #fff;
}
.main::before { content: ''; position: absolute; left: 4%; top: 150px; width: 70px; height: 70px; opacity: .65; background-image: radial-gradient(var(--rosa) 2px, transparent 2px); background-size: 15px 15px; pointer-events: none; }
.main-img-1 { width: min(49%, 615px); height: auto; object-fit: contain; }
.main-img-2 { width: min(32%, 420px); height: auto; object-fit: contain; }

/* Carrusel de fotografías */
.s2-carrucel { display: block; width: 100%; padding: 34px max(28px, calc((100vw - var(--ancho)) / 2)) 70px; background: linear-gradient(90deg, #f4f8fd, #fff 45%, #f4f8fd); }
.s2-carrusel-container { position: relative; width: 100%; height: clamp(300px, 37vw, 550px); overflow: hidden; border-radius: 22px; box-shadow: var(--sombra); }
.s2-carrusel-container .swiper-wrapper { display: flex; width: 100%; height: 100%; }
.s2-carrusel-container .swiper-slide { flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden; }
.s2-carrusel-container .swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; }
.s2-carrusel-container::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 5px; background: linear-gradient(90deg, var(--azul) 74%, var(--rosa) 74%); pointer-events: none; }

/* Oferta educativa */
.s3-cards-materias { display: block; width: 100%; padding: 90px max(28px, calc((100vw - var(--ancho)) / 2)) 110px; background: #fff; }
.s3-info { text-align: center; max-width: 880px; margin: 0 auto 44px; }
.s3-info::before, .s5-nosotros::before, .s6-title::before { content: ''; display: block; width: 56px; height: 5px; margin: 0 auto 18px; border-radius: 20px; background: var(--rosa); }
.s3-info h2 { margin: 0 0 12px; color: var(--azul-oscuro); font-size: clamp(2rem, 3.5vw, 3.3rem); line-height: 1.12; font-weight: 800; }
.s3-info h3 { margin: 0; color: var(--muted); font-size: clamp(1rem, 1.35vw, 1.2rem); line-height: 1.55; font-weight: 500; }
.s3-cards-container { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; width: 100%; }
.s3-cards { display: flex; flex-direction: column; width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--borde); border-radius: 18px; background: #fff; box-shadow: 0 8px 26px rgba(15, 57, 134, .06); transition: transform .2s, box-shadow .2s; }
.s3-cards:hover { transform: translateY(-5px); box-shadow: var(--sombra); }
.s3-card-img { width: 100%; height: 220px; overflow: hidden; background: var(--claro); }
.s3-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.s3-card-title { display: flex; align-items: center; min-height: 85px; padding: 20px 26px 3px; }
.s3-card-title h2 { margin: 0; color: var(--azul-oscuro); font-size: 1.3rem; line-height: 1.25; font-weight: 800; }
.s3-card-description { display: flex; align-items: center; padding: 8px 26px 23px; margin-top: auto; }
.s3-card-description a { color: var(--rosa); font-weight: 800; }
.s3-card-description a::after { content: ' →'; margin-left: 5px; }

/* Beneficios */
.s4-beneficios { display: block; width: 100%; padding: 90px max(28px, calc((100vw - var(--ancho)) / 2)) 86px; background: #f8fbff; }
.s4-beneficios-part1 { margin: 0 0 40px; text-align: center; }
.s4-beneficios-part1 p { margin: 0; color: var(--azul-oscuro); font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.17; font-weight: 800; }
.tcprimary { color: var(--azul); } .tcsecondary { color: var(--rosa); }
.s4-beneficios-part2 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; width: 100%; }
.beneficios { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 190px; padding: 24px 17px; text-align: center; border: 1px solid var(--borde); border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(15, 57, 134, .04); }
.inciso { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: var(--rosa); font-size: 1.1rem; font-weight: 800; }
.inciso p, .beneficio p { margin: 0; }
.beneficio { color: var(--azul-oscuro); font-weight: 700; line-height: 1.35; }
.s4-banner { display: block; padding: 62px max(28px, calc((100vw - var(--ancho)) / 2)); color: #fff; background: linear-gradient(125deg, var(--azul-oscuro), var(--azul)); }
.s4-banner-part1 h2 { margin: 0 0 32px; font-size: clamp(1.7rem, 2.7vw, 2.7rem); line-height: 1.22; font-weight: 800; }
.s4-banner-part2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 46px; align-items: center; }
.s4-banner-1 p { margin: 0 0 11px; font-size: 1.05rem; }
.s4-banner-1 p span { color: #ff5382; font-weight: 800; }
.s4-banner-2 { padding: 22px 0 22px 42px; border-left: 1px solid rgba(255,255,255,.35); }
.s4-banner-2 h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2.5rem); line-height: 1.2; }

/* Comunidad y testimonios */
.s5-testimonios { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; width: 100%; padding: 95px max(28px, calc((100vw - var(--ancho)) / 2)); background: #fff; }
.s5-nosotros { width: 100%; }
.s5-nosotros::before { margin-left: 0; }
.s5-nosotros h2, .s5-testimonios-title h2 { margin: 0 0 12px; color: var(--azul-oscuro); font-size: clamp(2rem, 3vw, 3rem); line-height: 1.13; font-weight: 800; }
.s5-nosotros h3 { margin: 0 0 24px; color: var(--muted); font-size: 1.1rem; line-height: 1.5; font-weight: 500; }
.s5-nosotros p { margin: 0 0 15px; padding-left: 18px; border-left: 3px solid var(--rosa); color: var(--texto); font-size: 1rem; }
.s5-testimonial { min-width: 0; width: 100%; overflow: hidden; }
.s5-testimonios-title { margin-bottom: 22px; }
.s5-testimonial .swiper-wrapper { display: flex; align-items: stretch; }
.s5-slide { flex: 0 0 100%; width: 100%; min-height: 315px; padding: 32px; border: 1px solid var(--borde); border-radius: 20px; background: #f8fbff; }
.s5-slide img { width: 96px; height: 96px; margin-bottom: 17px; object-fit: cover; border-radius: 50%; }
.s5-testimonio-nombre { display: block; margin-bottom: 13px; color: var(--rosa); font-size: 1.16rem; font-weight: 800; }
.s5-slide p { margin: 0; color: var(--texto); font-size: 1.05rem; line-height: 1.55; }
.swiper-pagination { margin-top: 16px; text-align: center; }
.swiper-pagination-bullet-active { background: var(--azul); }

/* Ubicación */
.s6-ubicacion { display: block; width: 100%; padding: 90px max(28px, calc((100vw - var(--ancho)) / 2)); background: #f6f9fe; }
.s6-title { margin-bottom: 28px; }
.s6-title::before { margin-left: 0; }
.s6-title h2 { margin: 0; color: var(--azul-oscuro); font-size: clamp(2.3rem, 3.4vw, 3.3rem); font-weight: 800; }
.s6-container { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; width: 100%; }
.s6-datos, .s6-mapa { min-width: 0; border: 1px solid var(--borde); border-radius: 20px; background: #fff; box-shadow: var(--sombra); overflow: hidden; }
.s6-datos { padding: clamp(25px, 3vw, 46px); }
.s6-datos h2 { margin: 0 0 22px; color: var(--rosa); font-size: clamp(1.5rem, 2.3vw, 2.2rem); line-height: 1.2; }
.s6-datos p { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; font-size: 1rem; }
.s6-datos p .bi { color: var(--rosa); font-size: 1.25rem; line-height: 1.35; }
.s6-datos .s6-horarios { display: block; margin: 22px 0 13px; color: var(--azul); font-size: 1.25rem; font-weight: 800; }
.s6-contactanos { display: flex; justify-content: flex-start; margin-top: 26px; }
.s6-boton { display: inline-flex; align-items: center; gap: 10px; padding: 12px 25px; border-radius: 10px; color: #fff; background: var(--rosa); font-weight: 800; }
.s6-boton:hover { background: #b30739; }
.s6-mapa iframe { display: block; width: 100%; height: 100%; min-height: 460px; border: 0; }

/* Equipo */
.s7-banner { display: grid; place-items: center; min-height: 172px; padding: 35px 24px; text-align: center; color: #fff; background: linear-gradient(120deg, var(--azul-oscuro), var(--azul)); }
.s7-banner-texto { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.18; font-weight: 800; }
.s8-team { display: block; width: 100%; padding: 92px max(28px, calc((100vw - var(--ancho)) / 2)) 110px; background: #fff; }
.s8-team > h2 { margin: 0 0 52px; text-align: center; color: var(--azul-oscuro); font-size: clamp(2.1rem, 3.4vw, 3.4rem); line-height: 1.14; font-weight: 800; }
.s8-team > h2::after { content: ''; display: block; width: 64px; height: 5px; margin: 18px auto 0; border-radius: 5px; background: var(--rosa); }
.s8-team > h3 { margin: 54px 0 20px; color: var(--azul); font-size: 1.55rem; font-weight: 800; }
.s8-card-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: center; gap: 26px; width: 100%; }
.s8-card { display: flex; flex-direction: column; width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--borde); border-radius: 18px; background: #fff; box-shadow: var(--sombra); }
.s8-card-title { width: 100%; padding: 18px 22px; text-align: center; background: var(--azul); }
.s8-card-title h2 { margin: 0; color: #fff; font-size: clamp(1.1rem, 1.6vw, 1.45rem); line-height: 1.3; font-weight: 800; }
.s8-card-content { width: 100%; padding: 24px; flex: 1; }
.s8-card-content h3 { margin: 0 0 20px; color: var(--rosa); font-size: 1.14rem; text-align: center; font-weight: 800; text-transform: uppercase; }
.s8-content { display: flex; align-items: center; gap: 22px; width: 100%; }
.s8-content img { flex: 0 0 116px; width: 116px; height: 116px; object-fit: cover; border-radius: 50%; }
.s8-content p { margin: 0; color: var(--texto); font-size: .98rem; line-height: 1.5; }
.s8-card-link { display: flex; justify-content: space-evenly; align-items: center; width: 100%; min-height: 68px; padding: 10px 16px; background: var(--rosa); }
.s8-card-link a { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; color: #fff; font-size: 1.8rem; }
.s8-card-link img { width: 31px; height: 31px; object-fit: contain; filter: brightness(0) invert(1); }

/* Pie, chat y ventanas existentes */
.s9-footer { display: flex; align-items: center; justify-content: space-between; gap: 22px; width: 100%; padding: 30px max(28px, calc((100vw - var(--ancho)) / 2)); color: #fff; background: var(--azul-oscuro); }
.s9-footer h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.s9-redes { display: flex; align-items: center; gap: 23px; }
.s9-redes a { color: #fff; font-size: 1.5rem; }
#chat { position: fixed; right: 22px; bottom: 22px; z-index: 45; cursor: pointer; }
#chat img { width: 60px; height: 60px; object-fit: contain; }
#frame_chat { position: fixed; right: 25px; bottom: 88px; z-index: 44; width: min(360px, calc(100vw - 38px)); height: min(520px, calc(100vh - 120px)); border: 1px solid var(--borde); border-radius: 16px; box-shadow: var(--sombra); background: #fff; }
#oc { position: fixed; right: 30px; bottom: 610px; z-index: 46; cursor: pointer; }
.backdrop { z-index: 80; }
.popup { z-index: 81; }

@media (max-width: 1050px) {
  .s3-cards-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s4-beneficios-part2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s5-testimonios { gap: 36px; }
}
@media (max-width: 760px) {
  body > header { min-height: 70px; padding: 10px 20px; }
  body > header .logo img { width: 150px; }
  .abrir-menu, .cerrar-menu { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--azul); font-size: 1.7rem; cursor: pointer; }
  .container-cerrar { display: flex; justify-content: flex-end; margin-bottom: 30px; }
  .nav { position: fixed; top: 0; right: -100%; z-index: 60; display: block; width: min(330px, 85vw); height: 100vh; padding: 25px; background: #fff; box-shadow: -15px 0 35px rgba(12, 40, 100, .15); transition: right .25s; }
  .nav.visible, .nav.nav-visible, .nav.active, .nav.open { right: 0; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 24px; }
  .nav-list a { width: 100%; font-size: .95rem; }
  .nav-list .icon-tab { display: inline; }
  .main { min-height: auto; flex-direction: column; padding: 55px 25px; gap: 25px; }
  .main::before { display: none; }
  .main-img-1 { width: min(100%, 480px); }
  .main-img-2 { width: min(65%, 300px); }
  .s2-carrucel { padding: 20px 16px 60px; }
  .s2-carrusel-container { height: 310px; border-radius: 15px; }
  .s3-cards-materias, .s4-beneficios, .s5-testimonios, .s6-ubicacion, .s8-team { padding: 65px 20px; }
  .s3-cards-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .s3-card-img { height: 170px; }
  .s3-card-title { padding: 15px 16px 0; min-height: 75px; }
  .s3-card-description { padding: 7px 16px 17px; }
  .s4-beneficios-part2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s4-banner { padding: 50px 24px; }
  .s4-banner-part2, .s5-testimonios, .s6-container { grid-template-columns: 1fr; }
  .s4-banner-2 { padding: 22px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.3); }
  .s6-mapa iframe { min-height: 350px; }
  .s8-card-container { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .s3-cards-container, .s4-beneficios-part2 { grid-template-columns: 1fr; }
  .s3-card-img { height: 210px; }
  .beneficios { min-height: 0; }
  .s5-slide { padding: 22px; }
  .s8-content { flex-direction: column; text-align: center; }
  .s9-footer { flex-direction: column; text-align: center; padding: 30px 20px; }
}
/* =========================================
   ESTILOS PARA EL POPUP (LOGIN ALUMNOS)
   ========================================= */

/* Contenedor principal del popup */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 420px; /* Ancho similar a la imagen */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 35px 40px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

/* Clase activa para mostrar el popup */
.popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Fondo oscuro semitransparente */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Botón de cerrar (X) */
.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #999;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.close-popup:hover {
    background: #666;
}

/* Título "Alumnos" */
#popup-title {
    text-align: center;
    color: #0f3986; /* Azul UDIMEX */
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
}

/* Línea rosa decorativa */
.popup .bar {
    height: 3px;
    background: #dd0a48; /* Rosa UDIMEX */
    width: 100%;
    margin-bottom: 25px;
    border-radius: 2px;
}

/* Elementos del formulario */
.popup .form-element {
    margin-bottom: 15px;
}

/* Inputs */
.popup .form-element input[type="text"],
.popup .form-element input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box; /* Asegura que el padding no rompa el ancho */
}

.popup .form-element input[type="text"]:focus,
.popup .form-element input[type="password"]:focus {
    border-color: #0f3986;
}

.popup .form-element input::placeholder {
    color: #999;
}

/* Botón "ENTRAR" */
.popup .btn-submit {
    width: 100%;
    padding: 12px;
    background: #dd0a48; /* Rosa UDIMEX */
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
    margin-top: 10px;
}

.popup .btn-submit:hover {
    background: #b30739; /* Rosa más oscuro */
}

/* Ocultar el hr antiguo si aún se genera */
.popup hr {
    display: none;
}
#oscuro {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 100;
}
/* =========================================
   CENTRAR TARJETA ÚNICA (EJ. DIRECCIÓN GENERAL)
   ========================================= */
.s8-card-container.single-card {
    display: flex;
    justify-content: center;
}

.s8-card{
    display: flex;
    justify-content: center;
}

.s8-card-container.single-card .s8-card {
    max-width: calc(50% - 13px); /* Mantiene el mismo tamaño que en la vista de 2 columnas */
    width: 100%;
}

/* Ajuste para móviles: que ocupe todo el ancho disponible */
@media (max-width: 760px) {
    .s8-card-container.single-card .s8-card {
        max-width: 100%;
    }
}