/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0b0f19;
    --bg-card: #111827;
    --bg-lighter: #1a2035;
    --border: rgba(255, 255, 255, 0.08);
    --primary: #4f8fff;
    --primary-dark: #3b6fd9;
    --accent: #06d6a0;
    --purple: #8b5cf6;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #94a3b8;
    --light: #1a2035;
    --white: #ffffff;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #0b0f19;
}

/* Webkit scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0f19;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--purple));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--purple));
}

/* Light theme scrollbar */
[data-theme="light"] {
    scrollbar-color: var(--primary) #e8ecf4;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #e8ecf4;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--purple));
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--purple));
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn--primary {
    background: var(--primary);
    color: var(--white);
}

.btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 143, 255, 0.3);
}

.btn--outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn--outline:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.btn--dark {
    background: var(--dark);
    color: var(--white);
}

.btn--dark:hover {
    background: var(--dark-light);
    transform: translateY(-2px);
}

/* ===== SECTIONS ===== */
.section {
    padding: 80px 0;
}

.section--gray {
    background: var(--bg-card);
}

.section__header {
    text-align: center;
    margin-bottom: 56px;
}

.section__tag {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.section__title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    text-transform: uppercase;
    
}

.section__desc {
    color: var(--gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== CARDS GRID ===== */
.grid {
    display: grid;
    gap: 28px;
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 36px 32px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(79, 143, 255, 0.2);
}

.card__icon {
    width: 56px;
    height: 56px;
    background: var(--bg-lighter);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.card__text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== STATS ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    text-align: center;
    padding: 60px 0;
}

.stat__number {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
    cursor: default;
    display: inline-block;
}

.stat__label {
    color: var(--gray);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ===== PAGE HEADER (sous-pages) ===== */
.page-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 12px;
}

.page-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
    padding: 80px 0;
}

.cta-section h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 16px;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== HERO PARALLAX (shared) ===== */
[class*="hero-"],
.hero {
    --parallax-x: 0px;
    --parallax-y: 0px;
}

[class*="hero-"]::before,
.hero::before,
.hero::after {
    transition: transform 0.3s ease-out;
    transform: translate(var(--parallax-x), var(--parallax-y));
}

/* ===== HERO ENTRY STAGGER (shared) ===== */
.hero-animate-in [class*="__badge"],
.hero-animate-in h1,
.hero-animate-in > .container > p,
.hero-animate-in [class*="__actions"] {
    opacity: 0;
    animation: heroEntryIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-animate-in [class*="__badge"]   { animation-delay: 0.1s; }
.hero-animate-in h1                    { animation-delay: 0.25s; }
.hero-animate-in > .container > p      { animation-delay: 0.4s; }
.hero-animate-in [class*="__actions"]  { animation-delay: 0.55s; }

@keyframes heroEntryIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-animate-in [class*="__badge"],
    .hero-animate-in h1,
    .hero-animate-in > .container > p,
    .hero-animate-in [class*="__actions"] {
        animation: none;
        opacity: 1;
    }

    [class*="hero-"]::before,
    .hero::before,
    .hero::after {
        transition: none;
        transform: none;
    }

    .preloader__logo,
    .preloader__progress,
    .preloader__star,
    .preloader__particle,
    .preloader__glow,
    .icon-animate,
    .confetti {
        animation: none;
    }

    .hero h1 span,
    .hero-services h1 span,
    .hero-projets h1 span,
    .hero-contact h1 span,
    .hero-legal h1 span {
        animation: none;
    }

    .preloader__progress {
        width: 100%;
    }
}

/* ===== PRELOADER ===== */
body.preloader-active {
    overflow: hidden;
}

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #050816;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    overflow: hidden;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Stars */
.preloader__stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.preloader__star {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: #ffffff;
    border-radius: 50%;
    animation: starTwinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.6); }
}

/* Floating particles */
.preloader__particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.preloader__particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: var(--color);
    border-radius: 50%;
    opacity: 0.5;
    box-shadow: 0 0 10px var(--color), 0 0 24px var(--color);
    animation: preloaderParticleFloat var(--duration) ease-in-out infinite,
               particleGlow 2s ease-in-out infinite;
    animation-delay: var(--delay);
}

/* Alternating trajectories */
.preloader__particle:nth-child(odd) {
    animation-name: preloaderParticleFloat, particleGlow;
}

