/* =========================================
   ANIMACIONES CSS
   ========================================= */
.anim-fade-down,
.anim-fade-up,
.anim-fade-left,
.anim-fade-right,
.anim-scale-in {
    opacity: 0; /* Oculto por defecto para que la animación lo muestre al scrollear */
    /* Para animaciones suaves controladas por JS */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.anim-fade-down {
    transform: translateY(-30px);
}

.anim-fade-up {
    transform: translateY(30px);
}

.anim-fade-left {
    transform: translateX(-50px);
}

.anim-fade-right {
    transform: translateX(50px);
}

.anim-scale-in {
    transform: scale(0.9);
}

/* Esta clase será añadida por JS cuando el elemento entre en pantalla */
.visible {
    opacity: 1 !important;
    transform: translate(0) scale(1) !important;
}

/* =========================================
   GLOBALES Y RESET
   ========================================= */
* {
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
    text-rendering: optimizeLegibility;
    text-wrap: pretty;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Compensación para que el header sticky no tape la sección */
}

body {
    margin: 0;
    padding: 0;
    position: relative;
    background-color: #0027bc;
    overflow-x: hidden; /* Previene scroll horizontal */
}

/* Contenedor central para limitar el ancho del contenido */
.contenedor {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0;
}

p {
    font-size: 18px;
    line-height: 1.2;
    margin: 0;
}

h2,
h3,
h4,
h5 {
    margin: 0;
}

section {
    width: 100%;
    padding: 60px 0;
}

/* Títulos Generales (usados en varias secciones) */
.titulo {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.titulo h2 {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    line-height: 1.2;
}

.titulo p {
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    width: 50%;
    margin: 0 auto;
}

/* =========================================
   HEADER
   ========================================= */
.header {
    background-color: #0027bc;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000; /* Asegura que el header esté por encima de todo el contenido al scrollear */
}

.header .contenedor {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btnDatos {
    background-color: #fff;
    color: #0027bc;
    padding: 10px 20px;
    border: 3px solid #49daff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}

.btnDatos:hover {
    background-color: #0027bc;
    color: #fff;
}

.btnDatos .icono-form {
    display: none;
}

/* =========================================
   SECCIÓN: DESCUBRE (PORTADA)
   ========================================= */
.seccionDescubre {
    background-image: url('imgs/portada-vive-san-pablo.jpg');
    background-size: cover;
    background-position: center;
    background-color: #707db1;
    height: 600px;
    padding: 0;
}

/* =========================================
   SECCIÓN: FORMULARIO
   ========================================= */
.formulario {
    background-color: #fcb34a;
}

.formulario .titulo h2,
.formulario .titulo p {
    color: #003399;
}

.dosColumnas {
    display: flex;
    gap: 20px;
    background-color: #fff;
    padding: 30px;
    border-radius: 20px;
}

.columna-texto {
    width: 40%;
    padding-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.columna-texto p {
    font-size: 24px;
    font-weight: 500;
    color: #0036e9;
}

.columna-formulario {
    width: 60%;
}

.contenedorCeleste {
    position: relative;
    padding: 20px;
    text-align: center;
    z-index: 1;
    font-size: 32px;
    line-height: 1.3;
    font-weight: 700;
    color: #0036e9;
}

.contenedorCeleste::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #00ffff;
    transform: skewX(2deg) skewY(-2deg);
    z-index: -1;
}

.campos-formulario {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.fila-inputs {
    display: flex;
    gap: 15px;
    width: 100%;
}

.campos-formulario input,
.campos-formulario select {
    padding: 15px;
    border: 2px solid #fcb34a;
    border-radius: 20px;
    font-size: 16px;
    width: 100%;
    font-family: "Poppins", sans-serif;
    color: #555;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.campos-formulario input:hover,
.campos-formulario select:hover {
    border-color: #e89b2c;
}

.campos-formulario input:focus,
.campos-formulario select:focus {
    border-color: #63400f;
    box-shadow: 0 0 5px rgba(99, 64, 15, 0.5);
}

.campos-formulario input::placeholder {
    color: #888;
    font-weight: 500;
}

.opciones-carreras {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.opciones-carreras h5 {
    font-size: 20px;
    font-weight: 800;
    color: #0036e9;
}

.grupo-carreras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.categoria-carrera {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.categoria-carrera h3 {
    color: #e63946;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.categoria-carrera label {
    font-size: 16px;
    color: #555;
    padding-left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.categoria-carrera input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Sección Legal */
.legal-section {
    margin-top: 30px;
    margin-bottom: 20px;
    color: #444;
}

.legal-text {
    font-size: 14px;
    text-align: justify;
    margin-bottom: 15px;
}

.legal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.legal-checkbox input {
    margin-top: 4px;
    cursor: pointer;
}

.legal-checkbox label {
    cursor: pointer;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.legal-checkbox a {
    color: #0027bc;
    font-weight: bold;
    text-decoration: underline;
}

.legal-checkbox a:hover {
    color: #e63946;
}

#btn-submit {
    background-color: #0027bc;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, opacity 0.3s;
    font-size: 16px;
    width: 240px;
    display: block;
    margin: 0 auto;
}

#btn-submit:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

/* =========================================
   SECCIÓN: MIRA EL DESCUBRE (VIDEO)
   ========================================= */
.descubre {
    background-color: #d53f57;
}

.descubre .contenedor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.contenedor-video {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.contenedor-video iframe {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    border-radius: 10px;
}

.contenedor-video span {
    color: #0036e9; 
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    position: relative;
    padding: 15px 30px;
    z-index: 1;
    margin-top: -50px;
    width: fit-content;
    text-align: center;
    max-width: 90%; /* Evita que el texto rompa el ancho en celulares */
    box-sizing: border-box;
}

.contenedor-video span::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #00ffff;
    transform: skewX(2deg) skewY(-2deg);
    z-index: -1;
}

/* =========================================
   SECCIÓN: INSTITUCIONES
   ========================================= */
.instituciones {
    background-color: #0036e9;
}

.instituciones .contenedor {
    display: flex;
    flex-direction: column;
}

.cardInstituciones {
    padding: 40px;
    background-color: #fff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cardInstituciones h4 {
    font-size: 32px;
    font-weight: 500;
    color: #0036e9;
    text-align: center;
}

.grid-instituciones {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    align-items: center;
    justify-items: center;
}

.grid-instituciones img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background-color: #0027bc;
    width: 100%;
    padding: 60px 30px 60px; /* Padding unificado para el contenedor general del footer */
}

.columnasFooter {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 20px;
    padding: 0 0 40px 0; /* Solo dejamos un poco de espacio hacia abajo para separar del copyright */
    color: #fff;
}

.logo-footer-principal {
    width: 200px;
    height: auto;
}

.logo-footer-secundario {
    width: 250px;
    height: auto;
}

.columnasFooter > div:nth-child(2) {
    width: 680px;
}

.info-footer {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

.info-textos {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.columnasFooter p {
    font-size: 14px;
    margin-bottom: 0;
    line-height: 1.3em;
}

.columnasFooter strong {
    font-weight: 700;
}

/* Enlaces del Footer */
.columnasFooter a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.columnasFooter a:hover {
    color: #00ffff;
}

/* Redes Sociales */
.redes-sociales {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.redes-sociales img {
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.redes-sociales a:hover img {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

/* Copyright Footer */
.copyright {
    text-align: center;
    color: #fff;
    width: 100%;
}

.copyright p {
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.2em;
    text-wrap: pretty;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
}

.copyright a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: #00ffff;
}

/* =========================================
   RESPONSIVE (MEDIA QUERIES)
   ========================================= */
@media (max-width: 1366px) {
    .contenedor {
        padding: 0 30px;
    }
    
    .header .contenedor {
        padding: 20px 30px;
    }

    section {
        padding: 60px 0;
    }
}

@media (max-width: 1024px) {
    .titulo h2 {
        font-size: 36px;
    }
    
    .titulo p {
        width: 80%;
        font-size: 20px;
    }
    
    .dosColumnas {
        flex-direction: column;
        padding: 20px;
    }

    .columna-texto,
    .columna-formulario {
        width: 100%;
    }

    .grupo-carreras {
        grid-template-columns: 1fr;
    }
    
    .grid-instituciones {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .titulo p {
        width: 100%;
    }
    
    .contenedorCeleste {
        font-size: 24px;
    }
    
    .columna-texto p {
        font-size: 20px;
    }

    .columnasFooter {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px; /* Más espacio entre bloques cuando se apilan */
    }

    .copyright p {
        width: 100%;
    }

    .columnasFooter > div:nth-child(2) {
        width: 100%; /* El segundo div (y los demás) ocupan el 100% en tablet/móvil */
    }

    .info-footer {
        flex-direction: column;
        align-items: center;
    }

    .redes-sociales {
        justify-content: center;
        margin-top: 20px;
    }

    section {
        padding: 60px 0;
    }
}

@media (max-width: 767px) {
    .contenedor {
        padding: 0 15px;
    }

    footer {
        padding: 60px 15px 60px;
    }

    .header .contenedor {
        padding: 20px 15px;
        flex-direction: row;
        justify-content: space-between;
    }

    .fila-inputs {
        flex-direction: column;
    }

    .btnDatos {
        padding: 10px;
    }

    .btnDatos .texto-btn {
        display: none;
    }

    .btnDatos .icono-form {
        display: block;
    }

    .grid-instituciones {
        grid-template-columns: repeat(2, 1fr);
    }

    #btn-submit {
        width: 100%;
    }

    section {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .titulo h2 {
        font-size: 28px;
    }

    .titulo p {
        font-size: 16px;
    }

    .grid-instituciones {
        grid-template-columns: 1fr;
    }

    .cardInstituciones h4 {
        font-size: 24px;
    }

    .seccionDescubre {
        height: 300px;
    }
}