/* --- HERO SECTION ANÁLISIS (Ajustado) --- */
.analysis-hero {
    background-color: #15233A; /* Azul Oscuro Corporativo */
    height: 50vh; /* Misma altura que Servicios/Tecnología */
    min-height: 450px;
    width: 100%;
    display: flex; /* Para centrar verticalmente el contenido */
    align-items: center;
    position: relative;
}

/* Ajuste específico de ancho al 80% */
.analysis-hero .contenedor {
    width: 80%; /* Solicitud específica */
    max-width: 1400px; /* Tope para pantallas gigantes */
    margin: 0 auto;
}

/* Grid de 2 Columnas */
.analysis-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem; /* Separación amplia entre texto e imagen */
    align-items: center;
}

/* Estilos de Texto */
.analysis-text-col h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem; /* Tamaño grande */
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.analysis-text-col p {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    padding-right: 2rem; /* Un poco de aire extra a la derecha del texto */
}

/* Botón CTA */
.btn-analysis-cta {
    display: inline-block;
    background-color: #187495;
    color: #ffffff;
    padding: 0.9rem 2.5rem;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(24, 116, 149, 0.4);
}

.btn-analysis-cta:hover {
    background-color: #135d78;
    transform: translateY(-3px);
}

/* Columna Imagen */
.analysis-img-col {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.img-wrapper {
    width: 100%;
    max-width: 100%;
    height: 350px; /* Altura controlada para que quepa en el 50vh */
    background-color: #1e293b;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 900px) {
    .analysis-hero {
        height: auto; /* En móvil altura libre */
        padding: 4rem 0;
    }

    .analysis-hero .contenedor {
        width: 90%; /* En móvil regresamos a 90% para aprovechar espacio */
    }

    .analysis-hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .analysis-text-col p {
        padding-right: 0;
    }

    .analysis-img-col {
        justify-content: center;
    }
}

/* --- SECCIÓN INGENIERÍA DE RIESGOS (Ajustada) --- */
.risk-engineering-section {
    padding: 6rem 0;
    background-color: #ffffff;
}

/* AJUSTE DE ANCHO: Restringir el contenedor al 80% en esta sección */
.risk-engineering-section .contenedor {
    width: 80%;
    max-width: 1400px;
    margin: 0 auto;
}

.engineering-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

/* Columna Imagen (Izquierda) */
.engineering-img-col {
    position: relative;
}

.img-frame {
    width: 100%;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

/* Estilos para el Placeholder Genérico (Bloque Gris) */
.generic-placeholder {
    width: 100%;
    height: 400px; /* Altura fija para que se vea el bloque */
    background-color: #cbd5e1; /* Gris claro */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #64748b;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Columna Texto (Derecha) */
.engineering-text-col h2 {
    font-size: 2.2rem;
    color: #15233A;
    margin-bottom: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Lista de Items */
.risk-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.risk-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.2rem;
    font-size: 1rem;
    color: #5B5A63;
    line-height: 1.5;
}

/* Checkmark Personalizado */
.risk-list li::before {
    content: '✔';
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    background-color: #187495;
    color: #ffffff;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: bold;
}

.risk-list li strong {
    color: #15233A;
    font-weight: 700;
    margin-right: 5px;
}

/* Responsive */
@media (max-width: 900px) {
    .risk-engineering-section .contenedor {
        width: 90%; /* En móvil regresamos a 90% */
    }
    .engineering-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .generic-placeholder {
        height: 300px; /* Un poco más bajo en móvil */
    }
}

/* --- SECCIÓN ESCENARIOS --- */
.scenarios-section {
    padding: 6rem 0;
    background-color: #F8FAFC; /* Fondo muy suave para diferenciar */
}

/* Ancho 80% consistente */
.scenarios-section .contenedor {
    width: 80%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Encabezado */
.section-header-center {
    text-align: center;
    margin-bottom: 4rem;
}
.section-header-center h2 {
    font-size: 2.5rem;
    color: #15233A;
    font-weight: 700;
}

/* Grid de 3 Columnas */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

/* Tarjeta Base */
.scenario-card {
    background-color: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    border-top: 5px solid #ccc; /* Color por defecto */
    transition: transform 0.3s ease;
}

.scenario-card:hover {
    transform: translateY(-5px);
}

/* Icono Superior */
.card-icon-top {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}
.card-icon-top svg {
    width: 30px;
    height: 30px;
}

/* Títulos y Etiquetas */
.scenario-card h3 {
    font-size: 1.5rem;
    color: #15233A;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.scenario-tag {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.scenario-card p {
    font-size: 1rem;
    color: #5B5A63;
    line-height: 1.6;
}

/* --- COLORES ESPECÍFICOS (Semáforo) --- */

/* 🟢 Optimista */
.scenario-card.optimista {
    border-top-color: #10B981; /* Verde Esmeralda */
}
.scenario-card.optimista .card-icon-top {
    background-color: #10B981;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}
.scenario-card.optimista .scenario-tag {
    color: #10B981;
}

/* 🟡 Tendencial */
.scenario-card.tendencial {
    border-top-color: #F59E0B; /* Amarillo Ámbar */
}
.scenario-card.tendencial .card-icon-top {
    background-color: #F59E0B;
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}
.scenario-card.tendencial .scenario-tag {
    color: #F59E0B;
}

/* 🔴 Crítico */
.scenario-card.critico {
    border-top-color: #EF4444; /* Rojo Alerta */
}
.scenario-card.critico .card-icon-top {
    background-color: #EF4444;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}
.scenario-card.critico .scenario-tag {
    color: #EF4444;
}

/* Responsive */
@media (max-width: 900px) {
    .scenarios-grid {
        grid-template-columns: 1fr; /* 1 Columna en móvil */
    }
    .scenarios-section .contenedor {
        width: 90%;
    }
}

/* --- SECCIÓN FAQ --- */
.faq-section {
    padding: 6rem 0;
    background-color: #ffffff;
}

.faq-container {
    max-width: 800px; /* Ancho más estrecho para lectura cómoda */
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
}

/* Botón de la Pregunta */
.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #15233A;
}

.faq-icon {
    font-size: 1.5rem;
    color: #187495;
    font-weight: 400;
    transition: transform 0.3s ease;
}

/* Respuesta (Oculta por defecto) */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #F8FAFC; /* Fondo interno gris muy suave */
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
    font-size: 1rem;
    color: #5B5A63;
    line-height: 1.6;
}

/* --- ESTADO ACTIVO (Abierto) --- */
.faq-item.active {
    border-color: #187495; /* Borde azul al estar abierto */
}

.faq-item.active .faq-icon {
    transform: rotate(45deg); /* El + se convierte en x */
}

.faq-item.active .faq-answer {
    max-height: 200px; /* Altura suficiente para el texto */
}

/* --- SECCIÓN FORMULARIO --- */
.analysis-form-section {
    padding: 6rem 0;
    background-color: #15233A; /* Fondo Azul Oscuro */
    color: #ffffff;
}

.analysis-form-section .contenedor {
    width: 85%; /* Un poco más ancho para el formulario */
    max-width: 1200px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr; /* Texto izq | Form der */
    gap: 4rem;
    align-items: flex-start;
}

/* Texto Izquierda */
.form-text-col h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: #ffffff;
}

.form-text-col p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.contact-info-block .info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #BAE6FD; /* Azul claro para datos */
}

/* Wrapper del Formulario */
.form-wrapper-col {
    background-color: #ffffff;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.analysis-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Filas y Grupos */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group.full-width {
    grid-column: span 2; /* Ocupa todo el ancho */
}

/* Labels e Inputs */
.input-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #15233A;
}

.input-group input,
.input-group select,
.input-group textarea {
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: #334155;
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #187495;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(24, 116, 149, 0.1);
}

/* Botón de Envío */
.btn-submit {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #15233A;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: #0f1a2d;
}

/* Responsive Formulario */
@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr; /* Columna única */
        gap: 3rem;
    }
    
    .form-wrapper-col {
        padding: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr; /* Inputs uno debajo de otro */
    }
    
    .input-group.full-width {
        grid-column: span 1;
    }
}

