/* ==========================================
    VARIABLES Y CONFIGURACIÓN BASE
   ========================================== */
:root {
  --primary: #1A5FA8;
  --primary-dark: #0D3B6E;
  --primary-light: #2B82D4;
  --accent: #1E8A5E;
  --accent-light: #27B07A;
  --text: #1a1d23;
  --text-sub: #6b7280;
  --bg: #ffffff;
  --bg-gray: #f4f6f9;
  --bg-dark: #0D1B2E;
  --bg-dark-2: #0f2540;
  --border: rgba(26, 95, 168, 0.12);
  --shadow-sm: 0 2px 8px rgba(13, 59, 110, 0.08);
  --shadow-md: 0 8px 30px rgba(13, 59, 110, 0.12);
  --shadow-lg: 0 20px 50px rgba(13, 59, 110, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html { 
  scroll-behavior: smooth; 
}

body {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================
    HEADER Y NAVEGACIÓN
   ========================================== */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

#header.scrolled {
  box-shadow: 0 4px 24px rgba(13,59,110,0.10);
  background: rgba(255,255,255,0.98);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-sub);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
  background: rgba(26, 95, 168, 0.06);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 4px;
}

/* ==========================================
    BOTONES 
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(26, 95, 168, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 95, 168, 0.35);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
}

.btn-nav {
  background: var(--primary);
  color: white !important;
  padding: 9px 22px !important;
  margin-left: 8px;
}

.btn-full { width: 100%; justify-content: center; }

/* ==========================================
    HERO SECTION
   ========================================== */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-2) 55%, #1A3A6B 100%);
  display: flex;
  align-items: center;
  padding: 110px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.blob-1 { width: 500px; height: 500px; background: var(--primary-light); top: -100px; right: -100px; }
.blob-2 { width: 350px; height: 350px; background: var(--accent); bottom: -80px; left: 100px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 50px;
  margin-bottom: 28px;
}

.badge-dot {
  width: 7px; height: 7px;
  background: var(--accent-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  color: white;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-text h1 em {
  font-style: normal;
  color: var(--accent-light);
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  max-width: 480px;
  margin-top: 20px;
}

.stat { flex: 1; padding: 18px 20px; }
.stat-num { font-size: 1.9rem; font-weight: 800; color: white; display: block; }
.stat-label { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }
.stat-divider { width: 1px; background: rgba(255,255,255,0.1); }

.hero-visual { position: relative; height: 480px; }
.hero-card {
  position: absolute;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1);
  transition: 0.4s ease;
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.card-main { width: 85%; height: 320px; top: 0; right: 0; z-index: 2; }

.floating-badge {
  position: absolute;
  bottom: 80px;
  left: -20px;
  background: white;
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 700;
  color: var(--accent);
  box-shadow: var(--shadow-md);
  z-index: 10;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ==========================================
    SECCIÓN BENEFICIOS
   ========================================== */

.beneficios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.beneficio-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    text-align: center;
}

.beneficio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.beneficio-icon {
    width: 70px;
    height: 70px;
    background: rgba(26, 95, 168, 0.1); /* Color primario con opacidad */
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 25px;
}

.beneficio-card h3 {
    font-size: 1.3rem;
    color: #0f172a;
    margin-bottom: 15px;
}

.beneficio-card p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================
    SECCIÓN LOGOS
   ========================================== */
.section-logotypes {
    padding: 40px 0;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.logos-title {
    text-align: center;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #94a3b8;
    margin-bottom: 30px;
    font-weight: 700;
}

.logos-slider {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px 60px;
    opacity: 0.7;
}

.logo-item img {
    height: 75px; /* Ajusta según el tamaño de tus logos */
    width: auto;
    filter: grayscale(100%); /* Hace que los logos sean grises para no distraer */
    transition: filter 0.3s ease;
}

.logo-item img:hover {
    filter: grayscale(0%); /* El logo recupera color al pasar el mouse */
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .logos-slider {
        gap: 30px;
    }
    .logo-item img {
        height: 50px;
    }
}

/* ==========================================
    SECCIÓN SERVICIOS (GRID & CARDS)
   ========================================== */
.section { padding: 100px 0; }
.section-dark { background: var(--bg-dark); color: white; }
.section-head { text-align: center; margin-bottom: 60px; max-width: 700px; margin-inline: auto; }

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ==========================================
    SECCIÓN SERVICIOS (ORDEN 2-2-1)
   ========================================== */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Crea 2 columnas */
    gap: 25px;
}

.serv-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

/* SERVICIOS 1, 2, 3 y 4: Mantienen formato vertical (uno al lado del otro) */
.serv-card:nth-child(-n+4) .serv-img-static {
    width: 100%;
    height: 220px;
}

/* SERVICIO 5: Ocupa todo el largo y se ve alargado */
.serv-card:nth-child(5) {
    grid-column: 1 / -1; /* Ocupa las dos columnas */
    flex-direction: row; /* Imagen al lado del texto */
    min-height: 280px;
}

.serv-card:nth-child(5) .serv-img-wrap {
    width: 45%;
    min-width: 45%;
}

/* Efectos Globales */
.serv-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-8px);
    border-color: var(--primary-light);
}

