@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* ===== KEYFRAMES ===== */
@keyframes heroTitleAnimation {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heroButtonAnimation {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== NAVBAR ===== */
.navbar {
    background: white;
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    color: #4a90e2;
    font-weight: bold;
    font-size: 18px;
}

.logo::before {
    content: "🏢";
    margin-right: 10px;
    font-size: 24px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-menu a:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: #4a90e2;
    transition: all 0.3s;
    transform: translateX(-50%);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Botón hamburguesa - oculto por defecto */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #4a90e2;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    display: block;
}

/* Animación del hamburguesa cuando está activo */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== HERO SECTION ===== */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    margin-top: 70px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.hero-container {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 70px);
}

.hero-content {
    color: white;
    max-width: 500px;
    margin-left: 0;
    text-align: left;
}

/* ===== ANIMACIÓN DEL TÍTULO DEL HERO (SOLO AL CARGAR) ===== */
.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    text-align: left;
    /* Animación automática al cargar */
    animation: heroTitleAnimation 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.cta-button {
    background: #ff6b35;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    /* Animación automática al cargar */
    animation: heroButtonAnimation 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

.cta-button:hover {
    background: #e55a2b;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

/* ===== MISSION SECTION ===== */
.mission-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.mission-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.mission-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    max-width: 900px;
    margin: 0 auto;
    text-align: justify;
}

.highlight {
    color: #4a90e2;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #4a90e2, #ff6b35);
    border-radius: 2px;
}

/* ===== PROGRAMS SECTION ===== */
.programs-section {
    padding: 80px 0;
    background: white;
}

.programs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== TÍTULO DE PROGRAMAS - ANIMACIÓN MEJORADA ===== */
.programs-title {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 50px;
    font-weight: 700;
    position: relative;
    /* Estado inicial */
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.programs-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #4a90e2, #ff6b35);
    border-radius: 2px;
}

.programs-title.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== TARJETAS DE PROGRAMA - ANIMACIONES INDIVIDUALES MEJORADAS ===== */
.program-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 80px; /* Más espacio entre tarjetas */
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Estado inicial */
    opacity: 0;
    transform: translateY(60px) scale(0.95);
}

.program-card.reverse {
    grid-template-columns: 2fr 1fr;
}

/* Animación cuando entra en viewport */
.program-card.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Efecto hover mejorado */
.program-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ===== ANIMACIONES ESPECÍFICAS PARA EL CONTENIDO INTERNO ===== */
.program-image-container {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.2s; /* Retraso para efecto escalonado */
}

.program-card.reverse .program-image-container {
    transform: translateX(60px);
}

.program-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.4s; /* Retraso mayor para el contenido */
}

.program-card.reverse .program-content {
    transform: translateX(-60px);
}

/* Estado final de las animaciones internas */
.program-card.animate-in .program-image-container,
.program-card.animate-in .program-content {
    opacity: 1;
    transform: translateX(0);
}

.program-title {
    background: #f39c12;
    color: white;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.program-title.health {
    background: #17a2b8;
}

.program-image {
    position: relative;
    overflow: hidden;
}

/* Animación específica para imágenes */
.program-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
    transform: scale(1.05); /* Ligeramente más grande inicialmente */
}

.program-card.animate-in .program-image img {
    transform: scale(1); /* Escala normal cuando se anima */
}

.program-card:hover .program-image img {
    transform: scale(1.1);
}

.program-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 25px;
}

/* Animación para botones */
.program-button {
    background: #ff6b35;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s, background 0.3s ease;
}

.program-card.animate-in .program-button {
    opacity: 1;
    transform: translateY(0);
}

.program-button:hover {
    background: #e55a2b;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

/* ===== FORMULARIOS ===== */
.form-container {
    max-width: 600px;
    margin: 40px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
}

.form-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #1CABE2, #00A0DC, #28a745);
}

