/* =====================================================
   DESIGN TOKENS — Sistema de diseño unificado
===================================================== */
:root {
    --bg-base:        #f8fafc;
    --bg-alt:         #f1f5f9;
    --surface:        #ffffff;
    --border:         #e2e8f0;
    --border-strong:  #cbd5e1;
    --text-heading:   #0f172a;
    --text-body:      #475569;
    --text-muted:     #94a3b8;
    --brand-blue:     #2563eb;
    --brand-blue-lt:  #eff6ff;
    --brand-purple:   #7c3aed;
    --brand-purple-lt:#f5f3ff;
    --brand-green:    #059669;
    --brand-sky:      #0ea5e9;
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      20px;
    --radius-xl:      28px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.10);
    --shadow-xl:      0 20px 60px rgba(0,0,0,0.12);
}

/* =====================================================
   BASE
===================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    background-color: var(--bg-base);
    color: var(--text-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Optimización Móvil Global iOS (Safari) y Android (Chrome) */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}
body {
    overflow-x: hidden;
    width: 100%;
    touch-action: manipulation;
}
#mobile-menu {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* =====================================================
   SCROLLBAR
===================================================== */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* =====================================================
   TYPOGRAPHY
===================================================== */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* =====================================================
   NEW: GLASSMORPHISM CLASSES
===================================================== */
.glass-card-light {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.glass-card-dark {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.glass-card-dark:hover {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.15);
}

/* =====================================================
   NAVBAR & CTA
===================================================== */
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(203,213,225,0.85);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 7px 14px;
    border-radius: 8px;
    transition: color 0.22s, background 0.22s;
    white-space: nowrap;
    text-decoration: none;
}
.nav-link i {
    font-size: 0.78rem;
    opacity: 0.75;
    transition: opacity 0.22s;
}
.nav-link:hover, .nav-link.active {
    color: #e0f2fe;
    background: rgba(56,189,248,0.10);
}
.nav-link:hover i, .nav-link.active i {
    opacity: 1;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.22s, transform 0.22s;
}
.nav-link:hover::after, .nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}
.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 9px 20px;
    border-radius: 10px;
    border: 1px solid rgba(52,211,153,0.5);
    box-shadow: 0 0 18px rgba(16,185,129,0.25);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.nav-cta:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 0 28px rgba(16,185,129,0.45);
    transform: translateY(-1px);
}
.nav-separator {
    width: 1px;
    height: 18px;
    background: rgba(148,163,184,0.2);
    flex-shrink: 0;
}

/* =====================================================
   UTILITIES & ANIMATIONS
===================================================== */
.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px;
}
.section-header {
    text-align: center;
    margin-bottom: 60px;
}
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-blue);
    background: var(--brand-blue-lt);
    padding: 6px 16px;
    border-radius: 99px;
    margin-bottom: 16px;
}
.fade-in-up { transform: translateY(24px); }
.animated.visible { opacity: 1; transform: translateY(0); }
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.hover\:pause-animation:hover { animation-play-state: paused; }

#particles-js {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
    background-color: #080f28;
}

#inicio {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* =====================================================
   CHATBOT WIDGET
===================================================== */
#chatbot-toggle {
    position: fixed;
    bottom: 25px; right: 25px;
    width: 58px; height: 58px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37,99,235,0.35);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 1000;
}
#chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(37,99,235,0.45);
}

#chat-widget {
    position: fixed;
    bottom: 96px; right: 25px;
    width: 350px; max-width: 90vw;
    height: 500px; max-height: 70vh;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    display: flex; flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 999;
    pointer-events: none;
    border: 1px solid var(--border);
}

#chat-widget.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chat-header {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    color: #fff;
    padding: 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.chat-body {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex; flex-direction: column;
    gap: 10px;
    background: var(--bg-base);
}

.chat-message {
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 80%;
    font-size: 0.85rem;
    line-height: 1.5;
}

.chat-message.user {
    background: var(--brand-blue-lt);
    color: #1e3a8a;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    background: var(--surface);
    color: var(--text-heading);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.chat-footer {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--border);
    gap: 8px;
    background: var(--surface);
}

#chat-input {
    flex-grow: 1;
    border: 1px solid var(--border-strong);
    border-radius: 99px;
    padding: 8px 16px;
    font-size: 0.85rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}
#chat-input:focus { border-color: var(--brand-blue); }

#chat-send {
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px; height: 38px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
#chat-send:hover { background: #1d4ed8; }

#main-modal { z-index: 99999 !important; }

@keyframes scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll { animation: scroll 40s linear infinite; }
