:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg-main: #f9f9fb; 
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --sky-blue: #60a5fa; 
}

[lang="ar"] { font-family: 'Noto Sans Arabic', sans-serif; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- FOND ANIMÉ GLOBLAL (BLOBS) - OPTIMISÉ GPU --- */
.bg-blobs {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    overflow: hidden; z-index: 0; pointer-events: none;
}
.blob {
    position: absolute; filter: blur(90px); opacity: 0.6;
    border-radius: 50%; animation: float 20s infinite ease-in-out alternate;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}
.blob-1 { width: 40vw; height: 40vw; background: rgba(37, 99, 235, 0.3); top: -10%; left: -10%; animation-delay: 0s; }
.blob-2 { width: 50vw; height: 50vw; background: rgba(96, 165, 250, 0.25); bottom: -20%; right: -10%; animation-delay: -5s; }
.blob-3 { width: 30vw; height: 30vw; background: rgba(167, 139, 250, 0.3); top: 30%; left: 50%; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
    50% { transform: translate3d(3vw, 5vh, 0) scale(1.05) rotate(5deg); }
    100% { transform: translate3d(-2vw, 8vh, 0) scale(1.1) rotate(-5deg); }
}

/* --- NUAGES ANIMÉS EN FOND DE HERO - OPTIMISÉS GPU --- */
.clouds-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 15; overflow: hidden; pointer-events: none;
}
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    filter: blur(40px);
    border-radius: 50%;
    animation: drift linear infinite;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}
.cloud-1 { width: 45vw; height: 20vh; top: 10%; left: -50vw; animation-duration: 45s; animation-delay: -10s; }
.cloud-2 { width: 35vw; height: 15vh; top: 45%; left: -40vw; animation-duration: 35s; animation-delay: -25s; background: rgba(255, 255, 255, 0.5); }
.cloud-3 { width: 60vw; height: 25vh; top: 65%; left: -60vw; animation-duration: 60s; animation-delay: -5s; background: rgba(255, 255, 255, 0.6); }
.cloud-4 { width: 40vw; height: 18vh; top: 25%; left: -45vw; animation-duration: 50s; animation-delay: -40s; background: rgba(255, 255, 255, 0.4); }

@keyframes drift {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(160vw, 0, 0); }
}

/* --- LOGIQUE DE SCROLL & POSITIONNEMENT --- */
#hero-spline {
    pointer-events: none !important;
    user-select: none !important;
}

#scroll-progress {
    position: fixed; top: 0; left: 0; width: 0%; height: 4px;
    background: var(--primary); z-index: 1001;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, var(--primary) 0%, var(--sky-blue) 60%, var(--bg-main) 100%);
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
}
.preloader-active { transform: translateY(-100%); pointer-events: none; }

.loader-logo-base {
    font-family: 'Outfit', sans-serif; 
    font-size: clamp(2.5rem, 12vw, 5rem); 
    font-weight: 900; color: rgba(255, 255, 255, 0.2); 
    font-style: italic; letter-spacing: -0.02em;
    position: relative; text-transform: uppercase;
}
.loader-logo-fill {
    position: absolute; top: 0; left: 0; color: #ffffff; 
    width: 0%; overflow: hidden; white-space: nowrap; 
    transition: width 0.3s ease-out;
}

/* --- NAV --- */
.glass-nav {
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05); transition: all 0.4s ease;
}

/* --- BUTTONS --- */
.btn-premium {
    padding: 1.2rem 2.8rem; border-radius: 100px; font-weight: 900; text-transform: uppercase; font-size: 11px;
    letter-spacing: 0.15em; transition: all 0.4s ease; display: inline-flex; align-items: center; gap: 0.8rem;
}
.btn-primary { background: #0f172a; color: white; }
.btn-primary:hover { background: var(--primary); transform: scale(1.05); }
.btn-secondary { background: white; color: #0f172a; border: 2px solid rgba(0,0,0,0.1); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.05); }

/* --- BENTO --- */
.bento-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.5rem; }
@media (min-width: 768px) { .bento-grid { grid-template-columns: repeat(6, 1fr); } }
.bento-item {
    background: var(--bg-card); border-radius: 40px; padding: 3rem; border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.5s ease; position: relative; overflow: hidden; cursor: pointer;
}

/* Dynamic Island Navigation */
#navbar {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top center;
}
#navbar.dynamic-island {
    max-width: 850px !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 40px -15px rgba(37, 99, 235, 0.15), inset 0 0 0 1px rgba(255,255,255,0.4);
    transform: translateY(-15px);
}

