/* Inter & Roboto via Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* REM Logo Colors */
    --rem-dark-blue: #004581; /* Dark blue from text 'rem' */
    --rem-light-blue: #007bb5; /* Light blue from the symbol */
    --rem-orange: #f28c00; /* Orange/Yellow from the drops */

    /* Custom Variables */
    --primary: var(--rem-dark-blue);
    --primary-light: #005b87; /* Darker light-blue */
    --secondary: #005b87;
    --accent: var(--rem-orange);
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #475569;
    --white: #ffffff;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Bootstrap 5 Overrides */
    --bs-primary: var(--rem-dark-blue);
    --bs-primary-rgb: 0, 69, 129;
    --bs-secondary: #005b87;
    --bs-secondary-rgb: 0, 91, 135;
    --bs-warning: var(--rem-orange);
    --bs-warning-rgb: 242, 140, 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
}

p {
    line-height: 1.7;
    color: var(--gray);
}

/* Base Section Adjustments */
section {
    padding: 5rem 0;
}

#inicio {
    padding: 0;
}

/* Alternate Backgrounds */
#servicios, #proceso, #faq, #contacto {
    background-color: var(--light) !important;
}

/* Navbar */
.navbar {
    transition: var(--transition);
    padding: 1.5rem 0;
    background: transparent;
}

.navbar.scrolled {
    background: var(--white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--white) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.navbar .navbar-logo {
    filter: brightness(0) invert(1); /* Hace que el logo sea completamente blanco sobre el fondo oscuro */
    transition: filter 0.3s;
}

.navbar.scrolled .navbar-brand {
    color: var(--primary) !important;
    text-shadow: none;
}

.navbar.scrolled .navbar-logo {
    filter: none; /* Restaura los colores originales del logo al hacer scroll */
}

.nav-link {
    font-weight: 600;
    color: var(--white) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 0 1rem;
    position: relative;
    transition: var(--transition);
}

.navbar.scrolled .nav-link {
    color: var(--gray) !important;
    text-shadow: none;
}

.nav-link:hover, .nav-link.active, .navbar.scrolled .nav-link:hover, .navbar.scrolled .nav-link.active {
    color: var(--primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent); /* Subrayado naranja sobre fondo azul */
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)), url('../img/hero_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    padding-top: 100px; /* Previene superposiciones con la navbar fija */
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Glassmorphism Cards */
.service-card {
    border: none;
    border-radius: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    background: var(--white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(0, 123, 181, 0.25);
}

.icon-square {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 123, 181, 0.1);
    color: var(--primary-light);
    border-radius: 12px;
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.service-card:hover .icon-square {
    transform: translateY(-3px);
}

.service-panel {
    transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    border: 1px solid rgba(0, 0, 0, 0.125) !important;
    border-radius: 12px;
}

.service-panel:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 10px 30px -10px rgba(242, 140, 0, 0.3) !important;
    transform: translateY(-5px);
    background-color: var(--white) !important;
}

.service-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.service-card-body {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-card-body h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.service-card-body p {
    text-align: justify;
    hyphens: auto;
}

.service-card-body .btn {
    margin-top: auto;
    align-self: flex-start;
    transition: var(--transition);
}

.service-card-body .btn:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

/* Client Interactive Hover Card */
.client-accordion:hover {
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1) !important;
    transform: translateY(-5px);
    z-index: 5;
    border-color: var(--primary-light) !important;
}
.client-accordion:hover .client-title {
    opacity: 0;
    transform: translateY(-10px);
}
.client-accordion:hover .client-hover-content {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.social-link {
    transition: var(--transition);
}

.social-link:hover .fa-linkedin { color: #0a66c2; scale: 1.1; }
.social-link:hover .fa-facebook { color: #1877f2; scale: 1.1; }
.social-link:hover .fa-instagram { color: #e1306c; scale: 1.1; }

.bg-accent { background-color: var(--accent) !important; }
.text-accent { color: var(--accent) !important; }

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--white) !important;
    font-weight: 700;
}
.btn-accent:hover {
    background-color: #d87d00;
    border-color: #c97500;
    color: var(--white);
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(242, 140, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(242, 140, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(242, 140, 0, 0); }
}

.hero .btn-accent {
    animation: pulseGlow 2.5s infinite;
}

.hero .btn {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero .btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 25px rgba(0,0,0,0.4) !important;
}

.cursor {
    font-weight: 300;
    color: var(--accent);
}

.cursor.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Beneficios */
.benefit-item {
    transition: var(--transition);
    padding: 1rem;
    border-radius: 12px;
}

/* Contacto - Evitar overflow en texto largo (email) */
.contact-email {
    word-break: break-all;
    font-size: clamp(0.9rem, 4vw, 1.25rem);
}

.benefit-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(10px);
}

/* WhatsApp FAB */
.whatsapp-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    color: white;
}

/* Responsive */
@media (max-width: 991px) {
    /* Forzar que la navbar siempre quede en la pantalla (sticky) si hay algún problema de compatibilidad con transform/overflow */
    .navbar {
        position: fixed !important;
        top: 0;
        width: 100%;
        z-index: 1030;
    }

    /* Fondo sólido para el menú desplegable en celulares */
    .navbar-collapse {
        background: rgba(10, 37, 64, 0.98);
        padding: 1rem;
        border-radius: 12px;
        margin-top: 0.5rem;
        box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    }
    
    .navbar.scrolled .navbar-collapse {
        background: var(--white);
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }
    
    /* El ícono de hamburguesa viene blanco por el data-bs-theme="dark".
       Si scrolleamos y el fondo se hizo blanco, el ícono desaparecería. Lo invertimos a oscuro. */
    .navbar.scrolled .navbar-toggler-icon {
        filter: invert(1);
    }
    
    .navbar-toggler {
        border: none;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    #contacto .bg-dark {
        padding: 2.5rem 1.5rem !important;
    }
}
