/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */

html {
  scroll-behavior: smooth;
}

:root {
    --primary: #38bdf8;
    /* Azul tecnológico */
    --primary-glow: rgba(56, 189, 248, 0.5);
    --dark: #020617;
    /* Negro profundo */
    --navy-light: #0f172a;
    /* Azul navy para tarjetas */
    --accent: #10b981;
    /* Verde éxito */
    --text-main: #f8fafc;
    --text-gray: #94a3b8;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background: #f8fafc;
    line-height: 1.6;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* =========================================
   2. NAVEGACIÓN
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 8%;
    background: rgba(2, 6, 23, 0.95);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 2000;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-btn {
    background: var(--primary);
    color: var(--dark) !important;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* =========================================
   3. BOTÓN WHATSAPP
   ========================================= */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25d366;
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    z-index: 3000;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: var(--transition);
}

.whatsapp-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

.tooltip {
    position: absolute;
    right: 80px;
    background: white;
    color: var(--dark);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.whatsapp-btn:hover .tooltip {
    opacity: 1;
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(2, 6, 23, 0.8), rgba(2, 6, 23, 0.8)),
        url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?auto=format&fit=crop&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 10%;
}

.hero-content h1 {
    font-size: 4.8rem;
    font-weight: 800;
    margin: 1.5rem 0;
    line-height: 1.05;
}

.hero-content h1 span {
    color: var(--primary);
}

.badge {
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(56, 189, 248, 0.1);
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--dark);
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    transition: 0.3s;
}

.btn-secondary {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--primary-glow);
}

/* =========================================
   5. ESTADÍSTICAS
   ========================================= */
.stats {
    display: flex;
    justify-content: space-around;
    padding: 4rem 5%;
    background: var(--dark);
    color: white;
    width: 85%;
    margin: -70px auto 0;
    position: relative;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-item span {
    color: var(--text-gray);
    font-size: 0.95rem;
    font-weight: 500;
}

/* =========================================
   6. SERVICIOS Y SECCIONES
   ========================================= */
section {
    padding: 100px 8%;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background: white;
    padding: 4rem 2.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.icon-tech {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

/* =========================================
   7. PROYECTOS
   ========================================= */
.projects {
    background: #f1f5fslate-100;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 3rem;
    /* Asegura que todas las tarjetas de la misma fila midan lo mismo */
    align-items: stretch; 
}

.project-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: 0.4s;
    
    /* CAMBIO CLAVE: Convertimos la tarjeta en contenedor flex vertical */
    display: flex;
    flex-direction: column;
}

.project-img {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
    /* Evita que la imagen se encoja si hay mucho texto */
    flex-shrink: 0; 
}

.project-content {
    padding: 2.5rem;
    
    /* CAMBIO CLAVE: El contenido se expande para llenar el hueco */
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.project-content p {
    /* El párrafo crece y empuja lo que tenga debajo (el botón) */
    flex-grow: 1; 
    margin-bottom: 1.5rem;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.9rem 1.8rem;
    background: var(--dark);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: 0.3s;
    
    /* Asegura que el botón no se estire a lo ancho y se quede abajo */
    align-self: flex-start; 
    margin-top: auto; 
}

.tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary);
    color: var(--dark);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
}

/* =========================================
   8. FAQ
   ========================================= */
.faq-container {
    max-width: 850px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    padding: 2rem;
    border-left: 5px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.faq-item h4 {
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
}

/* =========================================
   9. CONTACTO PREMIUM
   ========================================= */
.contact-premium {
    background: var(--dark);
    padding: 120px 8%;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    background: var(--navy-light);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.contact-visual {
    background: linear-gradient(rgba(2, 6, 23, 0.85), rgba(2, 6, 23, 0.85)),
        url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&q=80');
    background-size: cover;
    padding: 4rem;
    display: flex;
    align-items: center;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    color: white;
    backdrop-filter: blur(15px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card h2 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1rem;
}

.method {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

.contact-form-container {
    padding: 5rem;
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-group label {
    display: block;
    color: #94a3b8;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 1.1rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    transition: 0.3s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #243146;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.submit-glow {
    background: var(--primary);
    color: var(--dark);
    padding: 1.3rem;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: 0.3s;
}

.submit-glow:hover {
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-2px);
}

/* =========================================
   10. FOOTER
   ========================================= */
.footer {
    text-align: center;
    padding: 4rem;
    background: var(--dark);
    color: #475569;
    border-top: 1px solid #1e293b;
    font-size: 0.9rem;
}

/* =========================================
   11. RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-visual {
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* Aquí se implementaría un menú móvil */
    .hero-content h1 {
        font-size: 2.8rem;
    }

    .stats {
        flex-direction: column;
        gap: 2.5rem;
        width: 90%;
        padding: 3rem 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form-container {
        padding: 2.5rem;
    }

    section {
        padding: 70px 5%;
    }
}

/* --- SECCIÓN TESTIMONIOS --- */
.testimonials {
    padding: 100px 8%;
    background: #f8fafc;
    /* Fondo claro para contrastar con el contacto oscuro */
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.testimonial-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(56, 189, 248, 0.1);
    border-color: var(--primary);
}

.quote-icon {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.2;
    position: absolute;
    top: 20px;
    right: 30px;
}

.testimonial-text {
    font-size: 1.1rem;
    color: #475569;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--primary);
}

.author-info strong {
    display: block;
    font-size: 1rem;
    color: var(--dark);
}

.author-info span {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

/* Efecto decorativo opcional para el fondo */
.testimonials {
    position: relative;
    overflow: hidden;
}

.testimonials::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

/* =========================================
   AJUSTE DE ESPACIADO Y COMPONENTES
   ========================================= */

/* 1. Corrección del Badge para permitir margen inferior */
.badge {
    display: inline-block; /* Crucial para que el margen inferior funcione */
    margin-bottom: 1.5rem; /* Ajusta este valor para más o menos espacio */
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(56, 189, 248, 0.1);
}

/* 2. Asegurar que en Testimonios el autor siempre esté abajo */
.testimonial-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Para que todas las tarjetas midan lo mismo en la fila */
}

.testimonial-text {
    flex-grow: 1; /* Empuja la sección del autor hacia el final de la tarjeta */
    margin-bottom: 2rem;
}

/* 3. Ajuste de espaciado en el header de sección para mayor claridad */
.section-header h2 {
    margin-top: 0; /* Evita márgenes extraños si el badge está arriba */
    line-height: 1.2;
}

/* =========================================
   CORRECCIÓN FINAL DE ESPACIADOS (SEGÚN IMAGEN)
   ========================================= */

/* 1. Reduce el espacio gigante entre secciones (FAQ y Testimonios) */
section {
    padding-top: 80px !important;    /* Reduce el espacio superior de la sección */
    padding-bottom: 40px !important; /* Reduce el espacio inferior de la sección */
}

/* 2. Separa el badge "FEEDBACK" del título "Voces de la Industria" */
.testimonials .badge {
    display: inline-block;
    margin-bottom: 20px !important; /* Añade el espacio que falta abajo */
    margin-top: 10px;               /* Espacio opcional arriba */
}

/* 3. Elimina margenes excesivos del encabezado de testimonios */
.testimonials .section-header {
    margin-bottom: 30px !important; /* Acerca el título a las tarjetas de abajo */
    margin-top: 0 !important;       /* Elimina huecos arriba */
}

/* 4. Ajuste extra para el FAQ (por si las cajas tienen mucho margen) */
.faq-item:last-child {
    margin-bottom: 0 !important;
}