/* ================= VARIABLES ================= */
:root {
    --primary-dark: #004b79; 
    --primary-light: #166e9f; 
    --accent-yellow: #f1c40f; 
    --accent-green: #8cc63f; 
    --text-main: #333333;
    --text-muted: #666666;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --font-heading: 'Merriweather', serif;
    --font-body: 'Open Sans', sans-serif;
    --header-height: 80px; /* Variable para calcular el menú fijo */
}

/* ================= RESET & BASE ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* MEJORA 1: scroll-padding-top evita que los enlaces queden debajo del menú fijo */
html { 
    scroll-behavior: smooth; 
    scroll-padding-top: var(--header-height); 
}

body { 
    font-family: var(--font-body); 
    color: var(--text-main); 
    line-height: 1.6; 
    background-color: var(--white); 
    padding-top: var(--header-height); /* Evita que el hero quede tapado */
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--primary-dark); margin-bottom: 1rem; line-height: 1.3; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ================= KEYFRAME ANIMATIONS ================= */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ================= UTILITIES ================= */
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 4rem 0; }
.text-center { text-align: center; }

/* MEJORA: Botones más modernos con sombras y efecto "click" */
.btn { display: inline-block; padding: 1rem 2rem; background-color: var(--accent-yellow); color: var(--primary-dark); font-weight: bold; border-radius: 6px; transition: all 0.3s ease; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); cursor: pointer; border: none; font-size: 1rem;}
.btn:hover { background-color: #f3ce34; transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.btn-outline { background-color: transparent; border: 2px solid var(--white); color: var(--white); box-shadow: none; }
.btn-outline:hover { background-color: var(--white); color: var(--primary-dark); }

/* ================= HEADER ================= */
header { background-color: var(--white); color: var(--primary-dark); position: fixed; width: 100%; top: 0; z-index: 1000; box-shadow: 0 2px 15px rgba(0,0,0,0.08); height: var(--header-height); display: flex; align-items: center; }
.navbar { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0 5%; gap: 1rem; }
.navbar-actions { display: flex; align-items: center; gap: 0.6rem; }

/* CORRECCIÓN LOGO MÓVIL: Fluidez y prevención de colapso */
.logo { 
    font-family: var(--font-heading); 
    font-size: clamp(1rem, 4vw, 1.4rem); /* El texto encoge si la pantalla es muy pequeña */
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    max-width: 80%; /* Deja un 20% libre para que respire el menú hamburguesa */
    line-height: 1.2;
}
.logo-img { 
    width: 40px; 
    height: auto; 
    flex-shrink: 0; /* Impide que la imagen se deforme o aplaste por falta de espacio */
    transition: transform 0.3s ease; 
}
.logo:hover .logo-img { transform: scale(1.1) rotate(5deg); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--text-main); font-weight: 600; transition: color 0.3s; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary-light); }
.menu-toggle { display: none; font-size: 2rem; cursor: pointer; color: var(--primary-dark); user-select: none; }

/* ================= HERO ================= */
.hero { background: linear-gradient(135deg, rgba(0,75,121,0.85) 0%, rgba(22,110,159,0.85) 100%), url('images/studyace1.jpg'); background-size: cover; background-position: center; color: var(--white); padding: 8rem 5% 6rem 5%; text-align: center; }

/* MEJORA 3: Tipografía fluida. Crece y encoge automáticamente entre 2rem y 3.5rem */
.hero h1 { color: var(--white); font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1.5rem; }
.hero p { font-size: 1.1rem; max-width: 800px; margin: 0 auto 2.5rem auto; line-height: 1.8; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; }

/* ================= WHY US ================= */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem; }
.feature-card { background: var(--bg-light); padding: 2.5rem 2rem; border-radius: 8px; border-top: 4px solid var(--primary-dark); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.feature-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; }
.accreditations { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin-top: 3rem; opacity: 0.8; font-weight: bold; color: var(--text-muted); }

/* ================= METHODOLOGY ================= */
.methodology { background: linear-gradient(135deg, rgba(0,75,121,0.9) 0%, rgba(22,110,159,0.9) 100%), url('images/studyace2.jpg'); background-size: cover; background-position: center; color: var(--white); padding: 5rem 5% 4rem 5%; text-align: center; }
.methodology h2 { color: var(--white); }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; }
.method-box { background: rgba(255,255,255,0.1); padding: 2.5rem; border-radius: 8px; backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.2); transition: transform 0.3s ease; text-align: left; }
.method-box:hover { transform: translateY(-5px); }
.method-box h3 { color: var(--accent-yellow); border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 1rem; }
.method-box ul { margin-top: 1.5rem; }
.method-box li { margin-bottom: 0.8rem; display: flex; align-items: flex-start; gap: 10px; }
.method-box li::before { content: '✔'; color: var(--accent-green); font-weight: bold; }

