/* --- CONFIGURACIÓN BASE (Light Mode Premium) --- */
:root {
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;      /* Gris muy suave (Slate 100) */
    --text-main: #0f172a;     /* Azul muy oscuro casi negro (Slate 900) */
    --text-muted: #64748b;    /* Gris medio (Slate 500) */
    
    /* ACENTO: Azul Eléctrico Vibrante (Sin gradientes en texto) */
    --accent: #2563eb;        
    --accent-hover: #1d4ed8;
    
    /* Bordes y Sombras */
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 20px 25px -5px rgba(37, 99, 235, 0.15), 0 10px 10px -5px rgba(37, 99, 235, 0.1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand, .btn, .badge-hero {
    font-family: 'Manrope', sans-serif; /* Fuente moderna para títulos */
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
.container { max-width: 1150px; margin: 0 auto; padding: 0 24px; }
.section-pad { padding: 100px 0; }
.bg-light { background-color: var(--bg-light); }
.text-accent { color: var(--accent); }

/* --- NAVBAR (Versión Oscura - Dark Slate) --- */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: #0f172a; /* Fondo oscuro sólido */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.nav-content { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 1.4rem; font-weight: 800; color: white; letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a { font-weight: 500; color: #cbd5e1; font-size: 0.95rem; }
.nav-links a:hover { color: white; }

.btn-nav {
    background: white; color: #0f172a !important;
    padding: 8px 24px; border-radius: 6px; font-weight: 700; transition: 0.3s;
}
.btn-nav:hover { background: var(--accent); color: white !important; }
.mobile-menu-icon { display: none; font-size: 1.5rem; cursor: pointer; color: white; }

/* --- HERO SECTION (Con Vida y Movimiento) --- */
.hero { 
    padding: 120px 0 100px; 
    overflow: hidden;
    position: relative;
    background-color: #f8fafc;
    /* Patrón de puntos sutil para dar textura técnica */
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
}

.hero-grid { 
    display: grid; grid-template-columns: 1.2fr 0.8fr; 
    gap: 60px; align-items: center; position: relative; z-index: 1; 
}

/* Badge limpio */
.badge-hero {
    display: inline-block; background: white; color: var(--accent);
    padding: 6px 12px; border-radius: 50px; font-weight: 800; font-size: 0.8rem;
    text-transform: uppercase; margin-bottom: 24px; letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm); border: 1px solid #e2e8f0;
}

.hero-text h1 {
    font-size: 3.5rem; line-height: 1.15; font-weight: 800; 
    color: var(--text-main); margin-bottom: 24px;
}

/* Color sólido vibrante (Sin errores de clip) */
.hero-text .highlight {
    color: var(--accent);
    position: relative;
}

/* Subrayado suave detrás del texto para dar profundidad */
.hero-text .highlight::after {
    content: ''; position: absolute;
    bottom: 5px; left: 0; width: 100%; height: 12px;
    background: rgba(37, 99, 235, 0.15); /* Azul muy suave */
    z-index: -1; transform: rotate(-1deg);
}

/* --- ESTILO ROJO PARA PRICING --- */
.hero-text .highlight-red {
    /* Rojo potente pero profesional (Carmesí) */
    color: #dc2626; 
    position: relative;
    display: inline-block;
}

/* Subrayado suave rojo detrás del texto */
.hero-text .highlight-red::after {
    content: '';
    position: absolute;
    bottom: 5px; left: 0;
    width: 100%; height: 12px;
    
    /* Fondo rojo muy suave y translúcido */
    background: rgba(220, 38, 38, 0.1); 
    
    z-index: -1;
    /* Inclinación opuesta al azul para dar dinamismo */
    transform: skewX(10deg); 
}

/* Ajuste para la negrita del subtítulo */
.hero-subtitle strong {
    color: var(--text-main); /* Color oscuro para destacar */
    font-weight: 700;
}

.hero-subtitle { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 35px; max-width: 550px; }

.cta-group { display: flex; gap: 16px; }

/* Botón con degradado (Aquí sí es seguro y queda bonito) */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 32px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.3s; }

.btn-primary { 
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); /* Gradiente sutil azul */
    color: white; border: none; 
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4); }

