/* ==========================================================================
   1. GLOBAL & CŒUR DU SITE
   Variables, Reset, Navbar, Footer, UI Kit, Media Queries Globaux
   ========================================================================== */

/* --- Variables globales --- */
:root {
    --rouge: #E31E24;        /* couleur principale rouge */
    --rouge-fonce: #B71C1C;  /* rouge foncé pour hover/accent */
    --texte-fonce: #2D2D2D;  /* couleur du texte principal */
    --texte-clair: #6B7280;  /* couleur du texte secondaire */
    --fond-clair: #F9FAFB;   /* couleur de fond du site */
}

/* --- Reset & Base --- */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: var(--texte-fonce);
    background-color: var(--fond-clair);
    margin: 0;
}

ul, ol {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* Images responsives globales */
.section img.img-fluid {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 0.5rem;
    display: block;
}

/* --- Navigation (Navbar) --- */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-nav .nav-link {
    color: var(--texte-fonce);
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.hover {
    color: var(--rouge);
}

/* Menu Burger */
.navbar-toggler {
    border: none;
    outline: none;
    padding: .5rem;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    background-image: url("../img/burger.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-color: transparent;
}

/* --- Footer Global --- */
footer {
    background-color: var(--rouge);
    color: #fff;
    padding-top: 2.5rem;
}

.footer-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    column-gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.footer-block {
    min-width: 220px;
}

.footer-block h3 {
    margin-bottom: 0.5rem;
}

.footer-block ul li {
    margin-bottom: 0.5rem;
}

.footer-block a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer-block a:hover {
    opacity: 0.7;
}

.footer-bottom {
    text-align: center;
    padding: 1.2rem;
    background: var(--rouge-fonce);
    font-size: 0.9rem;
}

/* --- UI Kit & Composants Communs --- */

/* Boutons */
.btn-primary-red {
    background-color: var(--rouge);
    border-color: var(--rouge);
    color: #fff;
    padding: 0.75rem 1.5rem;
}

.btn-primary-red:hover {
    background-color: var(--rouge-fonce);
    border-color: var(--rouge-fonce);
}

/* Liens d'action */
.action-link {
    display: inline-block;
    color: var(--rouge); /* ou #B71C1C selon contexte, harmonisé ici */
    font-weight: 500;
    margin-top: 0.75rem;
    position: relative;
    text-decoration: none;
    transition: color 0.2s ease;
}

.action-link:hover {
    color: var(--rouge-fonce); /* #8E1616 */
    text-decoration: none; /* géré par le pseudo-element ci-dessous */
}

.action-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background-color: var(--rouge-fonce);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.action-link:hover::after {
    transform: scaleX(1);
}

/* Sections & Titres */
.section {
    padding: 3rem 0;
}

.section-title {
    color: var(--rouge);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 2.5rem);
}

.section h3 {
    color: var(--rouge);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section ul li {
    margin-bottom: 0.5rem;
}

/* Cartes (Card) Globales */
.card {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: #fff;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.25rem;
    color: #000;
}

.card a {
    text-decoration: none;
    color: inherit;
}

/* Styles spécifiques cartes sur fond clair */
.section.bg-light .card-title,
.section.bg-light .card-link,
.section.bg-light .card a {
    color: #000;
    text-decoration: none;
}

/* Réseaux sociaux (Ronds) */
.socials, .social-links-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.socials a, .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    text-decoration: none;
}

.socials a:hover, .social-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Accordéons */
.accordion-button:not(.collapsed) {
    background-color: var(--fond-clair);
    color: var(--rouge);
}

.accordion-button:focus {
    box-shadow: 0 0 0 2px rgba(227, 30, 36, 0.3);
}

/* --- MEDIA QUERIES GLOBAUX --- */

/* Navigation Mobile (Tablette et moins) */
@media (max-width: 992px) {
    .navbar-collapse {
        display: none;
    }

    /* Menu visible sur mobile */
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 1.5rem;
        min-height: 80vh;
        padding: 2rem 0;
        text-align: center;
    }

    /* Liens centrés */
    .navbar-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        margin: 0;
        padding: 1rem 0;
    }

    .navbar-nav .nav-item {
        margin: 0.5rem 0;
        width: fit-content;
    }

    .navbar-nav .nav-link {
        text-align: center;
        font-size: 1.1rem;
        padding: 0.75rem 0;
    }

    /* Bouton centré */
    .navbar .btn-primary-red {
        margin-top: 1.5rem;
        text-align: center;
        width: fit-content;
        font-size: 1rem;
        padding: 0.9rem 1.8rem;
    }

    /* Footer Mobile */
    .footer-main {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding-bottom: 2rem;
    }

    .footer-block {
        width: 100%;
        margin: 0 auto;
        padding: 1rem 0;
    }

    .footer-block h3,
    .footer-block p,
    .footer-block address {
        margin: 0.5rem 0;
        line-height: 1.5;
    }

    .socials {
        justify-content: center;
        gap: 0.75rem;
        margin-top: 0.5rem;
    }
}