.form-container h2 {
    background: linear-gradient(135deg, #1CABE2 0%, #00A0DC 100%);
    color: white;
    padding: 30px;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.form-container h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 10px solid #00A0DC;
}

.form-container form {
    padding: 40px;
}

.form-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.form-container label::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="tel"],
.form-container select,
.form-container textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #fafafa;
}

.form-container input[type="text"]:focus,
.form-container input[type="email"]:focus,
.form-container input[type="tel"]:focus,
.form-container select:focus,
.form-container textarea:focus {
    outline: none;
    border-color: #1CABE2;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(28, 171, 226, 0.1);
    transform: translateY(-2px);
}

.form-container select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-container textarea {
    resize: vertical;
    min-height: 120px;
}

.form-container button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #1CABE2 0%, #00A0DC 100%);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(28, 171, 226, 0.3);
}

.form-container button[type="submit"]:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(28, 171, 226, 0.4);
    background: linear-gradient(135deg, #00A0DC 0%, #1CABE2 100%);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 30px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .programs-title {
        font-size: 2.2rem;
    }
}

/* En desktop el menú normal se muestra */
@media (min-width: 769px) {
    .nav-menu {
        display: flex !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: none !important;
        backdrop-filter: none !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 30px !important;
        box-shadow: none !important;
    }
    
    .nav-menu li {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .hamburger {
        display: none !important;
    }
}

/* En móvil mostrar hamburguesa y ocultar menú */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.4s ease;
        list-style: none;
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.5s; }
    
    .nav-menu a {
        font-size: 1.3rem;
        font-weight: 600;
        color: #4a90e2;
        text-decoration: none;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    /* Hero responsive */
    .hero-container {
        text-align: center;
        padding: 0 15px;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: 2.2rem;
        text-align: center;
    }
    
    .cta-button {
        font-size: 1rem;
        padding: 12px 25px;
    }

    /* Programas responsive - CORREGIDO */
    .program-card {
        grid-template-columns: 1fr;
        margin-bottom: 50px;
    }
    
    /* Para tarjetas reverse, cambiar el orden en móvil */
    .program-card.reverse {
        grid-template-columns: 1fr;
        margin-bottom: 50px;
    }
    
    .program-card.reverse .program-image-container {
        order: 1; /* Imagen primero */
    }
    
    .program-card.reverse .program-content {
        order: 2; /* Contenido después */
    }
    
    /* Ajustar animaciones para móvil */
    .program-image-container {
        transform: translateY(-30px);
        opacity: 0;
        transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        transition-delay: 0.2s;
    }
    
    .program-content {
        transform: translateY(30px);
        padding: 30px 20px;
        opacity: 0;
        transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        transition-delay: 0.4s;
    }
    
    /* Para tarjetas reverse, mantener las mismas animaciones */
    .program-card.reverse .program-image-container {
        transform: translateY(-30px);
        opacity: 0;
    }
    
    .program-card.reverse .program-content {
        transform: translateY(30px);
        opacity: 0;
    }
    
    .program-card.animate-in .program-image-container,
    .program-card.animate-in .program-content {
        transform: translateY(0);
        opacity: 1;
    }

    .programs-title {
        font-size: 2rem;
    }
    
    .programs-container {
        padding: 0 15px;
    }

    /* Formularios responsive */
    .form-container {
        margin: 20px 15px;
        border-radius: 15px;
    }

    .form-container h2 {
        padding: 25px 20px;
        font-size: 1.6rem;
    }

    .form-container form {
        padding: 30px 25px;
    }
    
    /* Mission section responsive */
    .mission-container {
        padding: 0 15px;
    }
    
    .mission-text {
        font-size: 1rem;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .programs-title {
        font-size: 1.8rem;
    }
    
    .program-content {
        padding: 25px 15px;
    }
    
    .form-container form {
        padding: 25px 20px;
    }
    
    .form-container h2 {
        font-size: 1.4rem;
        padding: 20px 15px;
    }
}

@media (max-width: 320px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .programs-title {
        font-size: 1.6rem;
    }
    
    .cta-button {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}