.btn-secondary { background: white; color: var(--text-main); border: 1px solid #cbd5e1; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* --- ANIMACIÓN FLOTANTE (Da vida sin molestar) --- */
@keyframes swayPendulum {
    0% { 
        transform: rotate(-5deg); /* Se inclina más a la izquierda */
    }
    50% { 
        transform: rotate(-1deg); /* Se endereza un poco hacia la derecha */
    }
    100% { 
        transform: rotate(-5deg); /* Vuelve a la izquierda */
    }
}

/* --- TARJETA VISUAL --- */
.data-flow-card {
    background: white; 
    border: 1px solid white;
    padding: 30px; 
    border-radius: 20px;
    
    /* Sombra suave */
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.15), 0 10px 10px -5px rgba(37, 99, 235, 0.1);
    
    width: 100%; max-width: 380px;
    display: flex; flex-direction: column; gap: 15px;
    
    /* APLICAMOS LA ANIMACIÓN DE PÉNDULO */
    /* 6 segundos para que sea muy calmado y relajante */
    animation: swayPendulum 6s ease-in-out infinite;
    
    /* Preparamos la transición suave para el hover */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    position: relative;
    z-index: 10;
    
    /* El punto de pivote es el centro */
    transform-origin: center center;
}

/* AL PASAR EL RATÓN: SE PONE RECTO */
.data-flow-card:hover { 
    transform: rotate(0deg) scale(1.02); /* Se endereza y crece un pelín */
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25); /* La sombra crece */
     animation: float 4s ease-in-out infinite;
    cursor: default;
}



/* Elementos dentro de la tarjeta */
.df-row { display: flex; align-items: center; gap: 15px; padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid #f1f5f9; }
.df-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; }
.icon-red { background: #ef4444; }
.icon-blue { background: #3b82f6; }
.icon-green { background: #10b981; }
.df-text strong { display: block; font-size: 0.95rem; color: var(--text-main); }
.df-text span { font-size: 0.8rem; color: var(--text-muted); }
.df-arrow { text-align: center; color: #cbd5e1; font-size: 1.2rem; }

/* --- METODOLOGÍA (Tarjetas limpias) --- */
/* --- METODOLOGÍA (Contraste Real: Gris Tecnológico) --- */
/* --- METODOLOGÍA (Fondo Hormigón + Trama de Puntos) --- */
#metodologia {
    /* 1. Fondo base (Gris Tecnológico Sólido) */
    background-color: #EEF2F6; 
    
    /* 2. LA TRAMA DE PUNTOS (Igual que en Hero y Proyectos) */
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    
    /* Borde superior para separar secciones */
   
    position: relative;
    padding: 80px 0 120px; 
}
.title-wrap { text-align: center; margin-bottom: 70px; }

#metodologia .section-title { 
    font-size: 2.4rem; 
    font-weight: 800; 
    margin-bottom: 15px; 
    color: #0f172a; 
}

#metodologia .section-desc { 
    font-size: 1.15rem; 
    color: #475569; 
    max-width: 700px;
    margin: 0 auto;
    font-weight: 500;
}

/* --- GRID --- */
.grid-4 { 
    display: grid; 
    gap: 30px; 
    
    /* 1. Por defecto (Móvil): 1 columna */
    grid-template-columns: 1fr; 
}

/* 2. Tablets y Portátiles (a partir de 600px de ancho): 2 columnas */
@media (min-width: 600px) {
    .grid-4 {
        /* Aquí forzamos el 2x2 que querías */
        grid-template-columns: repeat(2, 1fr); 
    }
}

/* 3. Escritorios grandes (a partir de 1200px): 4 columnas */
@media (min-width: 1200px) {
    .grid-4 {
        /* Solo en pantallas muy anchas se verá la fila de 4 */
        grid-template-columns: repeat(4, 1fr); 
    }
}

.step-card {
    background: white; 
    padding: 45px 25px; 
    border-radius: 16px;
    
    /* Al tener fondo gris, la tarjeta blanca necesita sombra limpia */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid white; /* Borde blanco para resaltar */
    
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

/* Hover: La tarjeta "salta" hacia el usuario */
.step-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-color: var(--accent);
}

.step-icon { 
    font-size: 2rem; 
    color: var(--accent); 
    margin-bottom: 25px;
    
    background: #f1f5f9; /* Fondo gris muy suave para el icono */
    width: 70px; height: 70px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
    border: 1px solid #e2e8f0;
}

.step-card:hover .step-icon {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
    border-color: var(--accent);
}

.step-card h3 { 
    font-size: 1.25rem; 
    margin-bottom: 12px; 
    color: #1e293b; 
    font-weight: 800;
}

.step-card p { 
    font-size: 0.95rem; 
    color: #64748b; 
    line-height: 1.6;
}

/* --- SERVICIOS --- */
#servicios {
    /* Base Gris Hormigón */

    
    /* AÑADIDO: Trama de puntos sutil (igual que en Hero) */
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    

}
.services-split { display: flex; flex-wrap: wrap; justify-content: center; gap: 60px; }
.service-box { flex: 1; min-width: 300px; max-width: 500px; }
.service-box h3 { font-size: 1.5rem; display: flex; align-items: center; gap: 12px; margin-bottom: 15px; color: var(--text-main); }
.check-list { list-style: none; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 20px; }
.check-list li { margin-bottom: 12px; font-size: 1rem; color: var(--text-main); position: relative; padding-left: 25px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: bold; }
.vertical-line { width: 1px; background: var(--border); display: none; }
@media(min-width: 900px) { .vertical-line { display: block; } }

