/* ==========================================================================
   DESIGN ULTRA-PREMIUM & CINÉMATIQUE (BASE GLOBALE)
   ========================================================================== */

/* 1. Importation automatique des polices (Inter pour le Luxe, Plus Jakarta Sans en fallback) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;800&display=swap');

/* 2. Variables Premium (Ombres, Arrondis, Transitions, Couleurs) */
:root {
    --bg: #fbfbfd;
    --accent: #2997ff; /* Bleu Apple Premium */
    --text-main: #1d1d1f;
    --text-dim: #6e6e73;
    --border: #d2d2d7;
    
    --premium-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    --premium-radius: 32px;
    --premium-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Base de la page (Typographie Premium et Lissage) */
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

/* 4. Moteur des animations Apple Luxe */
@keyframes luxuryFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes luxuryLogoReveal {
    0% { opacity: 0; filter: blur(12px); transform: scale(0.96); }
    100% { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes luxuryLanding {
    0% { opacity: 0; transform: translateY(40px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ======================================================================= */
/* HEADER & LOGO (Glassmorphism Premium)                                   */
/* ======================================================================= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0 5%; 
    height: 95px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    
    opacity: 0;
    animation: luxuryFade 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.logo-container { 
    display: flex; 
    align-items: center; 
    text-decoration: none; 
    color: var(--text-main); 
}

.logo-img { 
    height: 65px; 
    margin-right: 18px; 
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1)); 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    opacity: 0;
    animation: luxuryLogoReveal 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: filter, opacity, transform;
}

.logo-container:hover .logo-img { transform: scale(1.05); }
.logo-text { font-weight: 900; font-size: 1.35rem; letter-spacing: -1px; }
.logo-text span { color: var(--accent); }

nav a { 
    color: var(--text-main); 
    text-decoration: none; 
    font-weight: 600; 
    margin-left: 25px; 
    font-size: 0.95rem; 
    transition: var(--premium-transition); 
}
nav a:hover { color: var(--accent); }

/* ======================================================================= */
/* CONTENEURS & ANIMATIONS DE BASE                                         */
/* ======================================================================= */
.container { 
    max-width: 1100px; 
    margin: auto; 
    padding: 100px 20px 80px; 
}

main {
    opacity: 0;
    animation: luxuryLanding 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
    will-change: transform, opacity, filter;
}

footer {
    opacity: 0;
    animation: luxuryLanding 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.4s;
    will-change: transform, opacity, filter;
}

/* ======================================================================= */
/* CARTES PREMIUM (Flottantes sans bordures)                               */
/* ======================================================================= */
.grid, .premium-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 35px; 
}

.card, .premium-card {
    background: white; 
    border: none; 
    border-radius: var(--premium-radius);
    padding: 40px; 
    text-decoration: none; 
    color: inherit;
    box-shadow: var(--premium-shadow);
    transition: var(--premium-transition);
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    cursor: pointer;
    box-sizing: border-box;
    height: 100%;
}

.card:hover, .premium-card:hover { 
    transform: translateY(-12px) scale(1.01); 
    box-shadow: 0 30px 60px rgba(0,0,0,0.08); 
}

/* ======================================================================= */
/* ÉLÉMENTS DE DÉTAIL (Boutons et Badges)                                  */
/* ======================================================================= */
.badge { 
    padding: 6px 14px; 
    border-radius: 8px; 
    background: #f5f5f7; 
    color: var(--text-dim); 
    font-size: 0.8rem; 
    font-weight: 700; 
    display: inline-block; 
    margin-bottom: 15px; 
}

.btn, .premium-btn { 
    background: var(--text-main); 
    color: #fff; 
    padding: 16px 36px; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: 600; 
    display: inline-block; 
    transition: var(--premium-transition); 
    border: none; 
    cursor: pointer; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn:hover, .premium-btn:hover { 
    background: #000000; 
    transform: scale(1.03); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* ======================================================================= */
/* FOOTER PREMIUM                                                          */
/* ======================================================================= */
.footer {
    position: relative;
    background: #0b0c10;
    color: #e9e9e9;
    padding: 90px 24px 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}
.footer-bg { position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, rgba(120,120,255,0.12), transparent 40%), radial-gradient(circle at 80% 80%, rgba(0,200,255,0.08), transparent 45%); pointer-events: none; }
.footer-wrapper { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 70px; flex-wrap: wrap; position: relative; z-index: 2; }
.footer-brand { max-width: 380px; }
.footer-brand h2 { font-size: 1.7rem; letter-spacing: -0.6px; margin-bottom: 12px; }
.footer-brand p { color: rgba(255,255,255,0.6); line-height: 1.65; font-size: 0.95rem; }
.footer-grid { display: flex; gap: 70px; flex-wrap: wrap; }
.footer-col h4 { font-size: 0.82rem; color: #fff; margin-bottom: 14px; letter-spacing: 0.4px; text-transform: uppercase; }
.footer-col a { display: block; color: rgba(255,255,255,0.55); text-decoration: none; margin-bottom: 10px; font-size: 0.9rem; transition: 0.25s ease; position: relative; }
.footer-col a:hover { color: #fff; transform: translateX(4px); }
.footer-bottom { margin-top: 70px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: rgba(255,255,255,0.45); }

/* BARRE DE CONTACT */
.contact-bar { display: flex; justify-content: center; align-items: center; gap: 28px; padding: 20px 0; margin-top: 25px; }
.contact-item { width: 44px; height: 44px; display: flex; justify-content: center; align-items: center; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.03); transition: all 0.25s ease; backdrop-filter: blur(10px); text-decoration: none; }
.icon { width: 18px; height: 18px; fill: rgba(255,255,255,0.65); transition: all 0.25s ease; }
.contact-item:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); }
.contact-item:hover .icon { fill: #ffffff; }

/* ======================================================================= */
/* RESPONSIVE MOBILE UNIFIÉ (max-width: 768px)                             */
/* ======================================================================= */
@media (max-width: 768px) {
    header { flex-direction: column !important; height: auto !important; padding: 15px !important; position: relative !important; }
    nav { margin-top: 15px !important; flex-wrap: wrap !important; justify-content: center !important; gap: 10px !important; }
    nav a { margin: 0 10px !important; font-size: 0.9rem !important; }
    .logo-img { height: 45px !important; }
    
    h1, h2, h3, .logo-text, .faq-header h1 { letter-spacing: normal !important; }
    h1 { font-size: 2rem !important; line-height: 1.2 !important; }
    
    .hero, .hero-networks, .hero-impact { padding: 40px 15px !important; }
    .container { padding: 30px 15px !important; overflow-x: hidden !important; }
    
    .grid, .premium-grid, .program-grid, .info-grid, .stats-bar, .valeurs-container { display: flex !important; flex-direction: column !important; gap: 20px !important; margin: 30px 0 !important; }
    .card, .premium-card, .module-card, .faq-card, .valeur-card, .case-card { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; padding: 25px !important; margin: 0 !important; }
    
    .info-section { padding: 40px 20px !important; border-radius: 30px !important; margin: 0 0 40px 0 !important; }
    .contact-bar { gap: 18px; }
    .contact-item { width: 42px; height: 42px; }

    .footer-wrapper, .footer-container { display: flex !important; flex-direction: column !important; align-items: center !important; text-align: center !important; width: 100% !important; }
    .footer-bottom { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; text-align: center !important; margin-top: 20px !important; gap: 10px !important; }
    .footer-legal-nav { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 10px !important; margin: 15px 0 !important; }
    .footer, footer, .footer-grid, .footer-grid > div { text-align: center !important; align-items: center !important; justify-content: center !important; }
}

/* ======================================================================= */
/* MODE SOMBRE ULTRA-PREMIUM : BLINDAGE ABSOLU                             */
/* ======================================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --text-main: #ffffff;
        --text-dim: #a1a1a6;
    }
    
    /* 1. FOND NOIR ABSOLU ET TYPOGRAPHIE GLOBALE */
    body, main, section, .contact-container, .form-wrapper, form { 
        background-color: var(--bg) !important; 
        color: var(--text-main) !important; 
    }
    
    /* 2. EN-TÊTE GLASSMORPHISM SOMBRE */
    header {
        background: rgba(28, 28, 30, 0.75) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }
    
    /* -----------------------------------------------------------------
       3. LOGOS : INVERSION BLANCHE GARANTIE POUR TOUTES LES IMAGES
       ----------------------------------------------------------------- */
    img[src*="logo" i], img[alt*="logo" i], .logo-img, .hero-logo, .central-logo {
        filter: brightness(0) invert(1) !important;
    }
    
    .logo-text { color: #ffffff !important; }
    .logo-text span { 
        color: #5eacff !important; 
        text-shadow: 0 0 15px rgba(94, 172, 255, 0.3) !important; 
    }

    /* -----------------------------------------------------------------
       4. DESTRUCTION DÉFINITIVE DES BLOCS BLANCS (INTERCEPTEURS)
       Cible les classes connues ET les styles intégrés (inline) qui résistaient.
       ----------------------------------------------------------------- */
    .card, .premium-card, .module-card, .faq-card, .valeur-card, .case-card, 
    .info-section, .info-card, .program-card, .stats-bar, .valeurs-container,
    .formation-container, .formation-wrapper, .formation-content, 
    .white-block, .gray-block, .content-box, .panel, .overview-box,
    [style*="background: white" i], [style*="background-color: white" i], 
    [style*="background: #fff" i], [style*="background-color: #fff" i],
    [style*="background: #fbfbfd" i], [style*="background-color: #fbfbfd" i],
    .bg-white, .bg-light {
        background: #1c1c1e !important; /* Gris premium Apple */
        border: none !important;
        border-radius: var(--premium-radius) !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    }

    /* Le petit encart interne (ex: "À qui s'adresse-t-elle ?") */
    .audience-box, .gray-bg, .bg-gray, .detail-box, .tarif-box, .format-box,
    [style*="background: #f5f5f7" i], [style*="background-color: #f5f5f7" i] {
        background: #2c2c2e !important; /* Gris légèrement plus clair pour le contraste */
        border: none !important;
        border-radius: 20px !important;
    }

    /* -----------------------------------------------------------------
       5. FORCER LA LISIBILITÉ DU TEXTE DANS LES ANCIENS BLOCS BLANCS
       ----------------------------------------------------------------- */
    h1, h2, h3, h4, label {
        color: #ffffff !important;
    }
    
    /* Pulvérise les textes gris illisibles pour les rendre nets */
    p, li, span, .text-dim, 
    [style*="background"] p, [style*="background"] li, [style*="background"] span,
    .formation-content p, .formation-content li, .white-block p { 
        color: var(--text-dim) !important; 
    }

    /* -----------------------------------------------------------------
       6. LA SIGNATURE N.C.R : Numéros & Titres Clés en Bleu Lumineux
       ----------------------------------------------------------------- */
    .step-number, .number, .valeur-number, .methode-number, .card-number, .etape-number,
    .card h1, .card h2, .card h3,
    .premium-card h1, .premium-card h2, .premium-card h3,
    .info-section h2, .info-section h3 {
        color: #5eacff !important; /* Bleu clair éclatant */
        text-shadow: 0 0 20px rgba(94, 172, 255, 0.3) !important;
    }

    /* -----------------------------------------------------------------
       7. BOUTONS, BADGES ET FORMULAIRES
       ----------------------------------------------------------------- */
    .badge { 
        background: #2c2c2e !important; 
        color: #ffffff !important; 
        border: none !important;
    }
    
    .btn, .premium-btn {
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
    }
    
    .btn:hover, .premium-btn:hover { 
        background: #e5e5e5 !important; 
    }
    
    input, select, textarea {
        background: #1c1c1e !important; 
        color: #ffffff !important;
        border: 1px solid #323236 !important; 
        border-radius: 12px !important;
    }
    
    input::placeholder, textarea::placeholder {
        color: #86868b !important;
    }
}