/* ==========================================================
   VARIABLES GLOBALES ET RESET
   ========================================================== */
:root { 
    --cesi-yellow: #F4E333; 
    --cesi-black: #231F20; 
    --cesi-text: #333333; 
    --cesi-gray-light: #F1F3F2; 
    --cesi-white: #FFFFFF; 
    --font-family: 'Montserrat', sans-serif; 
}

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

body { 
    color: var(--cesi-text); 
    background-color: var(--cesi-white); 
    line-height: 1.6; 
    font-family: var(--font-family);
    scroll-behavior: smooth; 
    font-size: 15px; /* Taille de base affinée */
}

/* ==========================================================
   HEADER ET NAVIGATION
   ========================================================== */
header { 
    background-color: var(--cesi-white); 
    padding: 15px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    flex-wrap: nowrap; 
}

.logo-img { 
    height: 90px; 
    width: auto; 
    display: block; 
    transition: opacity 0.3s ease; 
}

.logo-img:hover { 
    opacity: 0.8; 
}

nav { 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-end; 
}

nav a { 
    margin-left: 25px; 
    text-decoration: none; 
    color: var(--cesi-black); 
    font-weight: 600; 
    font-size: 0.95rem; 
    transition: all 0.2s ease-in-out; 
    position: relative; 
    white-space: nowrap; 
}

nav a::after { 
    content: ''; 
    position: absolute; 
    width: 0%; 
    height: 3px; 
    bottom: -5px; 
    left: 0; 
    background-color: var(--cesi-yellow); 
    transition: width 0.3s ease; 
}

nav a:hover::after { 
    width: 100%; 
}

/* ==========================================================
   HERO SECTIONS (En-têtes de pages avec images)
   ========================================================== */
.hero { 
    color: var(--cesi-white); 
    padding: 150px 5%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: flex-start; 
    min-height: 70vh; 
}

.hero-index { 
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)), url('https://images.unsplash.com/photo-1522071820081-009f0129c71c?auto=format&fit=crop&w=1920&q=80') center/cover; 
}

.hero-entreprises { 
    background: linear-gradient(rgba(26, 26, 26, 0.8), rgba(26, 26, 26, 0.8)), url('https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1920&q=80') center/cover; 
}

.hero-etudiants { 
    background: linear-gradient(rgba(244, 227, 51, 0.9), rgba(244, 227, 51, 0.9)), url('https://images.unsplash.com/photo-1523240795612-9a054b0db644?auto=format&fit=crop&w=1920&q=80') center/cover; 
    color: var(--cesi-black); 
    align-items: center; 
    text-align: center;
}

.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 20px; line-height: 1.1; max-width: 800px; }
.hero-etudiants h1 { font-size: 2.5rem; }
.hero-entreprises h1 { font-size: 2.5rem; color: var(--cesi-yellow); }

.hero p { font-size: 1.1rem; max-width: 700px; margin-bottom: 40px; color: #EAEAEA; }
.hero-etudiants p { color: var(--cesi-black); font-weight: 600; }

/* ==========================================================
   SECTIONS ET GRILLES DE CONTENU
   ========================================================== */
.section { padding: 100px 5%; }
.bg-gray { background-color: var(--cesi-gray-light); }

.section-title { 
    font-size: 2rem; 
    font-weight: 800; 
    color: var(--cesi-black); 
    margin-bottom: 50px; 
    position: relative; 
    display: inline-block; 
}

.section-title::after { 
    content: ''; 
    position: absolute; 
    left: 0; 
    bottom: -15px; 
    width: 60px; 
    height: 5px; 
    background-color: var(--cesi-yellow); 
}

.hero-etudiants .section-title::after { display: none; }

.text-lead { 
    font-size: 1.05rem; 
    max-width: 900px; 
    line-height: 1.8; 
    margin-bottom: 30px; 
    color: var(--cesi-text); 
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 40px; 
}

/* ==========================================================
   CARTES (Valeurs, Services, Équipe)
   ========================================================== */
.card-valeur, .card-service { 
    background-color: var(--cesi-white); 
    padding: 40px; 
    border-radius: 4px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.03); 
    transition: transform 0.3s ease; 
}

.card-valeur { border-left: 5px solid var(--cesi-black); }
.card-service { border-left: 5px solid var(--cesi-yellow); }

.card-valeur:hover, .card-service:hover { transform: translateY(-8px); }

.card-valeur h3, .card-service h3 { 
    font-size: 1.25rem; 
    font-weight: 700; 
    color: var(--cesi-black); 
    margin-bottom: 10px; 
}