/* --- PROYECTOS --- */
#proyectos {
    background-color: #EEF2F6; 
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    border-top: 1px solid #cbd5e1;
    padding: 80px 0;
    position: relative;
}

.projects-grid { 
    display: grid; 
    gap: 30px; 
    margin-top: 40px; 
    
    /* 1. Por defecto (Móvil): 1 sola columna. Esto arregla el desbordamiento. */
    grid-template-columns: 1fr; 
}

/* 2. En pantallas de más de 768px (tablets/escritorio) pasamos a 2 columnas */
@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 40px;
    }
}

#proyectos .section-title { 
    font-size: 2.4rem; 
    font-weight: 800; 
    margin-bottom: 15px; 
    color: #0f172a; 
}

#proyectos .section-desc { 
    font-size: 1.15rem; 
    color: #475569; 
    max-width: 700px;
    margin: 0 auto;
    font-weight: 500;
}

.project-card {
    background: white; 
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex; 
    flex-direction: column;
    transition: all 0.3s ease;
}

.project-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.card-image { 
    height: 220px;
    width: 100%;
    background-color: #f1f5f9; 
    position: relative; 
    border-bottom: 1px solid #e2e8f0;
}

.card-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    object-position: top center; 
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .card-image img { 
    transform: scale(1.05); 
}

.card-body { 
    padding: 24px;
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    text-align: left; 
}

.badge-cat { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    font-weight: 700; 
    color: var(--accent);
    margin-bottom: 10px; 
    display: block; 
}

.card-body h4 { 
    font-size: 1.4rem; 
    margin-bottom: 10px; 
}

.card-body p { 
    font-size: 1rem; 
    color: #64748b; 
    margin-bottom: 20px; 
    flex: 1; 
}

.card-link { 
    font-weight: 600; 
    color: var(--accent); 
}

.private-badge {
    font-size: 0.8rem;
    color: #64748b; 
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    align-self: flex-start;
    font-weight: 500;
}
/* --- FOOTER FINAL --- */
footer { 
    background: #0f172a; 
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 80px 0 30px; 
    color: #cbd5e1; 
}

