/* ==========================================================================
   1. VARIABLES & REBOOT
   ========================================================================== */
:root {
    --primary-color: #1E319D; /* 005bb5 Bleu institutionnel REGIDESO */
    --primary-dark: #003f7f;
    --primary-soft: rgba(30, 49, 157, 0.1);
    --text-dark: #2b3440;
    --text-white: #ffffff;
    --text-muted: #6c757d;
    --bg-light: #f8fafe;
    
    /* Variables Bootstrap (Surcharges) */
    --bs-primary: #1E319D !important;
    --bs-primary-rgb: 30, 49, 157 !important;
    --bs-link-color-rgb: #1E319D !important;
    --bs-pagination-color: #1E319D !important;
    --bs-pagination-active-bg: #1E319D !important;
    --bs-pagination-active-border-color: #1E319D !important;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}
.bg-glass-primary {
    /* background-color: rgba(30, 49, 157, 0.5) !important;  Dérivé semi-transparent de --primary-color (#1E319D) */
    background-color: rgba(255, 255, 255, 0.15) !important; /* Dérivé semi-transparent de --primary-color (#1E319D) */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   2. UTILITAIRES & TYPOGRAPHIE
   ========================================================================== */
.tracking-wider { letter-spacing: 0.1em; }
.section-padding { padding: 100px 0; }
.bg-light { background-color: var(--bg-light) !important; }
.bg-primary-soft { background-color: var(--primary-soft) !important; }
.text-primary { color: var(--primary-color) !important; }

/* ==========================================================================
   3. NAVIGATION (Navbar Responsive & Scroll)
   ========================================================================== */

/* Styles communs */
.transition-nav {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.3s ease;
}
.transition-nav .nav-link.active {
    font-weight: 600;
    position: relative;
}

.custom-toggler {
    border: none;
    font-size: 1.5rem;
}

.custom-toggler:focus {
    box-shadow: none;
}

/* ==========================================
   1. DESKTOP (≥ 992px) : Transition Scroll & Logos
   ========================================== */
@media (min-width: 992px) {
    .transition-nav {
        padding: 1.5rem 0;
        background-color: transparent;
    }

    .transition-nav .nav-link,
    .transition-nav .navbar-brand,
    .custom-toggler {
        color: #fff !important;
        transition: color 0.3s ease;
    }

    .transition-nav .nav-link {
        font-weight: 500;
        font-size: 0.95rem;
    }

    /* Animation fluide entre les deux logos au scroll */
    .logo-default,
    .logo-scrolled {
        transition: opacity 0.3s ease;
    }

    /* État initial (Transparent) : Logo Vert */
    .transition-nav:not(.scrolled) .logo-default { display: block !important; }
    .transition-nav:not(.scrolled) .logo-scrolled { display: none !important; }

    /* État au Scroll (Fond Blanc) : Logo Noir */
    .transition-nav.scrolled {
        background-color: rgba(255, 255, 255, 0.98);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        padding: 1.5rem 0;
        backdrop-filter: blur(10px);
    }

    .transition-nav.scrolled .logo-default { display: none !important; }
    .transition-nav.scrolled .logo-scrolled { display: block !important; }

    .transition-nav.scrolled .nav-link,
    .transition-nav.scrolled .navbar-brand,
    .transition-nav.scrolled .custom-toggler {
        color: var(--text-dark) !important;
    }

    .transition-nav.scrolled .nav-link:hover,
    .transition-nav.scrolled .nav-link.active {
        color: var(--primary-color) !important;
    }
    .transition-nav.scrolled .btn-contact-nav{

        color: #ffffff !important;
    }

    /*Etat actif de link*/
    .transition-nav .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 50%;
        height: 2px;
        border-radius: 2px;
        transition: background-color 0.3s ease, width 0.3s ease;
    }

    /* État NON-SCROLLED (Fond sombre/transparent) */
    .transition-nav:not(.scrolled) .nav-link.active {
        color: #ffffff !important;
    }
    .transition-nav:not(.scrolled) .nav-link.active::after {
        background-color: #ffffff;
    }

    /* État SCROLLED (Fond blanc) */
    .transition-nav.scrolled .nav-link.active {
        color: var(--primary-color) !important;
    }
    .transition-nav.scrolled .nav-link.active::after {
        background-color: var(--primary-color);
        width: 60%;
    }
}

/* ==========================================
   2. MOBILE (< 992px) : Logo Noir Unique & Menu Déroulant
   ========================================== */
@media (max-width: 991.98px) {
    /* Masquer impérativement le logo vert */
    .logo-default {
        display: none !important;
    }

    /* Forcer l'affichage unique du logo noir sans transition */
    .logo-scrolled {
        display: block !important;
        max-width: 150px !important;
        transition: none !important;
    }

    /* Navbar mobile sur fond blanc fixe */
    .transition-nav {
        background-color: #ffffff !important;
        padding: 0.75rem 0 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    .transition-nav .nav-link,
    .transition-nav .custom-toggler {
        color: var(--text-dark) !important;
    }

    /* Menu déroulant mobile (navbar-collapse) */
    .transition-nav .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem 0 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        margin-top: 0.5rem;
    }

    .transition-nav .nav-link {
        padding: 0.7rem 0 !important;
        font-size: 1rem;
        text-align: center;
    }

    /* Bouton d'action / urgence pleine largeur */
    .transition-nav .btn-contact-nav {
        margin: 0.8rem 0 0.5rem;
        width: 100%;
        text-align: center;
        color: #ffffff !important;
        padding: 0.6rem 1.2rem;
        display: block;
    }
    .transition-nav .nav-link.active {
        color: var(--primary-color) !important;
        background-color: var(--primary-soft); /* Léger fond bleu pour faire ressortir l'élément */
        border-radius: 8px;
    }
}

/* Ajustements très petits écrans (< 380px) */
@media (max-width: 379.98px) {
    .logo-scrolled {
        max-width: 130px !important;
    }
}


/* ==========================================================================
   4. SECTIONS PRINCIPALES (Hero & En-têtes)
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    background: url('hero.jpg') no-repeat center center;
    background-size: cover;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15,32,39,0.95) 0%, rgba(32,58,67,0.8) 50%, rgba(44,83,100,0.4) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.page-header {
    min-height: 350px;
}

/* ==========================================================================
   5. COMPOSANTS (Boutons, Cartes, Icônes, Formulaires)
   ========================================================================== */
/* Boutons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 91, 181, 0.3);
}

.btn-contact-nav {
    border-radius: 50px;
    padding-inline: 1.5rem !important;

}

.btn-outline-primary {
    --bs-btn-color: #1E319D;
    --bs-btn-border-color: #1E319D;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #1E319D;
    --bs-btn-hover-border-color: #1E319D;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #1E319D;
    --bs-btn-active-border-color: #1E319D;
    --bs-btn-disabled-color: #1E319D;
    --bs-btn-disabled-border-color: #1E319D;
}

/* Cartes & Icônes */
.icon-box,
.icon-box-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-box {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
}

.icon-box-sm {
    width: 45px;
    height: 45px;
}

.service-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
}