.bento-item:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 20px 40px rgba(0,0,0,0.05); }
.bento-blue { background: linear-gradient(135deg, #0f172a) !important; color: white; border: none; }

.tag {
    display: inline-block; padding: 0.4rem 1rem; background: rgba(37, 99, 235, 0.1);
    border-radius: 100px; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 1.5rem; color: var(--primary);
}

/* --- MARQUEE --- */
.marquee-wrapper { position: relative; overflow: hidden; padding: 3rem 0; white-space: nowrap; }
.marquee-content { display: flex; gap: 4rem; animation: marquee 30s linear infinite; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* --- METHOD DESIGN --- */
.method-card { background: white; border-radius: 40px; padding: 3rem; position: relative; z-index: 10; border: 1px solid rgba(0,0,0,0.04); transition: all 0.4s ease; }
.method-card:hover { transform: translateY(-10px); border-color: var(--primary); }
.giant-num { position: absolute; bottom: -2rem; right: -1rem; font-size: 14rem; font-weight: 900; line-height: 1; color: transparent; -webkit-text-stroke: 2px rgba(37, 99, 235, 0.05); z-index: 0; pointer-events: none; }
.phase-badge { background: #0f172a; color: white; font-size: 10px; font-weight: 900; text-transform: uppercase; padding: 0.4rem 1rem; border-radius: 100px; margin-bottom: 1.5rem; display: inline-block; }

/* --- FORM STYLES AMÉLIORÉS --- */
.form-step { display: none; }
.form-step.active { display: block; animation: slideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

.form-input-modern {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}
.form-input-modern:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--sky-blue);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15), inset 0 2px 10px rgba(0,0,0,0.1);
}
.form-input-modern::placeholder { color: rgba(255, 255, 255, 0.3); }

.service-pill { padding: 1rem 2rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 100px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-weight: 600; color: white; display: inline-flex; align-items: center; gap: 0.5rem; }
.service-pill:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }
.service-pill.selected { background: var(--primary); border-color: var(--primary); box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4); transform: translateY(-2px); }

/* --- MODAL SERVICE --- */
#service-modal {
    position: fixed; inset: 0; z-index: 5000;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(25px);
    display: none; align-items: center; justify-content: center; padding: 1.5rem;
    opacity: 0; transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#service-modal.active { display: flex; opacity: 1; }
.modal-content {
    background: white; width: 100%; max-width: 850px; max-height: 85vh;
    border-radius: 50px; overflow-y: auto; padding: 4rem; position: relative;
    transform: scale(0.9) translateY(30px); transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.2);
}
#service-modal.active .modal-content { transform: scale(1) translateY(0); }

/* --- AI CHAT TERMINAL --- */
#ai-chat-modal { 
    position: fixed; bottom: 8rem; right: 2rem; width: 380px; max-width: calc(100vw - 2rem); 
    background: rgba(255, 255, 255, 0.65); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-radius: 32px; z-index: 7000; display: none; flex-direction: column; overflow: hidden; 
    border: 1px solid rgba(255, 255, 255, 0.8); 
    box-shadow: 0 40px 100px -20px rgba(37, 99, 235, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transform: translateY(20px) scale(0.95); opacity: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#ai-chat-modal.active { display: flex; transform: translateY(0) scale(1); opacity: 1; }
.chat-messages { height: 400px; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; background: transparent; }
.msg { padding: 0.9rem 1.2rem; border-radius: 20px; font-size: 13.5px; line-height: 1.5; max-width: 85%; font-weight: 500; }
.msg-user { align-self: flex-end; background: linear-gradient(135deg, #2563eb, #0ea5e9); color: white; border-bottom-right-radius: 6px; box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.3), inset 0 1px 1px rgba(255,255,255,0.2); }
.msg-ai { align-self: flex-start; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.5); color: #0f172a; border-bottom-left-radius: 6px; box-shadow: 0 5px 15px rgba(0,0,0,0.03); }

@keyframes fluid-line {
    0% { transform: translateX(-200%); }
    100% { transform: translateX(400%); }
}
.animate-fluid-line { animation: fluid-line 3s linear infinite; }

.reveal-up { opacity: 0; transform: translateY(40px); transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal-up.active { opacity: 1; transform: translateY(0); }

#mobile-menu-overlay { position: fixed; inset: 0; background: white; z-index: 2000; display: none; flex-direction: column; justify-content: center; align-items: center; gap: 2.5rem; }
#mobile-menu-overlay.active { display: flex; }

/* --- FAQ --- */
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.faq-answer-inner { overflow: hidden; }
.faq-item.active .faq-answer { grid-template-rows: 1fr; }

.faq-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.02);
}
.faq-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.08);
    transform: translateY(-4px);
}
.faq-card.active {
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 30px 60px -15px rgba(37, 99, 235, 0.15);
}
.faq-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: #f1f5f9; color: #0f172a;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-card:hover .faq-icon {
    background: var(--primary); color: white;
    transform: scale(1.05);
}
.faq-card.active .faq-icon {
    background: var(--primary); color: white;
    transform: rotate(135deg) scale(1.1);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}