/* ================= ADMISSIONS & PRICING ================= */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem; }
.price-card { background: var(--white); border: 1px solid #eee; padding: 2.5rem 2rem; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); text-align: center; transition: all 0.3s ease; }
.price-card:hover { transform: translateY(-10px); border-color: var(--primary-light); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.price-card h3 { color: var(--primary-light); font-size: 1.2rem; }
.price-amount { font-size: 2.8rem; font-weight: bold; color: var(--primary-dark); margin: 1rem 0; line-height: 1; }
.price-amount span { font-size: 1rem; color: var(--text-muted); font-weight: normal; }
.price-card ul { text-align: left; margin: 2rem 0; }
.price-card li { margin-bottom: 0.8rem; padding-bottom: 0.8rem; border-bottom: 1px solid #f0f0f0; color: var(--text-muted); }
.schedule-box { background: var(--bg-light); padding: 2rem; border-radius: 12px; margin-top: 3rem; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 2rem; border-left: 5px solid var(--primary-light); }

/* ================= FAQ ================= */
.faq-container { max-width: 800px; margin: 0 auto; }
details { background: var(--white); margin-bottom: 1rem; padding: 1.2rem; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: background 0.3s; }
details:hover { background: #fdfdfd; }
summary { font-weight: bold; font-family: var(--font-heading); color: var(--primary-dark); outline: none; list-style-position: inside; font-size: 1.1rem; }
details p { margin-top: 1rem; padding-left: 1.5rem; border-left: 3px solid var(--primary-light); color: var(--text-muted); }

/* ================= ADMISSION FORM ================= */
.admission-form-container { background: var(--white); padding: 3rem; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); border-top: 5px solid var(--accent-yellow); margin-top: 4rem; }
.admission-form { max-width: 800px; margin: 0 auto; }
.form-section { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid #eee; }
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section h3 { color: var(--primary-light); margin-bottom: 1.5rem; font-size: 1.3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; width: 100%; }
.form-group label { font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); font-size: 0.95rem; }

/* MEJORA 4: Campos de formulario consistentes y accesibles */
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.8rem 1rem; border: 1px solid #ccc; border-radius: 6px; font-family: var(--font-body); font-size: 1rem; background-color: #fafafa; transition: all 0.3s ease; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-light); background-color: var(--white); box-shadow: 0 0 0 3px rgba(22, 110, 159, 0.15); }
.form-group textarea { resize: vertical; min-height: 120px; }

/* MEJORA 5: Alineación perfecta del checkbox legal */
.checkbox-group { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; background: var(--bg-light); padding: 1.5rem; border-radius: 8px; margin-top: 1rem; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; margin-top: 3px; cursor: pointer; accent-color: var(--primary-dark); }
.checkbox-group label { margin-bottom: 0; font-weight: normal; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; line-height: 1.4; }

.form-actions { text-align: center; margin-top: 2.5rem; }
.form-actions .btn { width: 100%; max-width: 300px; font-size: 1.1rem; padding: 1.2rem; }
.form-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 1rem; font-style: italic; }

/* ================= CONTACT ================= */
.contact { background-color: var(--primary-dark); color: var(--white); }
.contact h2 { color: var(--white); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; }
.contact-info { display: flex; flex-direction: column; justify-content: center; }
.contact-info p { font-size: 1.1rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 15px; }
.map-container iframe { width: 100%; height: 350px; border: none; border-radius: 12px; box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

footer { background-color: #002d4a; color: rgba(255,255,255,0.8); text-align: center; padding: 2rem 1.5rem; font-size: 0.9rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* ================= RESPONSIVE (MOBILE UX OPTIMIZED) ================= */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; }
    header { padding: 0; }
    .navbar { padding: 0 0.75rem; }

    /* Menú Móvil Mejorado */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        background: var(--white);
        padding: 0; /* Quitamos padding general para dar área táctil a los enlaces */
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }
    .nav-links.active { display: flex; }
    .nav-links a {
        padding: 1.2rem; /* Área táctil más grande (mínimo 44px) */
        border-bottom: 1px solid #f0f0f0;
        text-align: center;
        width: 100%;
        font-size: 1.1rem;
    }

    .navbar-actions { position: relative; z-index: 1100; }
    .language-dropdown { min-width: 95px; max-width: 130px; width: 100px; }
    .nav-links a:last-child { border-bottom: none; }
    
    /* Botón hamburguesa más fácil de tocar */
    .menu-toggle { 
        display: block; 
        padding: 10px; /* Incrementa el área táctil sin cambiar el tamaño visual */
        margin-right: -10px; 
    }
    
    /* Hero ajustado para que se lea en el primer pantallazo */
    .hero { padding: 6rem 5% 4rem 5%; } 
    .hero h1 { font-size: 2.2rem; line-height: 1.2; margin-bottom: 1rem; }
    .hero p { font-size: 1rem; margin-bottom: 2rem; }
    .hero-buttons { flex-direction: column; gap: 12px; }
    .hero-buttons .btn { width: 100%; }
    
    /* Rejillas a 1 sola columna */
    .split-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
    .features-grid { gap: 1.5rem; }
    
    /* Ajustes visuales de tipografía para no saturar la pantalla */
    h2 { font-size: 1.8rem; }
    .price-amount { font-size: 2.4rem; }
    
    /* Formulario blindado para móviles */
    .admission-form-container { 
        padding: 2rem 1.2rem; /* Menos padding lateral para ganar espacio de inputs */
        border-radius: 8px; 
    }
    .form-row { 
        display: flex; 
        flex-direction: column; 
        gap: 1.2rem; 
        margin-bottom: 1.2rem; 
    }
    /* Prevenir auto-zoom en iPhone */
    .form-group input, .form-group select, .form-group textarea { 
        font-size: 16px; 
        padding: 0.9rem;
    }
    .checkbox-group { 
        flex-direction: row; /* Mantenemos caja y texto al lado */
        padding: 1rem; 
    }
    .checkbox-group label { font-size: 0.85rem; }
    
    /* F.A.Q área táctil mejorada */
    summary { padding: 0.5rem 0; font-size: 1.05rem; }
}

/* Teléfonos extremadamente pequeños (iPhone SE, Galaxy Fold cerrado) */
@media (max-width: 380px) {
    .logo { font-size: 0.95rem; max-width: 70%; }
    .logo-img { width: 32px; }
    .hero h1 { font-size: 1.9rem; }
}

/* ================= IMÁGENES DE CONFIANZA ================= */
/* Imagen para Metodología */
.methodology-img-wrapper { text-align: center; margin-bottom: 4rem; }
.methodology-img { 
    width: 100%; 
    max-width: 800px; 
    border-radius: 12px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.3); 
    border: 4px solid rgba(255,255,255,0.1); /* Borde sutil transparente */
}
/* Tarjeta de motivación encima del formulario */
.admissions-contact { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 1.5rem; 
    margin-bottom: 2.5rem; 
    background: var(--bg-light); 
    padding: 1.5rem; 
    border-radius: 8px; 
    border-left: 4px solid var(--primary-light); 
    text-align: left; 
}
/* CAMBIO: En lugar de un círculo pequeño, un rectángulo redondeado más grande */
.admissions-photo { 
    width: 140px; 
    height: 140px; 
    border-radius: 12px; 
    object-fit: cover; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    flex-shrink: 0; 
}
.admissions-contact-text p { margin: 0; font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }
.admissions-contact-text strong { color: var(--primary-dark); display: block; font-style: normal; font-size: 1.2rem; margin-bottom: 8px; font-family: var(--font-heading); }

@media (max-width: 768px) {
    .admissions-contact { flex-direction: column; text-align: center; border-left: none; border-top: 4px solid var(--primary-light); }
    .admissions-photo { width: 100%; height: 180px; } /* En móvil la foto ocupa el ancho para que se vean bien los niños */
}

/* ================= LANGUAGE SELECTOR ================= */
.language-dropdown {
    padding: 0.45rem 0.8rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background-color: rgba(255,255,255,0.9);
    color: #1f2937;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.language-dropdown:hover {
    border-color: #94a3b8;
}

.language-dropdown:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.language-dropdown option {
    background-color: #fff;
    color: #1f2937;
}

/* Minimum design for the select arrow on modern browsers */
.language-dropdown::-ms-expand { display: none; }

/* Small mobile sizing for selector */
@media (max-width: 768px) {
    .language-dropdown {
        font-size: 0.88rem;
        padding: 0.4rem 0.7rem;
        min-width: 80px;
        max-width: 110px;
        width: auto;
    }
    .navbar-actions {
        gap: 0.3rem;
    }
    .menu-toggle {
        margin-left: 0.25rem;
    }
    .nav-links {
        margin-top: calc(var(--header-height));
        max-height: calc(100vh - var(--header-height));
    }
}