/* Ajustements petits écrans (Mobile < 680px) */
@media (max-width: 680px) {
    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: clamp(1.5rem, 4vw, 1.8rem);
    }

    .navbar-collapse {
        min-height: 60vh;
    }

    footer .h5,
    footer p:not(.text-center),
    footer ul,
    footer address {
        text-align: center;
    }

    .d-flex.gap-2 {
        justify-content: center;
    }
}

/* ==========================================================================
   2. STYLES SPÉCIFIQUES PAR SECTION / PAGE
   ========================================================================== */

/* --- Page Accueil : Carrousel Hero --- */
#heroCarousel .carousel-item {
    height: 75vh;
    min-height: 450px;
    position: relative;
    transition: transform 1.2s ease-in-out;
}

#heroCarousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#heroCarousel .carousel-caption {
    bottom: 20%;
}

@media (max-width: 680px) {
    #heroCarousel .carousel-item {
        height: 55vh;
        min-height: 280px;
    }
    #heroCarousel .carousel-caption h1,
    #heroCarousel .carousel-caption h2 {
        font-size: 1.6rem;
    }
    #heroCarousel .carousel-caption p {
        font-size: 1rem;
    }
}

/* --- Section : Grille des Missions --- */
.missions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.missions-grid .card-body {
    padding: 1rem;
}

.card-img-top,
.missions-grid img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.missions-grid a {
    text-decoration: none;
    color: inherit;
}

@media (max-width: 991px) {
    .missions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .missions-grid {
        grid-template-columns: 1fr;
    }
    .card-img-top {
        height: 150px;
    }
}

/* --- Section : Nos Métiers --- */
.flex-metiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    justify-content: center;
    align-items: stretch;
    margin-top: 2rem;
}

.metier-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metier-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.metier-card h3 {
    color: var(--rouge);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.metier-card p {
    color: var(--texte-fonce);
    font-size: 1rem;
    line-height: 1.5;
}

@media (max-width: 680px) {
    .flex-metiers {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-top: 1.5rem;
    }

    .metier-card {
        max-width: 90%;
        margin: 0 auto;
        padding: 1.5rem 1rem;
    }
}

/* --- Section : Politique RH --- */
.politique-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.politique-container .card {
    flex: 1 1 300px;
    max-width: 400px;
}

.politique-list {
    list-style: none;
    padding: 0;
    margin: 2rem auto;
    max-width: 800px;
}

.politique-list li {
    position: relative;
    background: #fff;
    color: var(--texte-fonce);
    border-radius: 8px;
    padding: 1rem 1.5rem 1rem 3rem;
    margin-bottom: 1rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
    line-height: 1.6;
    transition: none;
}

.politique-list li::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1.3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--rouge);
}

.politique-list li:hover {
    background-color: #fff;
    transform: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

/* --- Section : Diversité & Tableaux --- */
#diversite .card {
    border: 2px solid var(--rouge);
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}

#diversite .card-header {
    background-color: var(--rouge);
    color: #fff;
    font-weight: 700;
    text-align: center;
    padding: 0.8rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--rouge);
}

#diversite .table {
    margin: 0 auto;
    width: 100%;
    max-width: 800px;
    border: 2px solid var(--rouge);
    border-collapse: collapse;
    background-color: #fff;
}

#diversite .table thead th {
    background-color: var(--rouge);
    color: #fff;
    text-align: center;
    padding: 0.75rem;
    border: 1px solid var(--rouge);
    font-weight: 600;
}

#diversite .table tbody td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: center;
}

/* --- Section : Témoignages --- */
.testimonial-carousel .carousel-item {
    padding: 2rem 0;
}

.testimonial-carousel img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin: 0 auto 1rem;
}

.testimonial-carousel h4 {
    color: var(--rouge);
    font-weight: 700;
    font-size: 1.25rem;
}

.testimonial-carousel .cite {
    font-weight: 700;
    color: var(--texte-fonce);
    display: block;
    margin-top: 1rem;
}

.testimonial-carousel .carousel-indicators [data-bs-target] {
    background-color: var(--rouge);
    opacity: 0.5;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    margin: 0 5px;
}