.card-team { 
    background-color: var(--cesi-white); 
    padding: 30px; 
    border: 1px solid #EAEAEA; 
    border-radius: 4px; 
}

.team-role { 
    font-weight: 700; 
    font-size: 0.85rem; 
    color: var(--cesi-black); 
    background-color: var(--cesi-yellow); 
    display: inline-block; 
    padding: 5px 10px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 15px; 
    border-radius: 2px; 
}

.card-team h3 { font-size: 1.2rem; font-weight: 700; color: var(--cesi-black); }

/* ==========================================================
   MÉTHODOLOGIE (Numérotation)
   ========================================================== */
.step-container { display: flex; align-items: flex-start; margin-bottom: 30px; }
.step-number { 
    background-color: var(--cesi-black); 
    color: var(--cesi-yellow); 
    font-size: 1.2rem; 
    font-weight: 800; 
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
    flex-shrink: 0; 
    margin-right: 20px; 
}
.step-content h3 { font-size: 1.15rem; font-weight: 700; color: var(--cesi-black); margin-bottom: 8px; margin-top: 5px; }

/* ==========================================================
   BOUTONS ET APPELS À L'ACTION (CTA)
   ========================================================== */
.grid-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; margin-top: 50px; }
.card-cta { padding: 60px; border-radius: 4px; transition: transform 0.3s; text-decoration: none; display: block; }
.card-cta:hover { transform: translateY(-10px); }

.bg-black { background: var(--cesi-black); color: white; }
.bg-yellow { background: var(--cesi-yellow); color: var(--cesi-black); }

.card-cta h2 { font-size: 1.6rem; margin-bottom: 15px; }
.card-cta p { font-size: 1rem; margin-bottom: 30px; }

.btn { 
    display: inline-block; 
    padding: 15px 30px; 
    font-weight: 700; 
    border-radius: 3px; 
    text-decoration: none; 
    text-transform: uppercase; 
    transition: 0.3s; 
}