.footer-layout { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 40px; 
    flex-wrap: wrap; /* Para que se adapte en móviles */
    gap: 30px;
}

.footer-brand h3 { font-size: 1.5rem; margin-bottom: 10px; color: white; }
.footer-brand p { color: #94a3b8; margin-bottom: 15px; }

.email-link { font-size: 1.1rem; font-weight: 600; color: var(--accent); }
.email-link:hover { color: white; }

/* Enlaces del Footer */
.footer-links { 
    display: flex; 
    gap: 15px; 
    align-items: center;
    flex-wrap: wrap;
}

.footer-links a, 
.footer-links button { 
    background: none; 
    border: none; 
    font-size: 0.95rem; 
    cursor: pointer; 
    color: #cbd5e1; 
    font-weight: 500;
    transition: 0.2s;
    font-family: inherit;
    text-decoration: none;
    padding: 0;
}

.footer-links a:hover, 
.footer-links button:hover { 
    color: white; 
    text-decoration: underline;
}

/* El separador | */
.separator {
    color: #475569; /* Gris oscuro para que no moleste */
    font-size: 0.9rem;
}

.footer-copy { 
    text-align: center; 
    color: #64748b; 
    font-size: 0.9rem; 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    padding-top: 30px; 
    margin-top: 20px;
}

/* --- COOKIES (Banner limpio) --- */
.hidden { display: none !important; }
.cookie-banner {
    position: fixed; bottom: 20px; right: 20px; 
    background: white; padding: 20px; 
    border-radius: 12px; box-shadow: var(--shadow-card);
    border: 1px solid var(--border); z-index: 2000;
    width: 320px;
}
.cookie-content p { font-size: 0.9rem; margin-bottom: 15px; color: var(--text-muted); }
.cookie-actions { display: flex; gap: 10px; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-solid { background: var(--text-main); color: white; border: none; }
.btn-solid:hover { background: black; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-main); }

/* Modal */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5); /* Backdrop oscuro */
    z-index: 3000;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(2px);
}
.modal-panel {
    background: white; width: 90%; max-width: 450px;
    border-radius: 12px; box-shadow: var(--shadow-card);
    overflow: hidden;
}
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.close-x { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 20px; }
.pref-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.pref-row p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.modal-foot { padding: 15px 20px; background: var(--bg-light); text-align: right; border-top: 1px solid var(--border); }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* Animations */
.fade-in { opacity: 0; transform: translateY(20px); transition: 0.6s ease-out; }
.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media(max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-visual { display: none; }
    .nav-links { display: none; }
    .mobile-menu-icon { display: block; }
    .hero-text h1 { font-size: 2.5rem; }
}

/* --- ESTILOS DEL MENÚ MÓVIL --- */

/* Cuando la pantalla es pequeña... */
@media (max-width: 767px) {
    
    /* 1. Así es como se ve el menú DESPLEGADO */
    .nav-links.nav-active {
        /* Se muestra (antes estaba en display: none) */
        display: flex; 
        
        /* Se coloca como una capa encima de todo */
        position: fixed;
        top: 67px; /* Justo debajo de la barra de navegación */
        left: 0;
        width: 100%;
        height: calc(100vh - 67px); /* Ocupa el resto de la pantalla */
        
        /* Fondo oscuro, igual que la barra */
        background: #0f172a;
        
        /* Pone los enlaces en columna y centrados */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px; /* Espacio grande entre enlaces */

        /* Animación de entrada */
        animation: slideDown 0.4s ease-out;
    }

    /* 2. Estilo de los enlaces DENTRO del menú móvil */
    .nav-links.nav-active a {
        color: white;
        font-size: 1.5rem; /* Letra grande para que sea fácil de tocar */
        font-weight: 700;
        opacity: 0;
        animation: fadeIn 0.5s ease-out 0.2s forwards; /* Aparecen con un pequeño retraso */
    }

    /* 3. Animaciones */
    @keyframes slideDown {
        from {
            transform: translateY(-100%);
        }
        to {
            transform: translateY(0);
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}