/* ============== VARIABLES Y RESET BÁSICO ============== */
:root {
    --color-primario: #005A9C; /* Azul corporativo */
    --color-secundario: #F2A900; /* Amarillo/Dorado para acentos */
    --color-fondo: #F8F9FA;
    --color-texto: #343A40;
    --color-blanco: #FFFFFF;
    --fuente-principal: 'Poppins', sans-serif;
    --fuente-secundaria: 'Roboto', sans-serif;
    --sombra-suave: 0 4px 15px rgba(0, 0, 0, 0.1);
    --radio-borde: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente-secundaria);
    color: var(--color-texto);
    background-color: var(--color-blanco);
    line-height: 1.6;
}

/* ============== ESTILOS GENERALES Y UTILIDADES ============== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

#beneficios {
    padding: 60px 0 80px 0;
}

section:nth-of-type(even) {
    background-color: var(--color-fondo);
}

h1, h2, h3 {
    font-family: var(--fuente-principal);
    font-weight: 700;
    color: var(--color-primario);
    margin-bottom: 20px;
}

h1 { font-size: 2.8rem; line-height: 1.2; }
h2 { font-size: 2.2rem; text-align: center; }
h3 { font-size: 1.4rem; color: var(--color-primario); }

.btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--color-secundario);
    color: var(--color-texto);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radio-borde);
    transition: transform 0.3s ease, background-color 0.3s ease;
    font-family: var(--fuente-principal);
}

.btn:hover {
    transform: translateY(-3px);
    background-color: #ffbe33;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============== HEADER Y NAVEGACIÓN ============== */
.main-header {
    background-color: var(--color-blanco);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--sombra-suave);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--fuente-principal);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primario);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 45px;
    width: auto;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--color-texto);
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secundario);
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

/* ============== HERO SECTION ============== */
#hero {
    background: linear-gradient(rgba(0, 90, 156, 0.8), rgba(0, 90, 156, 0.8)), url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1351&q=80') no-repeat center center/cover;
    color: var(--color-blanco);
    padding: 120px 0;
    text-align: center;
}

#hero h1 {
    color: var(--color-blanco);
    animation: fadeInDown 1s ease-out;
}

#hero .subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px;
    animation: fadeInUp 1s ease-out 0.5s;
    animation-fill-mode: backwards;
}

#hero .btn {
    animation: fadeInUp 1s ease-out 1s;
    animation-fill-mode: backwards;
}

/* ============== SECCIÓN CURSOS ============== */
.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.curso-card {
    background-color: var(--color-blanco);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-suave);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.curso-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.curso-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.curso-card-content {
    padding: 25px;
}

.curso-card-content p {
    margin-top: 10px;
    font-size: 0.95rem;
}

/* ============== SECCIÓN QUIÉNES SOMOS ============== */
.quienes-somos-content {
    display: flex;
    align-items: center;
    gap: 50px;
    max-width: 1000px;
    margin: 40px auto 0;
}

.quienes-somos-img {
    flex: 1;
    max-width: 400px;
    border-radius: var(--radio-borde);
}

.quienes-somos-texto {
    flex: 1.5;
}

.quienes-somos-texto h2 {
    text-align: left;
}

.modalidades-list {
    margin: 20px 0;
}

.modalidad-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.modalidad-item i {
    width: 28px;
    height: 28px;
    color: var(--color-secundario);
    stroke-width: 2;
    flex-shrink: 0;
    margin-top: 2px;
}

.modalidad-item div {
    display: flex;
    flex-direction: column;
}

.modalidad-item strong {
    color: var(--color-primario);
    font-size: 1.05rem;
}

.modalidad-item span {
    color: #666;
    font-size: 0.95rem;
}

/* ============== SECCIÓN BENEFICIOS ============== */
.beneficios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.beneficio-card {
    text-align: center;
    padding: 20px;
}

.beneficio-icon {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    color: var(--color-secundario);
    font-size: 64px;
}

.beneficio-icon i {
    width: 64px;
    height: 64px;
    stroke-width: 1.5;
}
/* ============== SECCIÓN ESTADÍSTICAS ============== */
.estadisticas-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 30px;
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.estadistica-card {
    text-align: center;
    padding: 20px 10px;
}

.estadistica-numero {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-secundario);
    font-family: var(--fuente-principal);
    margin-bottom: 8px;
}

.estadistica-card p {
    font-size: 0.9rem;
    color: var(--color-texto);
    font-weight: 500;
}