.btn-white { background: white; color: var(--cesi-black); }
.btn-black { background: var(--cesi-black); color: white; }
.btn-white:hover { background: #eee; }
.btn-black:hover { background: #444; }

.btn-primary { 
    display: inline-block; 
    background-color: var(--cesi-yellow); 
    color: var(--cesi-black); 
    padding: 16px 35px; 
    text-decoration: none; 
    font-weight: 700; 
    font-size: 1rem; 
    border-radius: 3px; 
    transition: all 0.3s; 
    margin-top: 20px;
}

/* ==========================================================
   PAGE ÉTUDIANTS (Container Split)
   ========================================================== */
.split-container { display: flex; flex-wrap: wrap; width: 100%; }
.split-box { flex: 1; min-width: 350px; padding: 100px 8%; display: flex; flex-direction: column; justify-content: flex-start; }

.box-light { background-color: var(--cesi-white); }
.box-dark { background-color: var(--cesi-black); color: var(--cesi-white); }
.box-dark .section-title { color: var(--cesi-white); }
.box-dark .text-lead { color: #CCCCCC; }

.split-box ul { list-style: none; padding: 0; margin-top: 30px; margin-bottom: 40px; }
.split-box ul li { margin-bottom: 20px; font-size: 1.1rem; padding-left: 35px; position: relative; }
.split-box ul li::before { content: '■'; position: absolute; left: 0; top: 2px; color: var(--cesi-yellow); font-size: 1.2rem; }

.split-box .btn-primary { align-self: flex-start; }
.box-light .btn-primary { background-color: var(--cesi-black); color: var(--cesi-white); }
.box-light .btn-primary:hover { background-color: var(--cesi-yellow); color: var(--cesi-black); }

/* ==========================================================
   FOOTER
   ========================================================== */
footer { background-color: var(--cesi-black); color: var(--cesi-white); padding: 80px 5% 30px 5%; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 50px; margin-bottom: 50px; }
.footer-col h2 { font-size: 2rem; font-weight: 800; margin-bottom: 20px; }
.footer-col p { font-size: 1rem; color: #CCCCCC; margin-bottom: 15px; }
.footer-col a { color: var(--cesi-yellow); text-decoration: none; font-weight: 700; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid #333; padding-top: 25px; font-size: 0.85rem; color: #888; }

/* ==========================================================
   ORGANIGRAMME (Page d'accueil)
   ========================================================== */
.org-container { 
    margin-top: 50px; 
}

.org-bureau { 
    background-color: var(--cesi-gray-light); 
    padding: 50px 20px; 
    border-radius: 8px; 
    margin-bottom: 50px; 
    text-align: center; 
}

.org-bureau h3 {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--cesi-black);
    margin-bottom: 30px;
}

.org-bureau-grid { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 30px; 
}

.member-card { 
    background: var(--cesi-white); 
    padding: 25px 20px; 
    border-radius: 4px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    min-width: 240px; 
    border-bottom: 4px solid var(--cesi-yellow); 
}

.member-card.president { 
    border-color: var(--cesi-black); 
}

.member-name { 
    font-weight: 700; 
    font-size: 1.05rem; 
    color: var(--cesi-black); 
    margin-bottom: 5px;
}

.member-role { 
    font-size: 0.85rem; 
    color: #666; 
    text-transform: uppercase; 
    font-weight: 700; 
    display: block; 
}

/* Grille des pôles */
.org-poles { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 30px; 
}

.pole-card { 
    border: 1px solid #EAEAEA; 
    border-top: 4px solid var(--cesi-black); 
    padding: 30px; 
    border-radius: 4px; 
    background: var(--cesi-white); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.pole-title { 
    font-size: 1.15rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    margin-bottom: 20px; 
    color: var(--cesi-black); 
    border-bottom: 2px solid var(--cesi-gray-light); 
    padding-bottom: 15px; 
}

.pole-members { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.pole-members li { 
    padding: 12px 0; 
    border-bottom: 1px solid #F5F5F5; 
    line-height: 1.4;
}

.pole-members li:last-child { 
    border-bottom: none; 
}

/* Style pour les postes à pourvoir */
.vacant .member-name {
    color: #999;
    font-style: italic;
}

.vacant-role {
    color: #999;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* ==========================================================
   MENU BURGER (Masqué sur PC par défaut)
   ========================================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 28px;
    height: 3px;
    background-color: var(--cesi-black);
    transition: all 0.3s ease-in-out;
    border-radius: 3px;
}

/* ==========================================================
   RESPONSIVE DESIGN (Smartphones & Tablettes)
   ========================================================== */
@media screen and (max-width: 768px) {
    /* ----- Header & Navigation ----- */
    header {
        flex-wrap: wrap; /* Autorise le passage à la ligne */
        padding: 10px 5%;
    }

    .logo-img {
        height: 60px; /* Logo plus petit sur mobile */
    }

    .menu-toggle {
        display: flex; /* Affiche le burger sur mobile */
    }

    /* On cache le menu de base et on le transforme en colonne */
    nav {
        display: none; 
        width: 100%;
        flex-direction: column;
        align-items: center;
        background-color: var(--cesi-white);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 20px 0;
        box-shadow: 0 10px 10px rgba(0,0,0,0.05);
    }

    nav.active {
        display: flex; /* Affiché quand on clique sur le burger */
    }

    nav a {
        margin: 15px 0;
        font-size: 1.1rem;
    }

    nav a::after {
        display: none; /* Désactive le soulignement jaune sur mobile */
    }

    /* Animation de la croix pour le burger */
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* ----- Espacements globaux ----- */
    .hero { padding: 100px 5% 80px 5%; min-height: 50vh; }
    .section { padding: 60px 5%; }
    .split-box { padding: 60px 5%; min-width: 100%; } /* Corrige le débordement de la page étudiants */
    
    /* ----- Typographie Mobile ----- */
    .hero h1 { font-size: 2.2rem; }
    .hero-etudiants h1, .hero-entreprises h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .section-title { font-size: 1.6rem; margin-bottom: 30px; }
    .card-cta h2 { font-size: 1.4rem; }
    .text-lead { font-size: 1rem; }
    
    /* ----- Grilles et éléments ----- */
    .grid-cta { grid-template-columns: 1fr; } /* Cartes d'accueil les unes sous les autres */
    .card-cta { padding: 40px 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; } /* Footer centré */
    
    /* ----- Organigramme ----- */
    .org-bureau { padding: 30px 15px; }
    .member-card { min-width: 100%; } /* Cartes membres prennent toute la largeur */
    .step-container { flex-direction: column; }
    .step-number { margin-bottom: 15px; }
}
/* ==========================================================
   POPUP DE CONTACT (CSS Modal)
   ========================================================== */
.popup-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px); /* Floute l'arrière-plan */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Indispensable pour passer au-dessus du menu ! */
    margin: 0;
    padding: 0;
}

.popup-content {
    background-color: var(--cesi-white);
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    border-top: 5px solid var(--cesi-yellow);
    animation: popupFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupFadeIn {
    from { transform: translateY(-40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}