.news-card { transition: transform 0.3s ease; }
.news-card:hover { transform: translateY(-5px); }

/* Cartes Partenaires */
.partner-card {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.1) !important;
    border-color: var(--bs-primary) !important;
}

.partner-logo {
    max-height: 85px;
    width: 85%;
    max-width: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.partner-card:hover .partner-logo { transform: scale(1.05); }

/* Formulaires */
.form-control:focus, .form-select:focus {
    box-shadow: none;
    border-color: var(--primary-color);
    background-color: #fff !important;
    outline: 2px solid var(--primary-soft);
}

/* Accordéon */
.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: var(--primary-soft);
    box-shadow: inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--bs-accordion-border-color);
}
.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,.125);
}

/* Icônes spécifiques */
.bi-pip::before { content: "\F4E2"; }

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
    display: inline-block;
}
.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}
.hover-white { transition: color 0.3s; }
.hover-white:hover { color: #fff !important; }

/* ==========================================================================
   7. ANIMATIONS & TRANSITIONS D'IMAGES
   ========================================================================== */
/* Apparition au scroll (Intersection Observer) */
.fade-in-up, 
.fade-in-left, 
.fade-in-right {
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-in-up { transform: translateY(40px); }
.fade-in-left { transform: translateX(-40px); }
.fade-in-right { transform: translateX(40px); }

.fade-in-up.is-visible,
.fade-in-left.is-visible,
.fade-in-right.is-visible {
    opacity: 1;
    transform: translate(0);
}