/* ==========================================================================
   Variables y Reseteo
   ========================================================================== */
:root {
    --c-primary: #0a2442;
    --c-secondary: #4d6f8b;
    --c-bg: #ffffff;
    --c-light: #f4f7f9;
    --c-dark: #061526;
    --c-text: #333333;
    --c-text-light: #666666;
    --c-error: #e53935;
    
    --f-main: 'Inter', system-ui, -apple-system, sans-serif;
    
    --transition: all 0.3s ease;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 30px rgba(10, 36, 66, 0.15);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; 
}

body {
    font-family: var(--f-main);
    color: var(--c-text);
    background-color: var(--c-bg);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* ==========================================================================
   Tipografía y Utilidades
   ========================================================================== */
h1, h2, h3, h4 { color: var(--c-primary); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; color: var(--c-text-light); }

a { text-decoration: none; color: var(--c-secondary); transition: var(--transition); }
a:hover { color: var(--c-primary); }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 80px 0; }
.bg-light { background-color: var(--c-light); }
.bg-dark { background-color: var(--c-dark); }
.text-white, .text-white p, .text-white h2 { color: #fff; }
.h2-light { color: #fff; }

.section-header { text-align: center; max-width: 700px; margin: 0 auto 50px; }

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}
.btn-primary { background: var(--c-secondary); color: #fff; }
.btn-primary:hover { background: var(--c-primary); color: #fff; transform: translateY(-2px); }
.btn-outline-light { background: transparent; border-color: #fff; color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--c-dark); }
.btn-block { display: block; width: 100%; }

/* ==========================================================================
   Navegación
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    z-index: 1000;
    transition: var(--transition);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }

/* Adaptación del Logo y Texto alineado al bottom */
.logo { 
    height: 100%; 
    display: flex; 
    align-items: center; 
}
.logo a { 
    display: flex; 
    align-items: flex-end; /* Alineación bottom */
    gap: 12px; /* Espacio entre imagen y texto */
    text-decoration: none;
}
.logo img { 
    max-height: 60px; 
    width: auto; 
    object-fit: contain;
}
.logo-text {
    font-size: 1.0rem;
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1; /* Ajuste estricto al borde inferior */
    padding-bottom: 2px; /* Pequeño margen para compensar el espacio en blanco de la imagen si es necesario */
    white-space: nowrap;
}

.nav-links { display: none; list-style: none; }
.nav-links li { margin-left: 2rem; }
.nav-links a { color: var(--c-text); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--c-secondary); }
.btn-nav { border: 2px solid var(--c-secondary); padding: 8px 20px; border-radius: 4px; color: var(--c-secondary) !important; }
.btn-nav:hover { background: var(--c-secondary); color: #fff !important; }

/* Menú Hamburguesa */
.mobile-toggle {
    display: flex; flex-direction: column; justify-content: space-between;
    width: 30px; height: 21px;
    background: transparent; border: none; cursor: pointer; z-index: 1001;
}
.mobile-toggle span {
    width: 100%; height: 3px; background-color: var(--c-primary);
    transition: var(--transition); border-radius: 2px;
}

/* ==========================================================================
   Inicio (Hero) - Infraestructura y Servidores
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    
    /* Imagen de racks descargada y guardada en la carpeta img/ */
    background-image: url('../img/data8.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; 
}

/* Overlay más denso y oscuro */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(10, 36, 66, 0.85) 0%, rgba(6, 21, 38, 0.95) 100%);
    z-index: 1;
}

/* Degradado inferior */
.hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(244, 247, 249, 0) 0%, rgba(244, 247, 249, 1) 100%);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

.hero-content h1 {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); 
}

.hero-content p {
    color: #e0e8ef; 
    font-size: 1.1rem;
}

.hero .badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(77, 111, 139, 0.3); 
    color: #ffffff;
    border: 1px solid rgba(77, 111, 139, 0.5);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Componentes (Línea de tiempo, Cards, Formularios)
   ========================================================================== */
/* Timeline */
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 20px;
    width: 2px; background: var(--c-secondary); opacity: 0.3;
}
.timeline-item { position: relative; padding-left: 60px; margin-bottom: 40px; }
.timeline-item::before {
    content: ''; position: absolute; left: 14px; top: 5px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--c-secondary); border: 4px solid var(--c-light);
}
.year { font-size: 1.5rem; font-weight: 700; color: var(--c-primary); margin-bottom: 5px; }