.serv-img-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

.serv-card:hover .serv-img-bg {
    transform: scale(1.05);
}

.serv-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.serv-body h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.serv-body p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .servicios-grid {
        grid-template-columns: 1fr; /* Todo a una columna */
    }
    
    .serv-card:nth-child(5) {
        flex-direction: column;
    }
    
    .serv-card:nth-child(5) .serv-img-wrap {
        width: 100%;
        height: 200px;
    }
}

/* ==========================================
    CONTACTO Y FORMULARIO (CENTRADO)
   ========================================== */
.section-gray {
    background-color: #f8fafc;
    padding: 80px 0; /* Espaciado vertical para la sección */
}

.contacto-layout {
    display: flex;
    justify-content: center; /* Centra horizontalmente */
    align-items: center;
    width: 100%;
}

.contacto-form-wrap {
    background: white;
    padding: 45px;
    border-radius: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--primary);
    
    /* Control de ancho */
    width: 100%;
    max-width: 700px; /* Evita que sea demasiado ancho en pantallas grandes */
    margin: 0 auto;   /* Asegura el centrado */
}

.form-header {
    margin-bottom: 35px;
    text-align: center; /* Centra el texto del encabezado del formulario */
}

.form-header h3 {
    font-size: 1.8rem;
    color: #0f172a;  
    margin-bottom: 10px;
}

.form-header p {
    color: #64748b;
    font-size: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    background-color: #fcfcfc;
    transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(26, 95, 168, 0.1);
}

.btn-full {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.btn-lg {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 18px; /* Un poco más de altura para el botón centrado */
}

.form-footer {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 25px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .contacto-form-wrap {
        padding: 30px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
    }
    
    .form-header h3 {
        font-size: 1.5rem;
    }
}

/* Estilos para Validaciones */
.error-msg {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none; /* Se activa con JS */
    font-weight: 500;
}

.input-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

/* Animación de carga */
.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}


/* ==========================================
    FOOTER
   ========================================== */
footer {
  background: #060f1c;
  color: rgba(255,255,255,0.5);
  padding: 80px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 50px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.footer-logo-container {
    display: flex;
    align-items: center; /* Centra verticalmente el texto con el logo */
    gap: 5px;           /* Espacio entre ATYLAB y el logo */
    margin-bottom: 15px; /* Espacio con el párrafo de abajo */
}

.footer-logo-mark {
    margin-bottom: 0 !important; /* Quitamos el margen inferior por defecto */
}


.footer-logo-mark { color: white; font-size: 1.5rem; font-weight: 800; margin-bottom: 20px; }
.footer-col h5 { color: white; text-transform: uppercase; font-size: 0.75rem; margin-bottom: 20px; }
.footer-nav a { display: block; color: inherit; text-decoration: none; margin-bottom: 10px; transition: 0.2s; }
.footer-nav a:hover { color: white; }

/* ==========================================
   10. RESPONSIVE / MEDIA QUERIES
   ========================================== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .contacto-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: white;
    flex-direction: column;
    padding: 30px;
    transform: translateY(-150%);
    transition: 0.4s;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { transform: translateY(0); }
  .servicios-grid { grid-template-columns: 1fr; }
  .serv-card-wide { flex-direction: column; }
  .serv-img-wrap { width: 100%; height: 200px; }
}