.testimonial-carousel .carousel-indicators .active {
    opacity: 1;
}

/* Contrôles du carrousel témoignages */
#temoignages .carousel-control-prev-icon,
#temoignages .carousel-control-next-icon {
    background-color: var(--rouge);
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

@media (max-width: 1000px), (max-width: 680px) {
    #temoignages .carousel-control-prev-icon,
    #temoignages .carousel-control-next-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 680px) {
    .testimonial-carousel .carousel-item {
        text-align: center;
    }
    .testimonial-carousel img {
        margin: 0 auto 1.5rem;
    }
}

/* --- Section : Newsletter --- */
.section-newsletter {
    background-color: var(--rouge);
    color: #fff;
}

.section-newsletter h4 {
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1.25rem;
}

.section-newsletter .btn-light {
    color: var(--rouge);
    font-weight: bold;
    min-width: 60px;
}

.section-newsletter .btn-light:hover {
    background-color: #f0f0f0;
    color: var(--rouge-fonce);
}

/* --- Pages Spécifiques (ex: Titouan) --- */
.page-header-banner {
    background-color: var(--rouge);
    color: #fff;
    padding: 2rem 0;
}

.page-header-banner h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header-banner .breadcrumb {
    padding: 0;
    margin-bottom: 0;
    background-color: transparent;
}

.page-header-banner .breadcrumb-item a {
    color: #fff;
    text-decoration: none;
}

.page-header-banner .breadcrumb-item a:hover {
    text-decoration: underline;
}

.page-header-banner .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.7);
}

/* Alignement spécifique image */
@media (max-width: 680px) {
    .col-image-droite {
        text-align: right;
    }
}

@media (max-width: 780px) {
    .col-image-droite {
        text-align: center;
    }
}

/* --- Carte Interactive (SVG) --- */
div.carte {
    fill: #cccccc;
    stroke: #ffffff;
    stroke-width: 1px;
    transition: fill 0.2s ease-in-out;
}

div.carte svg .region:hover path {
    fill: #E31E24;
    cursor: pointer;
}

/* ==========================================================================
   3. PARTIE ADMINISTRATION (BACK-OFFICE)
   ========================================================================== */

/* --- Page de Connexion (Login) --- */
body.login-page {
    background-color: var(--fond-clair);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-custom {
    background-color: var(--rouge);
    color: white;
    border: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-custom:hover {
    background-color: var(--rouge-fonce);
    color: white;
}

/* Structure globale Admin */
.admin-container {
    display: flex;
    min-height: 100vh;
    background-color: #f4f6f9;
    font-family: 'Inter', sans-serif;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #E31E24 0%, #B71C1C 100%);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(227, 30, 36, 0.2);
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-height: 70px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 8px;
}

.sidebar-link i { width: 25px; margin-right: 10px; font-size: 1.1rem; }

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(5px);
}

.sidebar-link.active {
    background-color: #ffffff;
    color: #E31E24;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
}

.btn-logout {
    display: block;
    width: 100%;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover {
    background-color: #fff;
    color: #E31E24;
    border-color: #fff;
}

/* CONTENU PRINCIPAL ADMIN */
.admin-content {
    flex-grow: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

.page-title {
    font-weight: 700;
    color: var(--texte-fonce);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

/* CARTES & DASHBOARD ADMIN */
.card-admin {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-admin:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}

.stat-card {
    border-left: 5px solid var(--rouge);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--texte-fonce);
    line-height: 1.2;
}

.stat-label {
    color: var(--texte-clair);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 600;
}

/* TABLEAUX ADMIN */
.table-admin {
    margin-bottom: 0;
}

.table-admin thead th {
    background-color: #f8f9fa;
    color: var(--texte-clair);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 2px solid #e9ecef;
    padding: 1rem;
}

.table-admin tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--texte-fonce);
    border-bottom: 1px solid #f1f1f1;
}

.table-admin tbody tr:hover {
    background-color: #fafafa;
}

/* BOUTONS & BADGES ADMIN */
.btn-admin-primary {
    background-color: var(--rouge);
    color: #fff;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    border: none;
    transition: background 0.3s;
}

.btn-admin-primary:hover {
    background-color: var(--rouge-fonce);
    color: #fff;
}

.badge-statut {
    padding: 0.5em 0.8em;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-prevu { background-color: #e3f2fd; color: #0d47a1; }
.badge-cours { background-color: #e8f5e9; color: #1b5e20; }
.badge-termine { background-color: #f5f5f5; color: #616161; }