/* --- SECCIÓN ENFOQUE HUMANO (Actualizado) --- */
.ar-human-section {
    background-color: #ffffff;
    /* Ajuste de Padding: Menos arriba (2rem), normal abajo (6rem) */
    padding: 2rem 0 6rem 0; 
    text-align: center;
    overflow: hidden;
}

.ar-human-content {
    max-width: 950px; /* Un poco más ancho para que quepa bien */
    margin: 0 auto;
}

.typewriter-text {
    font-size: 2.2rem;
    color: #15233A;
    font-weight: 700;
    line-height: 1.4;
    min-height: 3.5em;
}

/* Clase para las palabras azules */
.texto-resaltado {
    color: #187495; /* Azul Cian corporativo */
    font-weight: 800; /* Un poco más gordita la letra */
}

/* Cursor parpadeante */
.cursor {
    display: inline-block;
    width: 3px;
    height: 1em; /* Altura ajustada a la letra */
    background-color: #187495;
    margin-left: 5px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Móvil */
@media (max-width: 768px) {
    .typewriter-text {
        font-size: 1.4rem;
    }
    .ar-human-section {
        padding: 2rem 0 4rem 0;
    }
}

/* =========================================
   CORRECCIÓN HERO ANÁLISIS 
   (Alineación Izquierda + Fuentes Ajustadas)
   ========================================= */

/* AJUSTES TABLET (< 1024px) */
@media (max-width: 1024px) {

    /* 1. LAYOUT: Usar todo el ancho disponible */
    /* Quitamos la división de 2 columnas para que el texto respire */
    .analysis-hero-grid {
        display: block !important; 
        width: 100% !important;
    }

    .analysis-hero {
        height: auto !important;
        min-height: 400px !important;
        padding: 6rem 0 !important;
    }

    /* 2. ANCHOS Y ALINEACIÓN (Izquierda Estricta) */
    .analysis-hero .contenedor {
        width: 80% !important; /* Tablet: Usamos el 80% de la pantalla */
        margin-left: auto !important; 
        margin-right: auto !important;
    }

    .analysis-text-col {
        text-align: left !important; /* SIEMPRE IZQUIERDA */
        max-width: 100% !important;
        margin: 0 !important; /* Quitamos auto margins que centran */
    }

    /* 3. FUENTES (Reducción de tamaño) */
    .analysis-text-col h1 {
        font-size: 2.2rem !important; /* Título mediano */
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }

    .analysis-text-col p {
        font-size: 1rem !important; /* Subtítulo fino y legible */
        line-height: 1.5 !important;
        font-weight: 300 !important;
        color: #cbd5e1 !important;
        padding-right: 0 !important;
    }
}

/* AJUSTES MÓVIL (< 600px) */
@media (max-width: 600px) {
    /* En celular aprovechamos más espacio lateral (90%) */
    .analysis-hero .contenedor {
        width: 90% !important; 
    }

    /* Título compacto */
    .analysis-text-col h1 {
        font-size: 1.8rem !important;
    }
}

/* =========================================
   HERO ANÁLISIS (VERSIÓN COMPACTA)
   ========================================= */

.analysis-hero {
    position: relative;
    height: 50vh;        /* ANTES: 60vh -> AHORA: 50vh (Más bajito) */
    min-height: 400px;   /* ANTES: 500px -> AHORA: 400px */
    width: 100%;
    display: flex;
    align-items: center; 
    overflow: hidden;
    background-color: #15233A;
}

/* Video de Fondo */
.analysis-video-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;   
    z-index: 0;
}