.preloader__particle:nth-child(even) {
    animation-name: preloaderParticleFloat2, particleGlow;
}

.preloader__particle:nth-child(3n) {
    animation-name: preloaderParticleFloat3, particleGlow;
}

@keyframes preloaderParticleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(30px, -40px) scale(1.6);
        opacity: 0.9;
    }
    50% {
        transform: translate(-20px, -70px) scale(0.7);
        opacity: 0.2;
    }
    75% {
        transform: translate(35px, -25px) scale(1.3);
        opacity: 0.75;
    }
}

@keyframes preloaderParticleFloat2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.25;
    }
    20% {
        transform: translate(-35px, -20px) scale(1.4);
        opacity: 0.85;
    }
    45% {
        transform: translate(25px, -60px) scale(0.6);
        opacity: 0.15;
    }
    70% {
        transform: translate(-15px, -80px) scale(1.5);
        opacity: 0.9;
    }
}

@keyframes preloaderParticleFloat3 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.35;
    }
    30% {
        transform: translate(40px, -50px) scale(1.8) rotate(120deg);
        opacity: 0.95;
    }
    60% {
        transform: translate(-30px, -30px) scale(0.5) rotate(240deg);
        opacity: 0.2;
    }
}

@keyframes particleGlow {
    0%, 100% {
        box-shadow: 0 0 8px var(--color), 0 0 16px var(--color);
    }
    50% {
        box-shadow: 0 0 16px var(--color), 0 0 40px var(--color), 0 0 60px var(--color);
    }
}

/* Center content */
.preloader__inner {
    text-align: center;
    position: relative;
    z-index: 2;
}

.preloader__logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.preloader__logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 2;
    animation: logoFloat 2.5s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.preloader__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 143, 255, 0.3) 0%, rgba(139, 92, 246, 0.15) 40%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 1;
    }
}

.preloader__text {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.preloader__dots-anim::after {
    content: '';
    animation: dotsAnim 1.5s steps(4, end) infinite;
}

@keyframes dotsAnim {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.preloader__bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader__progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--purple));
    background-size: 200% 100%;
    border-radius: 3px;
    animation: preloaderBar 1.5s ease-in-out forwards, shimmerBar 1s linear infinite;
}

@keyframes preloaderBar {
    0% { width: 0%; }
    40% { width: 55%; }
    70% { width: 80%; }
    100% { width: 100%; }
}