/* Grid & Cards */
.grid { display: grid; gap: 30px; }
.cards { grid-template-columns: 1fr; }
.card {
    background: #fff; padding: 40px 30px; border-radius: 8px;
    box-shadow: var(--shadow); transition: var(--transition);
    border: 1px solid #eee;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-5px); }
.card .icon { color: var(--c-secondary); margin-bottom: 20px; }

/* Integradores Split Layout */
.split-layout { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.partner-logos {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 20px; padding: 40px; background: rgba(255,255,255,0.05); border-radius: 8px;
}

/* Cajas de Logos */
.logo-box {
    background-color: #ffffff; 
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid var(--c-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 90px;
    box-shadow: var(--shadow);
}
.logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.logo-box.text-logo {
    font-weight: 700;
    color: var(--c-primary);
    text-align: left;
    font-size: 0.65rem;
    line-height: 1.2;
}
.plus-sign { font-size: 2rem; color: var(--c-secondary); }

.mandatory-legend {
    font-size: 0.85rem;
    color: var(--c-text-light);
    font-style: italic;
    margin-bottom: 15px;
}
.status-error {
    color: var(--c-error);
}

/* Formulario */
.contact-grid { grid-template-columns: 1fr; }
.form { background: #fff; padding: 40px; border-radius: 8px; box-shadow: var(--shadow); }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--c-primary); }
input, select, textarea {
    width: 100%; padding: 12px; border: 1px solid #ccc;
    border-radius: 4px; font-family: inherit; transition: var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--c-secondary); outline: none; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* Validaciones CSS */
.error-msg { color: var(--c-error); font-size: 0.8rem; display: none; margin-top: 5px; }
.form-group.error input, .form-group.error textarea { border-color: var(--c-error); }
.form-group.error .error-msg { display: block; }
.form-status { margin-top: 20px; text-align: center; font-weight: 600; }
.status-success { color: #2e7d32; }

/* Footer */
.footer { background: var(--c-primary); color: #fff; padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-bottom: 40px; }
.footer h3, .footer h4 { color: #fff; }
.footer-links ul { list-style: none; }
.footer-links a { color: #aaa; }
.footer-links a:hover { color: #fff; }
.footer-bottom { background: var(--c-dark); padding: 20px 0; text-align: center; font-size: 0.9rem; }
.footer-bottom .container { display: flex; flex-direction: column; gap: 10px; }

/* ==========================================================================
   Animaciones (Intersection Observer)
   ========================================================================== */
.animate-on-scroll { opacity: 0; transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1); }
.fade-up { transform: translateY(30px); }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* ==========================================================================
   Media Queries
   ========================================================================== */
/* Ajuste de logo para dispositivos pequeños */
@media (max-width: 767px) {
    .logo img { max-height: 40px; }
    .logo-text { font-size: 0.9rem; }
}

/* Tablet (768px y superior) */
@media (min-width: 768px) {
    .cards { grid-template-columns: repeat(3, 1fr); }
    .contact-grid { grid-template-columns: 1fr 2fr; }
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-bottom .container { flex-direction: row; justify-content: space-between; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Desktop (1024px y superior) */
@media (min-width: 1024px) {
    .mobile-toggle { display: none; }
    .nav-links { display: flex; align-items: center; }
    .hero-content { font-size: 1.1rem; }
    .split-layout { grid-template-columns: 1fr 1fr; }
    .timeline-item:hover::before { transform: scale(1.2); transition: var(--transition); }
}

/* Mobile Menú Abierto */
@media (max-width: 1023px) {
    .nav-links {
        display: flex; /* <--- ESTA ES LA LÍNEA QUE FALTABA */
        position: fixed; 
        top: 80px; 
        left: -100%; 
        width: 100%; 
        height: calc(100vh - 80px);
        background: #fff; 
        flex-direction: column; 
        align-items: center; 
        justify-content: center;
        transition: var(--transition);
    }
    
    .nav-links.active { left: 0; }
    
    .nav-links li { margin: 15px 0; }
    
    .mobile-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}