/* ============================================= */
/* 1. CONFIGURACIÓN Y VARIABLES                  */
/* ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  /* PALETA CORPORATIVA TECNIUM */
  --primary: #0D3B78;       
  --secondary: #C4312D;     
  --accent: #C4312D;        
  --dark-bg: #1E1E1E;       
  --light-text: #f8fafc;    
  --gray-text: #6E7480;     
  
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(217, 221, 226, 0.5); 
  --shadow-color: rgba(13, 59, 120, 0.15);  
  
  /* Colores de Software */
  --autocad: #e11d48;
  --inventor: #f59e0b;
  --fusion: #0ea5e9;
  
  --nav-height: 80px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif; 
  background-color: #ffffff; 
  color: var(--dark-bg); 
  line-height: 1.6;
  padding-top: var(--nav-height);
  overflow-x: hidden; /* Evita scroll horizontal en móviles */
}

/* Fondo con formas flotantes */
.background-shapes {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #ffffff; 
}
.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatShape 10s infinite alternate;
}
.shape-1 {
    top: -10%; left: -10%; width: 50vw; height: 50vw;
    background: rgba(13, 59, 120, 0.10); 
    border-radius: 50%;
}
.shape-2 {
    bottom: -10%; right: -10%; width: 40vw; height: 40vw;
    background: rgba(196, 49, 45, 0.10); 
    border-radius: 50%;
    animation-delay: -5s;
}

@keyframes floatShape {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

h1, h2, h3 { 
    font-weight: 700; 
    line-height: 1.2; 
    color: var(--primary); 
}
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ============================================= */
/* 2. COMPONENTES UI                             */
/* ============================================= */

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Botones Modernos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 2rem; border-radius: 50px;
  font-weight: 600; cursor: pointer; border: none;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary)); 
  color: white;
  box-shadow: 0 10px 20px -5px var(--shadow-color);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 25px -5px rgba(13, 59, 120, 0.4); 
}

.btn-secondary {
  background: white;
  color: var(--primary); 
  border: 2px solid rgba(13, 59, 120, 0.1); 
}
.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(13, 59, 120, 0.05);
}

.badge-new {
    background: rgba(13, 59, 120, 0.1); 
    color: var(--primary); 
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Efecto Glass */
.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(217, 221, 226, 0.5); 
}

/* ============================================= */
/* 3. NAVBAR                                     */
/* ============================================= */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    height: var(--nav-height); z-index: 1000;
}
.navbar-content {
    display: flex; justify-content: space-between; align-items: center; height: 100%;
}
.navbar-brand { display: flex; align-items: center; gap: 0.8rem; }

.logo-image {
    height: 100px; 
    width: auto;  
    display: block;
    object-fit: contain;
}

.navbar-brand h1 {
    font-size: 1.5rem; letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--primary), var(--secondary)); 
    -webkit-background-clip: text; color: transparent;
}

.navbar-links button {
    background: none; border: none; font-family: inherit;
    font-size: 1rem; font-weight: 500; color: var(--gray-text); 
    margin-left: 2rem; padding: 0.5rem 0; cursor: pointer;
    position: relative;
}
.navbar-links button:hover, .navbar-links button.active-link { color: var(--secondary); }
.navbar-links button::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--secondary); transition: 0.3s;
}
.navbar-links button:hover::after { width: 100%; }

.btn-contact-nav {
    background: var(--dark-bg) !important; 
    color: white !important;
    padding: 0.5rem 1.5rem !important; border-radius: 30px;
}
.btn-contact-nav:hover { opacity: 0.9; }
.btn-contact-nav::after { display: none; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--primary); cursor: pointer;}

/* ============================================= */
/* 4. SECCIONES Y VISTAS                         */
/* ============================================= */
.view { display: none; padding: 2rem 0; min-height: calc(100vh - var(--nav-height)); }
.view.active { display: block; }