@keyframes shimmerBar {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.preloader__percent {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 12px;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 16px rgba(79, 143, 255, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(79, 143, 255, 0.45);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-right: 8px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: rgba(79, 143, 255, 0.3);
    background: rgba(79, 143, 255, 0.08);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --bg-dark: #f5f7fb;
    --bg-card: #ffffff;
    --bg-lighter: #f0f2f7;
    --border: rgba(0, 0, 0, 0.1);
    --text: #1a202c;
    --text-muted: #64748b;
    --dark: #e8ecf4;
    --dark-light: #dde3ee;
    --gray: #64748b;
    --light: #edf0f7;
    --white: #ffffff;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .header {
    background: linear-gradient(135deg, rgba(245, 247, 251, 0.97), rgba(255, 255, 255, 0.95), rgba(240, 242, 247, 0.97));
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .header__nav a {
    color: #475569;
}

[data-theme="light"] .header__nav a:hover,
[data-theme="light"] .header__nav a.active {
    color: var(--primary);
}

[data-theme="light"] .header__auth-btn--login {
    color: #475569;
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .header__auth-btn--login:hover {
    color: #1a202c;
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .header__menu {
    background: linear-gradient(180deg, rgba(245, 247, 251, 0.98), rgba(240, 242, 247, 0.98));
    border-bottom-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .header__nav a {
    color: #475569;
}

[data-theme="light"] .header__nav a:hover,
[data-theme="light"] .header__nav a.active {
    color: var(--primary);
    background: rgba(79, 143, 255, 0.08);
}

[data-theme="light"] .header__auth {
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .header__burger span {
    background: #1a202c;
}

[data-theme="light"] .footer {
    background: #e8ecf4;
    color: #475569;
}

[data-theme="light"] .footer__title {
    color: #1a202c;
}

[data-theme="light"] .footer__links a {
    color: #64748b;
}

[data-theme="light"] .footer__links a:hover {
    color: #1a202c;
}

[data-theme="light"] .footer__links li {
    color: #64748b;
}

[data-theme="light"] .footer__brand p {
    color: #64748b;
}

[data-theme="light"] .footer__grid {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .footer__bottom {
    color: #94a3b8;
}

/* ===== LIGHT PRELOADER ===== */
[data-theme="light"] .preloader {
    background: linear-gradient(145deg, #f0f4fa 0%, #e2e8f4 40%, #f5f0ff 100%);
}

[data-theme="light"] .preloader__star {
    background: var(--primary);
    opacity: 0.25;
    box-shadow: 0 0 6px rgba(79, 143, 255, 0.3);
}

@keyframes starTwinkleLight {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.8); }
}

[data-theme="light"] .preloader__star {
    animation-name: starTwinkleLight;
}

[data-theme="light"] .preloader__particle {
    opacity: 0.35;
    box-shadow: 0 0 8px var(--color), 0 0 16px rgba(79, 143, 255, 0.15);
}

@keyframes particleGlowLight {
    0%, 100% {
        box-shadow: 0 0 6px var(--color), 0 0 12px rgba(79, 143, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 12px var(--color), 0 0 28px var(--color), 0 0 40px rgba(139, 92, 246, 0.15);
    }
}

[data-theme="light"] .preloader__particle {
    animation: preloaderParticleFloat var(--duration) ease-in-out infinite,
               particleGlowLight 2s ease-in-out infinite;
}

[data-theme="light"] .preloader__particle:nth-child(odd) {
    animation-name: preloaderParticleFloat, particleGlowLight;
}

[data-theme="light"] .preloader__particle:nth-child(even) {
    animation-name: preloaderParticleFloat2, particleGlowLight;
}

[data-theme="light"] .preloader__particle:nth-child(3n) {
    animation-name: preloaderParticleFloat3, particleGlowLight;
}

[data-theme="light"] .preloader__glow {
    background: radial-gradient(circle, rgba(79, 143, 255, 0.18) 0%, rgba(139, 92, 246, 0.1) 40%, transparent 70%);
}

[data-theme="light"] .preloader__text {
    color: rgba(30, 41, 59, 0.45);
}

[data-theme="light"] .preloader__bar {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .preloader__progress {
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--purple));
    background-size: 200% 100%;
}

[data-theme="light"] .preloader__percent {
    color: var(--primary);
    opacity: 0.6;
}

[data-theme="light"] .hero,
[data-theme="light"] .hero-services,
[data-theme="light"] .hero-projets,
[data-theme="light"] .hero-contact {
    background: linear-gradient(135deg, #e8ecf4 0%, #dde3ee 100%);
    color: #1a202c;
}

[data-theme="light"] .hero p,
[data-theme="light"] .hero-services p,
[data-theme="light"] .hero-projets p,
[data-theme="light"] .hero-contact p {
    color: #64748b;
}

[data-theme="light"] .hero h1,
[data-theme="light"] .hero-services h1,
[data-theme="light"] .hero-projets h1,
[data-theme="light"] .hero-contact h1 {
    color: #1a202c;
}

[data-theme="light"] .hero__badge,
[data-theme="light"] [class*="hero-"] [class*="__badge"] {
    background: rgba(79, 143, 255, 0.1);
    border-color: rgba(79, 143, 255, 0.2);
}

[data-theme="light"] .hero__dot {
    border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .btn--outline {
    color: #1a202c;
    border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .btn--outline:hover {
    border-color: #1a202c;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn--dark {
    background: #1a202c;
}

[data-theme="light"] .section--stats {
    background: linear-gradient(180deg, #f0f2f7 0%, #ffffff 50%, #f0f2f7 100%);
}

[data-theme="light"] .stat__number {
    color: var(--primary);
}

[data-theme="light"] .timeline__number {
    border-color: #ffffff;
}

[data-theme="light"] .timeline::before {
    background: rgba(79, 143, 255, 0.15);
}

[data-theme="light"] .faq__question {
    background: #f5f7fb;
}

[data-theme="light"] .faq__question:hover {
    background: #edf0f7;
}

[data-theme="light"] .projet-card__img {
    background: linear-gradient(135deg, #dde3ee 0%, #e8ecf4 100%);
}

[data-theme="light"] .section--projets {
    background: linear-gradient(180deg, #f5f7fb 0%, #ffffff 100%);
}

[data-theme="light"] .section--projets-stats {
    background: linear-gradient(180deg, #edf0f7 0%, #f5f7fb 50%, #edf0f7 100%);
}

[data-theme="light"] .section--services {
    background: linear-gradient(180deg, #f5f7fb 0%, #ffffff 100%);
}

[data-theme="light"] .section--engagements {
    background: linear-gradient(180deg, #edf0f7 0%, #f5f7fb 50%, #edf0f7 100%);
}

[data-theme="light"] .section--form {
    background: linear-gradient(180deg, #f0f2f7 0%, #ffffff 100%);
}

[data-theme="light"] .contact-card {
    background: #ffffff;
}

[data-theme="light"] .form__input,
[data-theme="light"] .form__textarea,
[data-theme="light"] .form__select {
    background: #f5f7fb;
    color: #1a202c;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form__input:focus,
[data-theme="light"] .form__textarea:focus,
[data-theme="light"] .form__select:focus {
    border-color: var(--primary);
    background: #ffffff;
}

[data-theme="light"] .back-to-top {
    box-shadow: 0 4px 16px rgba(79, 143, 255, 0.2);
}

[data-theme="light"] .cookie-banner {
    background: rgba(255, 255, 255, 0.97);
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cookie-banner__btn--refuse {
    color: #475569;
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .cookie-banner__btn--refuse:hover {
    color: #1a202c;
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .footer__legal a {
    color: #94a3b8;
}

[data-theme="light"] .footer__legal span {
    color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .error-page {
    background: linear-gradient(135deg, #e8ecf4 0%, #dde3ee 100%);
}

/* Smooth transition for theme change */
[data-theme="light"] *,
[data-theme="light"] *::before,
[data-theme="light"] *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== ICON MICRO-ANIMATIONS ===== */
.icon-animate {
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
    0% { transform: scale(1) rotate(0deg); }
    30% { transform: scale(1.3) rotate(-10deg); }
    50% { transform: scale(0.9) rotate(5deg); }
    70% { transform: scale(1.15) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ===== GLASSMORPHISM CARDS ===== */
.card,
.why-us__item,
.faq__item,
.timeline__content {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-card,
.service-card,
.projets-stats__item {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .card,
[data-theme="light"] .why-us__item,
[data-theme="light"] .faq__item,
[data-theme="light"] .timeline__content {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .contact-card,
[data-theme="light"] .service-card,
[data-theme="light"] .projets-stats__item {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ===== ANIMATED GRADIENT TEXT ===== */
.hero h1 span,
.hero-services h1 span,
.hero-projets h1 span,
.hero-contact h1 span,
.hero-legal h1 span {
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--purple), var(--primary));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== HERO FLOATING PARTICLES ===== */
.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.hero-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: var(--color);
    border-radius: 50%;
    opacity: 0;
    animation: heroParticleFloat var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.hero-particle:nth-child(odd) {
    animation-name: heroParticleFloat;
}

.hero-particle:nth-child(even) {
    animation-name: heroParticleFloat2;
}

.hero-particle:nth-child(3n) {
    animation-name: heroParticleFloat3;
}

@keyframes heroParticleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% { opacity: 0.4; }
    50% {
        transform: translate(25px, -40px) scale(1.5);
        opacity: 0.25;
    }
    90% { opacity: 0.4; }
}

@keyframes heroParticleFloat2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% { opacity: 0.35; }
    50% {
        transform: translate(-30px, -25px) scale(1.3);
        opacity: 0.2;
    }
    90% { opacity: 0.35; }
}

@keyframes heroParticleFloat3 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.45; }
    50% {
        transform: translate(20px, -50px) scale(1.6) rotate(90deg);
        opacity: 0.2;
    }
    90% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-particle {
        animation: none;
    }
}

/* ===== CONFETTI (Easter Egg) ===== */
.confetti-container {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -10px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    background: var(--color);
    border-radius: 2px;
    animation: confettiFall var(--duration) ease-in forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

.confetti:nth-child(odd) {
    border-radius: 50%;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(var(--rotation)) scale(0.5);
        opacity: 0;
    }
}

/* ===== RIPPLE EFFECT ===== */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ===== PAGE TRANSITIONS ===== */
body {
    opacity: 0;
}

body.page-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

body.page-leaving {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.preloader-active {
    opacity: 1;
}



/* ===== FORM INPUT ERROR ===== */
.form__input--error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    animation: inputShake 0.4s ease;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ===== RESPONSIVE (global) ===== */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
}