/* ============== SECCIÓN CONTACTO ============== */
.contacto-form {
    max-width: 700px;
    margin: 40px auto 0;
    background: var(--color-blanco);
    padding: 40px;
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-suave);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: var(--radio-borde);
    font-family: var(--fuente-secundaria);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primario);
    box-shadow: 0 0 0 2px rgba(0, 90, 156, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* ============== FOOTER ============== */
.main-footer {
    background-color: var(--color-texto);
    color: var(--color-fondo);
    padding: 30px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-logo-img {
    height: 35px;
    width: auto;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.95rem;
}

.footer-contact a {
    color: var(--color-blanco);
    text-decoration: none;
}

.footer-contact a:hover {
    color: var(--color-secundario);
}

.footer-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-contact-item i {
    width: 16px;
    height: 16px;
}

.separator {
    color: #666;
}

.footer-bottom {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-bottom a {
    color: #999;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--color-secundario);
}


/* ============== ANIMACIONES Y RESPONSIVIDAD ============== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile-first: Media queries para tablets y desktops */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    
    .main-nav { display: none; } /* Simplificación para el ejemplo, se podría implementar un menú hamburguesa con JS */

    .quienes-somos-content {
        flex-direction: column;
        text-align: center;
    }
    .quienes-somos-texto h2 {
        text-align: center;
    }
}

/* ============== MODAL ============== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    text-align: center;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-icon {
    font-size: 60px;
    color: #28a745;
    margin-bottom: 20px;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.modal-content h2 {
    color: var(--color-primario);
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid var(--color-secundario);
}

.modal-info p {
    margin-bottom: 10px;
    text-align: left;
}

.modal-info strong {
    color: var(--color-primario);
}

.modal-content .btn {
    margin-top: 20px;
}
.section-subtitle {
    text-align: center;
    color: #666;
    margin-top: -10px;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Contenedor del flip card */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    height: 450px;
    cursor: pointer;
}

/* Contenedor interno que hace el flip */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Clase que se agrega con JavaScript al hacer clic */
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* Frente y reverso del card */
.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radio-borde);
    overflow: hidden;
    box-shadow: var(--sombra-suave);
}

/* FRENTE del card */
.flip-card-front {
    background-color: var(--color-blanco);
    display: flex;
    flex-direction: column;
}

.flip-card-front img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.flip-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flip-card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--color-primario);
}

.flip-card-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    flex: 1;
}

.flip-hint {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--color-secundario);
    font-weight: 600;
    animation: pulse 2s infinite;
}

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

/* REVERSO del card */
.flip-card-back {
    background: linear-gradient(135deg, var(--color-primario) 0%, #003d6b 100%);
    color: white;
    transform: rotateY(180deg);
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
}

.flip-card-back h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.back-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 15px;
    font-weight: 600;
}

.courses-list {
    list-style: none;
    text-align: left;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 15px;
}

.courses-list li {
    padding: 8px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.courses-list li:last-child {
    border-bottom: none;
}

/* Scrollbar personalizado para la lista de cursos */
.courses-list::-webkit-scrollbar {
    width: 6px;
}

.courses-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.courses-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.courses-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Botón de WhatsApp */
.btn-whatsapp {
    background-color: var(--color-secundario);
    color: var(--color-texto);
    padding: 12px 20px;
    border-radius: var(--radio-borde);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    margin-top: auto;
}

.btn-whatsapp:hover {
    background-color: #ffbe33;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Efecto hover en el card completo */
.flip-card:hover {
    transform: translateY(-5px);
}

.flip-card:hover .flip-card-front {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .flip-card {
        height: 400px;
    }
    
    .flip-card-content h3,
    .flip-card-back h3 {
        font-size: 1.1rem;
    }
    
    .courses-list li {
        font-size: 0.85rem;
        padding: 6px 0;
    }
}

@media (max-width: 768px) {
    .quienes-somos-content {
        gap: 30px;
    }
    
    .quienes-somos-img {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    .estadisticas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 100%;
    }
    
    .estadistica-numero {
        font-size: 2rem;
    }
    
    .estadistica-card p {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .modalidad-item {
        align-items: center;
        gap: 12px;
    }
    
    .modalidad-item i {
        width: 24px;
        height: 24px;
        margin-top: 0;
        flex-shrink: 0;
    }
    
    .modalidad-item div {
        flex: 1;
    }
    
    .modalidad-item strong {
        font-size: 1rem;
    }
    
    .modalidad-item span {
        font-size: 0.9rem;
    }
}

/* ============== FAB WHATSAPP ============== */
.whatsapp-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.whatsapp-fab i {
    width: 32px;
    height: 32px;
    color: white;
    stroke-width: 2;
}

/* ============== ESTILOS PARA VALIDACIÓN DE FORMULARIO ============== */

/* Grupos de formulario con error */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border: 2px solid #e74c3c;
    background-color: #ffebee;
}

.form-group.error input:focus,
.form-group.error textarea:focus,
.form-group.error select:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Grupos de formulario con éxito */
.form-group.success input,
.form-group.success textarea,
.form-group.success select {
    border: 2px solid #27ae60;
    background-color: #eafaf1;
}

.form-group.success input:focus,
.form-group.success textarea:focus,
.form-group.success select:focus {
    outline: none;
    border-color: #229954;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Mensaje de error */
.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.error-message::before {
    content: "⚠";
    font-size: 1rem;
}

/* Animación para mensaje de error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group.error {
    animation: shake 0.5s ease-in-out;
}

/* Estado de carga del botón */
.btn-submit.loading {
    background-color: #95a5a6;
    cursor: not-allowed;
    position: relative;
    pointer-events: none;
}

.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Transiciones suaves */
.form-group input,
.form-group textarea,
.form-group select {
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Mejora para dispositivos móviles */
@media (max-width: 768px) {
    .error-message {
        font-size: 0.8125rem;
    }
}

/* ============== ESTILOS ADICIONALES PARA MEJORAR LA EXPERIENCIA ============== */

/* Indicador visual cuando el campo está siendo editado */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Placeholder mejorado */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #95a5a6;
    opacity: 0.7;
}

/* Contador de caracteres opcional (si se implementa) */
.char-counter {
    text-align: right;
    font-size: 0.8125rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: #f39c12;
}

.char-counter.danger {
    color: #e74c3c;
}