.fade-in { animation: fadeIn 0.6s ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* HERO SECTION */
.hero { display: flex; align-items: center; padding: 2rem 0; }
.hero-content { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 4rem; align-items: center; }

.hero-text h2 { font-size: 3.5rem; margin-bottom: 1rem; letter-spacing: -1px; color: var(--primary); }
.txt-type { color: var(--secondary); position: relative; } 
.txt-type::after { content: '|'; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-text .subtitle { font-size: 1.25rem; color: var(--dark-bg); margin-bottom: 1rem; font-weight: 500; }
.hero-text .description { color: var(--gray-text); margin-bottom: 2.5rem; max-width: 90%; }
.hero-buttons { display: flex; gap: 1rem; margin-bottom: 3rem; }

.stats-row { display: flex; gap: 3rem; border-top: 1px solid #D9DDE2; padding-top: 2rem; }
.stat-item strong { display: block; font-size: 1.5rem; color: var(--primary); }
.stat-item span { font-size: 0.9rem; color: var(--gray-text); }

.hero-image img, .hero-image video {
    border-radius: 2rem;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.1);
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.5s;
    max-height: 500px; width: 100%; margin: 0 auto; object-fit: cover;
}
.hero-image:hover img, .hero-image:hover video { transform: perspective(1000px) rotateY(0deg); }
.floating-anim { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ============================================= */
/* 5. SECCIÓN PREMIUM                            */
/* ============================================= */
.premium-section {
    padding: 0 1.5rem;
    margin: 4rem auto 5rem; 
    position: relative;
    z-index: 1;
    max-width: 1000px; 
    display: flex;
    justify-content: center;
}

.premium-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 1.5rem;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(13, 59, 120, 0.25); 
    border: none; 
    width: 100%;
}

.premium-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
    padding: 0.5rem;
}

.premium-item:hover { transform: translateY(-5px); }

.icon-box-glow {
    width: 70px; height: 70px;
    background: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.premium-text h3 {
    color: white !important; 
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.premium-text p {
    color: rgba(255, 255, 255, 0.9) !important; 
    font-size: 0.95rem;
    margin: 0;
}

.premium-divider {
    width: 1px;
    height: 60px;
    background: rgba(255,255,255,0.3);
}

/* ============================================= */
/* 6. CURSOS Y REFUERZOS                         */
/* ============================================= */

.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 0.5rem; color: var(--primary); }
.section-header p { color: var(--gray-text); font-size: 1.1rem; }

.cursos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

.card {
    background: white; border-radius: 1.5rem; overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid rgba(217, 221, 226, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-10px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }

.card-icon {
    height: 120px; display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: white;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}
.autocad-color { background: linear-gradient(135deg, #f87171, var(--autocad)); }
.inventor-color { background: linear-gradient(135deg, #fbbf24, var(--inventor)); }
.fusion-color { background: linear-gradient(135deg, #38bdf8, var(--fusion)); }

.card-body { padding: 2rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--dark-bg); }
.card-body p { color: var(--gray-text); font-size: 0.95rem; margin-bottom: 1.5rem; }
.feature-list { margin-bottom: 2rem; flex-grow: 1; }
.feature-list li { display: flex; gap: 0.8rem; font-size: 0.9rem; color: #475569; margin-bottom: 0.5rem; }
.feature-list i { color: var(--secondary); }

.btn-card { width: 100%; border-radius: 12px; margin-top: auto; }
.btn-autocad { background: rgba(225, 29, 72, 0.1); color: var(--autocad); }
.btn-autocad:hover { background: var(--autocad); color: white; }
.btn-inventor { background: rgba(245, 158, 11, 0.1); color: var(--inventor); }
.btn-inventor:hover { background: var(--inventor); color: white; }
.btn-fusion { background: rgba(14, 165, 233, 0.1); color: var(--fusion); }
.btn-fusion:hover { background: var(--fusion); color: white; }

/* Separador Refuerzos */
.separator-header {
    text-align: center; margin: 5rem 0 3rem;
    position: relative; display: flex; align-items: center; justify-content: center; gap: 1.5rem;
}
.separator-header h2 { font-size: 2.2rem; color: var(--dark-bg); margin: 0; }
.separator-line {
    height: 3px; width: 60px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 10px;
}

/* Colores Refuerzos */
.math-color { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.btn-math { background: rgba(59, 130, 246, 0.1); color: #1d4ed8; }
.btn-math:hover { background: #1d4ed8; color: white; }

.physics-color { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.btn-physics { background: rgba(139, 92, 246, 0.1); color: #6d28d9; }
.btn-physics:hover { background: #6d28d9; color: white; }

.chemistry-color { background: linear-gradient(135deg, #10b981, #047857); }
.btn-chemistry { background: rgba(16, 185, 129, 0.1); color: #047857; }
.btn-chemistry:hover { background: #047857; color: white; }

/* ============================================= */
/* 7. CONTACTO, FOOTER Y WHATSAPP                */
/* ============================================= */
.contacto-wrapper {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 0;
    background: white; border-radius: 2rem; overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1);
    border: 1px solid #D9DDE2;
}
.contacto-info {
    background: var(--dark-bg); 
    color: white; padding: 3rem;
    display: flex; flex-direction: column; gap: 2rem;
}
.info-desc { color: #D9DDE2; line-height: 1.6; }
.info-item { display: flex; align-items: center; gap: 1rem; }
.info-item i { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--secondary); }
.horarios-box { background: rgba(255,255,255,0.05); padding: 1.5rem; border-radius: 1rem; margin-top: auto; }

.contact-form { padding: 3rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--dark-bg); }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 1rem; border: 2px solid #D9DDE2;
    border-radius: 10px; font-family: inherit; transition: 0.3s;
    background: #f8fafc;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none; border-color: var(--primary); background: white;
    box-shadow: 0 0 0 4px rgba(13, 59, 120, 0.1);
}
.full-width { width: 100%; }

/* WhatsApp y Footer */
.whatsapp-flotante {
    position: fixed; bottom: 2rem; right: 2rem;
    background: #25d366; color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999; animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.footer { background: white; padding: 2rem 0; border-top: 1px solid #D9DDE2; margin-top: 2rem; }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.logo-image-footer {
    height: 100px; 
    width: auto;
    display: block;
    margin-bottom: 1rem; 
    object-fit: contain;
}
.footer-bottom p { color: var(--gray-text); font-size: 0.9rem; }

/* ============================================= */
/* 8. RESPONSIVE (MÓVILES)                       */
/* ============================================= */

@media (max-width: 900px) {
    /* Navbar: Botón hamburguesa visible y menú oculto por defecto */
    .mobile-menu-btn { display: block; }
    
    .navbar-links { 
        display: none; /* Se maneja con JS */
        flex-direction: column;
        position: absolute;
        top: 80px; left: 0; width: 100%;
        background: white;
        padding: 1rem;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-bottom: 1px solid #eee;
    }
    
    /* Esta clase se activa con JS para mostrar el menú */
    .navbar-links.mobile-active {
        display: flex;
    }

    .navbar-links button {
        margin: 0;
        padding: 1rem;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Hero Section: Apilar elementos */
    .hero-content { 
        grid-template-columns: 1fr; 
        text-align: center; 
        gap: 2rem;
    }
    .hero-image { order: -1; margin-bottom: 1rem; max-width: 100%; }
    .hero-text h2 { font-size: 2.5rem; }
    .hero-text .description { margin: 0 auto 2rem; }
    .hero-buttons { justify-content: center; flex-wrap: wrap; }
    
    /* Stats: Envolver */
    .stats-row { 
        justify-content: center; 
        flex-wrap: wrap; 
        gap: 2rem; 
    }

    /* Premium Banner: Columna en vez de fila */
    .premium-banner {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem;
        align-items: center;
        text-align: center;
    }
    .premium-divider { display: none; }
    .premium-item { 
        flex-direction: column; 
        width: 100%; 
        justify-content: center; 
    }
    .premium-text { text-align: center; }

    /* Contacto: Apilar info y formulario */
    .contacto-wrapper { grid-template-columns: 1fr; }
    .contacto-info { padding: 2rem; }
    .contact-form { padding: 2rem; }

    /* Footer: Apilar */
    .footer-content { 
        flex-direction: column; 
        text-align: center; 
        gap: 2rem;
    }
    .footer-brand { flex-direction: column; }
    
    /* Ajustes generales de texto */
    .separator-header { flex-direction: column; gap: 0.5rem; }
    .separator-line { width: 100px; }
    .separator-header h2 { font-size: 1.8rem; }
}

/* ============================================= */
/* 9. PANTALLA DE PRE-CARGA (PRELOADER)          */
/* ============================================= */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Estilo del Logo Gigante Animado */
.logo-gigante {
    width: 500px; 
    height: auto;
    opacity: 0;
    
    /* Secuencia: Aparece en 1s y luego late (pulso) indefinidamente */
    animation: 
        aparecerLogo 1s ease-out forwards,
        pulsoLogo 2.5s ease-in-out 1s infinite;
}

.texto-tecnium {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    color: transparent;
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 2px;
    animation: subirTexto 0.8s ease-out forwards;
    animation-delay: 0.8s;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Keyframes */
@keyframes aparecerLogo {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulsoLogo {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); } /* Latido */
    100% { transform: scale(1); }
}

@keyframes subirTexto {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajuste móvil Preloader */
@media (max-width: 768px) {
    .logo-gigante { width: 120px; } 
    .texto-tecnium { font-size: 2rem; }
}