/* Capa Oscura */
.analysis-hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, rgba(21,35,58,0.9) 0%, rgba(21,35,58,0.7) 60%, rgba(21,35,58,0.4) 100%);
    z-index: 1;
}

/* Wrapper del contenido */
.analysis-content-wrapper {
    position: relative;
    z-index: 2;
    width: 90%;          
    max-width: 1400px;   
    margin: 0 auto;      
}

/* Columna de Texto */
.analysis-text-col {
    max-width: 700px;    
    text-align: left;    
    color: #ffffff;
}

.analysis-text-col h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.2rem; /* Un pelín más pequeño para que encaje mejor */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.analysis-text-col p {
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
    color: #e2e8f0;
    margin-bottom: 2rem;
}

/* Botón */
.btn-analysis-cta {
    display: inline-block;
    background-color: #187495;
    color: #ffffff;
    padding: 0.9rem 2.2rem; /* Botón un poco más compacto */
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-analysis-cta:hover {
    background-color: #ffffff;
    color: #15233A;
    transform: translateY(-3px);
}

/* =========================================
   RESPONSIVE (TABLET Y MÓVIL - COMPACTO)
   ========================================= */

/* Tablet (< 1024px) */
@media (max-width: 1024px) {
    .analysis-hero {
        height: 40vh;      /* ANTES: 50vh -> AHORA: 40vh */
        min-height: 350px; /* ANTES: 450px -> AHORA: 350px */
    }

    .analysis-text-col h1 {
        font-size: 2.5rem; 
    }
}

/* Móvil (< 600px) */
@media (max-width: 600px) {
    .analysis-hero {
        height: auto;       
        min-height: 300px;  /* ANTES: 400px -> AHORA: 300px */
        padding: 3rem 0;    /* Menos padding vertical para reducir altura */
    }

    .analysis-content-wrapper {
        width: 90%;
    }

    .analysis-text-col {
        width: 100%;       
    }

    .analysis-text-col h1 {
        font-size: 1.8rem;   /* Título ajustado */
        line-height: 1.2;
    }

    .analysis-text-col p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-analysis-cta {
        width: 100%;       
        text-align: center;
    }
}

/* --- VIDEO EN COLUMNA (INGENIERÍA) --- */

.engineering-img-col .img-frame {
    position: relative;
    width: 100%;
    
    /* CAMBIO CLAVE: Forzamos formato horizontal (16:9) */
    aspect-ratio: 16 / 9; 
    height: auto;      /* Dejamos que la altura se calcule sola */
    min-height: auto;  /* Quitamos restricciones de altura mínima */

    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.engineering-video {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
}

/* En escritorio, si quieres que sea un poco más grande, podemos poner un límite */
@media (min-width: 900px) {
    .engineering-img-col .img-frame {
        /* Opcional: Si en escritorio lo sientes muy chico, 
           aquí sí podrías definir una altura, pero manteniendo el aspect-ratio */
        width: 100%;
    }
}