/* --- VARIABLES Y ESTILOS GENERALES --- */
:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-glow: rgba(245, 158, 11, 0.35);
    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo {
    font-family: var(--font-heading);
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- ANIMACIONES DE DESPLAZAMIENTO (SCROLL REVEAL) --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* Retardo escalonado para tarjetas */
.services-grid .service-card:nth-child(1) { transition-delay: 0.1s; }
.services-grid .service-card:nth-child(2) { transition-delay: 0.2s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.3s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.4s; }

/* --- ENCABEZADO Y NAVEGACIÓN --- */
header {
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
}

header.scrolled {
    background-color: rgba(15, 23, 42, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    transition: var(--transition-smooth);
}

header.scrolled .nav-container {
    padding: 0.8rem 2rem;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
    animation: pulseGlow 3s infinite ease-in-out;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.2rem;
}

.nav-link {
    font-weight: 500;
    position: relative;
    padding: 0.4rem 0;
    color: #cbd5e1;
    transition: var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.nav-link:hover, .nav-link.active {
    color: var(--white);
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    color: var(--accent);
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.82)),
        url('https://images.unsplash.com/photo-1621905251189-08b45d6a269e?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
    color: var(--white);
    padding: 8rem 2rem 7rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(245, 158, 11, 0) 70%);
    pointer-events: none;
    animation: floatGlow 6s ease-in-out infinite alternate;
}

.hero-content {
    max-width: 850px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--accent);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
    animation: fadeInDown 1s ease forwards;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: #94a3b8;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* BOTONES CON EFECTO SUAVE */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--primary);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.45);
}

.btn-primary i {
    transition: transform 0.3s ease;
}

.btn-primary:hover i {
    transform: translateX(4px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

/* SCROLL DOWN INDICATOR */
.scroll-down {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
    animation: bounce 2s infinite;
    transition: color 0.3s ease;
    z-index: 2;
}

.scroll-down:hover {
    color: var(--accent);
}

/* --- SECCIONES COMUNES --- */
section {
    padding: 5.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    color: var(--primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    margin: 0.7rem auto 0;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.section-title:hover::after {
    width: 100px;
}

/* --- NOSOTROS --- */
.about-card {
    background: var(--white);
    padding: 3.5rem 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
    text-align: center;
}

.about-text {
    max-width: 800px;
    margin: 0 auto 3rem;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    transition: var(--transition-smooth);
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-heading);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- SERVICIOS --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    opacity: 0.8;
    transition: height 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
}

.service-card:hover::before {
    height: 6px;
}

.service-icon {
    width: 55px;
    height: 55px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.service-card:hover .service-icon {
    background: var(--accent);
    color: var(--primary);
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.service-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--primary);
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

/* --- CONTACTO --- */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3.5rem;
    background-color: var(--white);
    padding: 3.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.8rem;
    color: var(--primary);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-fast);
}

.info-item:hover {
    transform: translateX(5px);
}

.info-item i {
    width: 42px;
    height: 42px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.info-item:hover i {
    background-color: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

.info-item strong {
    display: block;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.info-item p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--primary);
}

.form-group input,
.form-group textarea {
    padding: 0.9rem 1.1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.98rem;
    background-color: #f8fafc;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background-color: var(--white);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

/* --- TOAST NOTIFICATION --- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: var(--white);
    padding: 1.2rem 1.6rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    border-left: 5px solid var(--accent);
    transform: translateY(120px);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-icon {
    font-size: 1.6rem;
    color: var(--accent);
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: 700;
    font-size: 1rem;
    font-family: var(--font-heading);
}

.toast-message {
    font-size: 0.88rem;
    color: #94a3b8;
}

/* --- PIE DE PÁGINA --- */
footer {
    background-color: var(--primary);
    color: #94a3b8;
    text-align: center;
    padding: 2.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

/* --- KEYFRAMES --- */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 4px var(--accent-glow)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 12px var(--accent)); transform: scale(1.05); }
}

@keyframes floatGlow {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
    100% { transform: translate(-50%, -45%) scale(1.1); opacity: 0.9; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVO --- */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(16px);
        padding: 1.5rem 2rem;
        text-align: center;
        gap: 1.2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition-smooth);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .menu-toggle {
        display: block;
    }

    .about-card {
        padding: 2rem 1.5rem;
    }

    .toast {
        right: 15px;
        left: 15px;
        bottom: 20px;
    }
}