/* --- VARIABLES DE MARCA --- */
:root {
    /* Paleta Principal extraída de palette_ami.pdf */
    --bg-light: #EFF0F1;
    --accent-blue: #5B86B0;
    --muted-gray: #AAB4BB;
    --deep-blue: #002E5D;
    --charcoal: #161D24;

    /* Colores de UI Chat y Componentes */
    --color-bg: #F8FAFC;
    --color-primary: #3B82F6;
    --color-accent: #0F172A;
    --white-shine: rgba(255, 255, 255, 0.6);
}

/* --- ESTILOS BASE --- */
body {
    background-color: var(--bg-light);
    color: var(--charcoal);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
    margin: 0;
}

/* --- SPLASH SCREEN (Estructura Corregida para Expansión Directa) --- */
#splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--charcoal);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow: hidden;
    /* Importante para el ripple inicial */
    transition: opacity 0.8s ease, visibility 0.8s;
}

/* Círculo de fondo inicial */
.ripple-circle {
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--deep-blue);
    border-radius: 50%;
    transform: scale(0);
    animation: dropAndExpand 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 10001;
}

/* 1. CONTENEDOR PRINCIPAL: Maneja la entrada y la posición */
.logo-wrapper {
    position: relative;
    z-index: 10002;
    opacity: 0;
    transform: scale(0.6) translateY(30px);
    /* Entrada suave */
    animation: logoReveal 1.2s 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    text-align: center;
}

/* 3. LA IMAGEN: Maneja el Zoom masivo */
.zoom-logo {
    max-width: 280px;
    height: auto;
    display: block;
    image-rendering: auto;
    /* Mantiene nitidez en renderizado normal */

    /* Animación de impacto: t=3s */
    /* Usamos 'ease-in' para que la explosión se sienta más rápida al final */
    animation: flatZoomImpact 1.2s 3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Pseudo-elemento para el Barrido de Brillo (Shine) Corregido */
.logo-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            transparent 0%,
            var(--white-shine) 50%,
            transparent 100%);
    transform: skewX(-25deg);
    /* El brillo dura 0.8s y termina mucho antes del impacto */
    animation: shineSweep 0.5s ease-in-out forwards;
    pointer-events: none;
}

.fade-out-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 2. MÁSCARA DE BRILLO: Mover overflow: hidden aquí */
.shine-mask {
    position: relative;
    display: inline-block;
    /* Se ajusta al tamaño de la imagen */
    overflow: hidden;
    /* Corta el brillo */
    border-radius: 8px;
    /* Opcional */

    /* ANIMACIÓN CRUCIAL: Desactivar la máscara antes del zoom */
    /* En t=2.9s (justo antes de t=3s), hacemos overflow visible */
    animation: disableMask 0.1s 2.9s forwards;
}

/* Pseudo-elemento para el Barrido de Brillo (Shine) */
/* Ahora aplicado a .shine-mask */
.shine-mask::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            transparent 0%,
            var(--white-shine) 50%,
            transparent 100%);
    transform: skewX(-25deg);
    /* Brillo en t=1.8s, dura 0.8s. Termina en t=2.6s */
    animation: shineSweep 0.8s 1.8s ease-in-out forwards;
    pointer-events: none;
}

/* --- ANIMACIONES DEL SPLASH --- */
/* --- ANIMACIONES DEL SPLASH --- */

@keyframes dropAndExpand {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }

    40% {
        transform: scale(25);
        opacity: 1;
    }

    100% {
        transform: scale(150);
        opacity: 0;
    }
}

@keyframes logoReveal {
    0% {
        opacity: 0;
        transform: scale(0.6) translateY(30px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shineSweep {
    0% {
        left: -150%;
        opacity: 1;
    }

    100% {
        left: 150%;
        opacity: 0;
    }

    /* Desaparece al final */
}

/* NUEVA ANIMACIÓN: Desactivar la máscara */
@keyframes disableMask {
    to {
        overflow: visible;
    }
}

/* ANIMACIÓN DE IMPACTO CORREGIDA (Suave y expansiva) */
@keyframes flatZoomImpact {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1) blur(0px);
    }

    /* Destello inicial rápido al estrellarse */
    10% {
        filter: brightness(1.8) blur(0px);
        opacity: 1;
    }

    /* Expansión masiva y desvanecimiento */
    100% {
        /* Un valor más manejable, pero suficiente para cubrir la pantalla */
        transform: scale(120);
        opacity: 0;
        /* Un ligero desenfoque ayuda a simular la velocidad y oculta pixelado */
        filter: brightness(2) blur(10px);
    }
}

/* --- CHAT PROFESIONAL --- */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2001;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform: translateY(120%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.open {
    transform: translateY(0);
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
    position: relative;
}

.msg-bot {
    background: #F1F5F9;
    color: #1E293B;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.msg-user {
    background: var(--color-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Indicador de escritura (typing) */
.dot {
    height: 6px;
    width: 6px;
    background: #94A3B8;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.15s;
}

.dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}

/* --- COMPONENTES DEL SITIO --- */
.hero-gradient {
    background: linear-gradient(135deg, var(--bg-light) 0%, #DDE1E3 100%);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--deep-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 46, 93, 0.2);
}

.nav-link {
    position: relative;
    color: var(--deep-blue);
    text-decoration: none;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Tarjetas de Servicios */
.service-card {
    background: white;
    border-bottom: 4px solid transparent;
    transition: all 0.8s cubic-bezier(0.2, 0.9, 0.5, 5.275);
}

.service-card:hover {
    transform: translateY(-10px);
    border-bottom: 4px solid var(--accent-blue);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

/* Efectos de Revelado (Scroll) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Campos de Formulario */
.input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--muted-gray);
    color: var(--charcoal);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Mapa */
.map-container {
    filter: grayscale(1) invert(0.9) contrast(1.2);
    transition: all 0.5s ease;
}

.map-container:hover {
    filter: grayscale(0) invert(0) contrast(1);
}

.reveal-delayed {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.show {
    opacity: 1 !important;
}

.boton-bonito {
    background-color: #4A90E2;
    /* Color principal */
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    /* Bordes redondeados */
    font-family: sans-serif;
    font-weight: bold;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.boton-bonito:hover {
    background-color: #357ABD;
    /* Color más oscuro al pasar el mouse */
}