/* ══════════════════════════════════════════════════════════════
   SALLE DU NUMÉRIQUE UNILU — VRAI MODE SOMBRE PROFESSIONNEL (OLED BLACK)
   Spécification : 
   - Partout où il y a du Blanc ➔ devient du Vrai Noir (True Black #000000 / #0a0a0a)
   - Tout le Rouge vif ➔ devient du Rouge Braise / Blaze (#8B0000 / #9B111E / #b31414)
   ══════════════════════════════════════════════════════════════ */

:root {
    --blaze-red: #9B111E;
    --blaze-red-dark: #700606;
    --blaze-red-light: #C52222;
    --blaze-glow: rgba(155, 17, 30, 0.45);
    --true-black: #000000;
    --black-surface: #0A0A0A;
    --black-card: #0F0F0F;
    --black-card-hover: #161616;
    --black-border: #222222;
    --black-input: #050505;
}

/* ─── 1. STRUCTURE GLOBALE EN VRAI NOIR ─── */
html[data-theme="dark"],
body.dark-mode {
    background-color: #000000 !important;
    color: #EDEDED !important;
}

body.dark-mode * {
    scrollbar-color: #444444 #0a0a0a;
}

body.dark-mode .bg-light,
body.dark-mode .bg-white,
body.dark-mode .container-fluid:not(.sticky-top):not(.hero-header),
body.dark-mode .container {
    background-color: transparent !important;
}

/* Arrière-plan technologique en mode sombre */
body.dark-mode.tech-bg::before,
body.dark-mode .tech-bg::before {
    background: rgba(0, 0, 0, 0.95) !important;
}

body.dark-mode .tech-bg-canvas {
    opacity: 0.12 !important;
    filter: invert(1) brightness(0.7);
}

/* ─── 2. NAVBAR WIDTH MAX & DESIGN ROUGE BRAISE / NOIR ─── */
body.dark-mode .sticky-top,
body.dark-mode .container-fluid.sticky-top,
body.dark-mode .snu-navbar {
    background: #080808 !important;
    border-bottom: 2px solid var(--blaze-red) !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8), 0 1px 12px var(--blaze-glow) !important;
}

body.dark-mode .navbar-collapse {
    background: #0A0A0A !important;
    border: 1px solid var(--black-border) !important;
}

@media (max-width: 991.98px) {
    body.dark-mode .navbar-collapse {
        background: #0A0A0A !important;
        border-top: 2px solid var(--blaze-red) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95) !important;
    }
    body.dark-mode .navbar .navbar-nav .nav-link {
        border-bottom: 1px solid #1a1a1a !important;
        color: #EDEDED !important;
    }
}

/* Menu déroulant À propos en Mode Sombre */
body.dark-mode .navbar .dropdown-menu,
html[data-theme="dark"] .navbar .dropdown-menu {
    background: #161616 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85) !important;
}

body.dark-mode .navbar .dropdown-item,
html[data-theme="dark"] .navbar .dropdown-item {
    color: #e8e8e8 !important;
}

body.dark-mode .navbar .dropdown-item:hover,
body.dark-mode .navbar .dropdown-item.active,
html[data-theme="dark"] .navbar .dropdown-item:hover,
html[data-theme="dark"] .navbar .dropdown-item.active {
    background: #d10000 !important;
    color: #ffffff !important;
}

@media (max-width: 991.98px) {
    body.dark-mode .navbar .dropdown-menu,
    html[data-theme="dark"] .navbar .dropdown-menu {
        background: #101010 !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    body.dark-mode .navbar .dropdown-item,
    html[data-theme="dark"] .navbar .dropdown-item {
        color: #ffffff !important;
    }
}

/* Ajustements finaux mobile : logo et nom à gauche, hamburger à droite. */
.snu-navbar .navbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.snu-navbar .navbar-brand {
    min-width: 0;
    flex: 1 1 auto;
    margin-right: 8px;
    overflow: hidden;
}

.snu-navbar .navbar-brand > div {
    min-width: 0;
    overflow: hidden;
}

.snu-navbar .navbar-title,
.snu-navbar .navbar-brand .text-white-50 {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .navbar-toggler,
    .snu-navbar .navbar-toggler {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .navbar-toggler,
    .snu-navbar .navbar-toggler {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin-left: auto;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, .55) !important;
        border-radius: 8px;
        background: transparent;
        cursor: pointer;
    }
}

@media (max-width: 991.98px) {
    .snu-navbar .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        margin-top: 10px !important;
        padding: 10px !important;
    }

    .snu-navbar .navbar-nav {
        width: 100%;
        margin-left: 0 !important;
        align-items: stretch !important;
    }

    .snu-navbar .navbar-nav .nav-link,
    .snu-navbar .navbar-nav .theme-toggle-btn {
        width: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin-left: 0 !important;
    }
}

@media (max-width: 420px) {
    .snu-navbar .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .snu-navbar .navbar-brand img {
        width: 42px !important;
        height: 42px !important;
        margin-right: 8px !important;
    }

    .snu-navbar .navbar-title {
        font-size: 1rem !important;
        letter-spacing: 0 !important;
    }

    .snu-navbar .navbar-brand .text-white-50 {
        font-size: .58rem !important;
        letter-spacing: .5px !important;
    }

    .snu-navbar .navbar-toggler {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 340px) {
    .snu-navbar .navbar-brand .text-white-50 {
        display: none;
    }

    .snu-navbar .navbar-title {
        font-size: .94rem !important;
    }
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

/* Le mode sombre conserve une barre noire, y compris lorsque le menu est ouvert. */
html[data-theme="dark"] .snu-navbar,
html[data-theme="dark"] .snu-navbar .navbar-collapse,
html[data-theme="dark"] .snu-navbar .navbar,
html[data-theme="dark"] .snu-navbar > .container-fluid,
body.dark-mode .snu-navbar,
body.dark-mode .snu-navbar .navbar-collapse,
body.dark-mode .snu-navbar .navbar,
body.dark-mode .snu-navbar > .container-fluid {
    background: #000000 !important;
    background-image: none !important;
}

/* Sections .container-fluid.py-5 : largeur contenue et contenu lisible sur mobile. */
@media (max-width: 575.98px) {
    .container-fluid.py-5 {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .container-fluid.py-5 > .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .container-fluid.py-5 .row {
        width: 100%;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .container-fluid.py-5 .row > * {
        min-width: 0;
        max-width: 100%;
    }

    .container-fluid.py-5 h1,
    .container-fluid.py-5 h2,
    .container-fluid.py-5 h3,
    .container-fluid.py-5 h4,
    .container-fluid.py-5 h5,
    .container-fluid.py-5 h6,
    .container-fluid.py-5 p,
    .container-fluid.py-5 .small {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .container-fluid.py-5 .text-center {
        text-align: center !important;
    }

    .container-fluid.py-5 .service-card,
    .container-fluid.py-5 .formation-card,
    .container-fluid.py-5 .hero-feat-card,
    .container-fluid.py-5 .snu-team-card,
    .container-fluid.py-5 .testimonial-item {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    /* Accueil : chaque bloc reste contenu et centré sur petit téléphone. */
    .snu-about-section > .container,
    .snu-feature-section > .container,
    .snu-team-section > .container {
        text-align: center;
    }

    .snu-about-section .row,
    .snu-feature-section .row,
    .snu-team-section .row {
        justify-content: center !important;
        align-items: center;
    }

    .snu-about-section .row.g-2 > .col-6 {
        flex: 0 0 100%;
        width: 100%;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .snu-about-section .row.g-2 img {
        display: block;
        width: 100% !important;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    .snu-about-section .row.g-2 .bg-primary {
        width: 100%;
        min-height: 60px;
        height: auto !important;
        padding: 10px 12px !important;
        text-align: center !important;
        overflow-wrap: anywhere;
    }

    .snu-about-section .row.g-2 h4,
    .snu-about-section h1,
    .snu-about-section p,
    .snu-about-section h6,
    .snu-feature-section h1,
    .snu-feature-section h4,
    .snu-feature-section p,
    .snu-team-section h1,
    .snu-team-section p,
    .snu-team-section .snu-name,
    .snu-team-section .snu-role {
        width: 100%;
        max-width: 100%;
        text-align: center !important;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .snu-about-section .row.g-3 > [class*="col-"],
    .snu-feature-section .row > [class*="col-"],
    .snu-team-section .row > [class*="col-"] {
        width: 100%;
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .snu-about-section .d-flex.align-items-center.mt-5 {
        justify-content: center !important;
    }

    .snu-team-section .snu-team-card,
    .snu-team-section .snu-img-wrap,
    .snu-team-section .snu-info {
        width: 100%;
        max-width: 100%;
        text-align: center;
    }

    .snu-team-section .snu-img-wrap {
        height: 280px;
    }
}

/* L'équipe respecte aussi le thème sombre de la page d'accueil. */
body.dark-mode .snu-team-section,
body.dark-mode .snu-team-section .snu-team-card,
body.dark-mode .snu-team-section .snu-info {
    background: #000000 !important;
    color: #ffffff !important;
}

body.dark-mode .snu-team-section .snu-name,
body.dark-mode .snu-team-section h1,
body.dark-mode .snu-team-section p {
    color: #ffffff !important;
}

/* Navigation responsive : marque à gauche, hamburger à droite, menu centré. */
.snu-navbar .navbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.snu-navbar .navbar-brand {
    min-width: 0;
    flex: 1 1 auto;
    margin-right: 8px;
    overflow: hidden;
}

.snu-navbar .navbar-brand img {
    flex: 0 0 auto;
}

.snu-navbar .navbar-brand > div {
    min-width: 0;
    overflow: hidden;
}

.snu-navbar .navbar-title,
.snu-navbar .navbar-brand .text-white-50 {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .navbar-toggler,
    .snu-navbar .navbar-toggler {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .navbar-toggler,
    .snu-navbar .navbar-toggler {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin-left: auto;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, .5) !important;
        border-radius: 8px;
        background: transparent;
        cursor: pointer;
    }
}

@media (max-width: 991.98px) {
    .snu-navbar .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        margin-top: 10px !important;
        padding: 10px !important;
    }

    .snu-navbar .navbar-nav {
        width: 100%;
        margin-left: 0 !important;
        align-items: stretch !important;
    }

    .snu-navbar .navbar-nav .nav-link,
    .snu-navbar .navbar-nav .theme-toggle-btn {
        width: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin-left: 0 !important;
    }
}

@media (max-width: 420px) {
    .snu-navbar .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .snu-navbar .navbar-brand img {
        width: 42px !important;
        height: 42px !important;
        margin-right: 8px !important;
    }

    .snu-navbar .navbar-title {
        font-size: 1rem !important;
        letter-spacing: 0 !important;
    }

    .snu-navbar .navbar-brand .text-white-50 {
        font-size: .58rem !important;
        letter-spacing: .5px !important;
    }

    .snu-navbar .navbar-toggler {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 340px) {
    .snu-navbar .navbar-brand .text-white-50 {
        display: none;
    }

    .snu-navbar .navbar-title {
        font-size: .94rem !important;
    }
}

/* Évite les débordements horizontaux dans les sections et les formulaires. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

/* Demande SNU : navbar noire en mode sombre, sans rouge dans la barre. */
html[data-theme="dark"] .sticky-top,
html[data-theme="dark"] .container-fluid.sticky-top,
body.dark-mode .sticky-top,
body.dark-mode .container-fluid.sticky-top,
body.dark-mode .snu-navbar,
body.dark-mode .sticky-top .navbar-collapse {
    background: #000000 !important;
    background-image: none !important;
    border-bottom-color: rgba(255, 255, 255, .3) !important;
}

body.dark-mode .sticky-top .navbar-collapse {
    border-color: rgba(255, 255, 255, .22) !important;
}

body.dark-mode .sticky-top .navbar .navbar-nav .nav-link:hover,
body.dark-mode .sticky-top .navbar .navbar-nav .nav-link.active,
body.dark-mode .sticky-top .theme-toggle-btn:hover,
body.dark-mode .sticky-top .theme-toggle-btn:focus-visible {
    background: rgba(255, 255, 255, .12) !important;
    color: #ffffff !important;
    border-bottom-color: #ffffff !important;
}

/* Le fond conserve son image et son cadrage sur mobile sans débordement. */
@media (max-width: 767.98px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body.tech-bg {
        background-attachment: scroll !important;
        background-position: center top !important;
        background-size: cover !important;
        background-repeat: no-repeat !important;
    }
}

body.dark-mode .navbar .navbar-nav .nav-link {
    color: #D1D5DB !important;
}

body.dark-mode .navbar .navbar-nav .nav-link:hover,
body.dark-mode .navbar .navbar-nav .nav-link.active {
    color: #FFFFFF !important;
    border-bottom-color: var(--blaze-red-light) !important;
}

/* ─── 3. CARTES, PANNEAUX, SERVICES, ÉQUIPE EN NOIR PROFOND ─── */
body.dark-mode .service-card,
body.dark-mode .snu-team-card,
body.dark-mode .testimonial-item,
body.dark-mode .contact-link-card,
body.dark-mode .hero-feat-card,
body.dark-mode .tech-zone-card,
body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .form-panel {
    background-color: var(--black-card) !important;
    border: 1px solid var(--black-border) !important;
    color: #EDEDED !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85) !important;
}

body.dark-mode .service-card:hover,
body.dark-mode .contact-link-card:hover,
body.dark-mode .tech-zone-card:hover {
    background-color: var(--black-card-hover) !important;
    border-color: var(--blaze-red) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95), 0 0 15px var(--blaze-glow) !important;
}

/* ─── 4. TYPOGRAPHIE & COULEURS DU ROUGE BRAISE ─── */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #FFFFFF !important;
}

body.dark-mode p,
body.dark-mode span:not(.badge):not(.btn *):not(.text-primary):not(.text-danger) {
    color: #CCCCCC;
}

body.dark-mode .text-muted,
body.dark-mode .text-dark {
    color: #999999 !important;
}

/* Remplacement du rouge vif par le rouge braise sur les textes */
body.dark-mode .text-danger,
body.dark-mode .text-primary,
body.dark-mode .navbar-brand span {
    color: #FF3B3B !important;
    text-shadow: 0 0 10px rgba(255, 59, 59, 0.25);
}

/* ─── 5. BOUTONS EN ROUGE BRAISE (BLAZE RED) ─── */
body.dark-mode .btn-primary,
body.dark-mode .btn-danger,
body.dark-mode .btn-inscrire,
body.dark-mode .btn-save-master {
    background: linear-gradient(135deg, var(--blaze-red-light) 0%, var(--blaze-red-dark) 100%) !important;
    border: 1px solid var(--blaze-red-light) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 18px var(--blaze-glow) !important;
    font-weight: 700;
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-danger:hover,
body.dark-mode .btn-inscrire:hover,
body.dark-mode .btn-save-master:hover {
    background: linear-gradient(135deg, #D42626 0%, var(--blaze-red) 100%) !important;
    border-color: #FF4D4D !important;
    box-shadow: 0 6px 24px rgba(212, 38, 38, 0.6) !important;
    transform: translateY(-2px);
}

body.dark-mode .btn-outline-primary,
body.dark-mode .btn-outline-danger {
    border-color: var(--blaze-red) !important;
    color: #FF4D4D !important;
    background: transparent !important;
}

body.dark-mode .btn-outline-primary:hover,
body.dark-mode .btn-outline-danger:hover {
    background: var(--blaze-red) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px var(--blaze-glow) !important;
}

/* ─── 6. FORMULAIRES & INPUTS EN NOIR ABSOLU ─── */
body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background-color: var(--black-input) !important;
    border: 1px solid var(--black-border) !important;
    color: #FFFFFF !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #000000 !important;
    border-color: var(--blaze-red) !important;
    box-shadow: 0 0 0 0.25rem rgba(155, 17, 30, 0.35) !important;
    color: #FFFFFF !important;
}

body.dark-mode .form-control::placeholder {
    color: #555555 !important;
}

/* ─── 7. FOOTER EN VRAI NOIR AVEC ACCENTS BRAISE ─── */
body.dark-mode .footer,
body.dark-mode .bg-dark,
body.dark-mode footer {
    background-color: #030303 !important;
    border-top: 2px solid var(--blaze-red) !important;
}

body.dark-mode .footer .btn-square {
    background: #111111 !important;
    border: 1px solid var(--black-border) !important;
    color: #EDEDED !important;
}

body.dark-mode .footer .btn-square:hover {
    background: var(--blaze-red) !important;
    border-color: var(--blaze-red) !important;
    color: #FFFFFF !important;
}

/* ─── 8. ESPACE ADMINISTRATION EN VRAI NOIR & ROUGE BRAISE ─── */
body.admin-body.dark-mode {
    background: #000000 !important;
    color: #EDEDED !important;
}

body.admin-body.dark-mode .admin-header-bar {
    background: #080808 !important;
    border-bottom: 2px solid var(--blaze-red) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9), 0 1px 12px var(--blaze-glow) !important;
}

body.admin-body.dark-mode .admin-sidebar {
    background: var(--black-surface) !important;
    border-right: 1px solid var(--black-border) !important;
}

body.admin-body.dark-mode .sidebar-section-title {
    color: #FF4D4D !important;
}

body.admin-body.dark-mode .sidebar-section-title::after {
    background: rgba(255, 77, 77, 0.25) !important;
}

body.admin-body.dark-mode .nav-snu-link {
    color: #B0B0B0 !important;
}

body.admin-body.dark-mode .nav-snu-link:hover,
body.admin-body.dark-mode .nav-snu-link.active {
    background: linear-gradient(90deg, rgba(155, 17, 30, 0.35) 0%, rgba(155, 17, 30, 0.05) 100%) !important;
    color: #FFFFFF !important;
    border-left: 3px solid var(--blaze-red) !important;
}

body.admin-body.dark-mode .nav-snu-link i {
    color: #FF4D4D !important;
}

body.admin-body.dark-mode .admin-content-area {
    background: #000000 !important;
}

body.admin-body.dark-mode .admin-card {
    background: var(--black-card) !important;
    border: 1px solid var(--black-border) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9) !important;
}

body.admin-body.dark-mode .admin-card-header {
    border-bottom: 1px solid var(--black-border) !important;
    background: #0A0A0A !important;
}

body.admin-body.dark-mode .admin-card-title {
    color: #FFFFFF !important;
}

body.admin-body.dark-mode .snu-login-card {
    background: var(--black-card) !important;
    border: 1px solid var(--black-border) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 25px var(--blaze-glow) !important;
}

body.admin-body.dark-mode .snu-login-card::before {
    background: linear-gradient(90deg, var(--blaze-red-light), var(--blaze-red)) !important;
}

body.admin-body.dark-mode #loginOverlay::before {
    background: rgba(0, 0, 0, 0.94) !important;
}

body.admin-body.dark-mode .list-group-item {
    background-color: var(--black-card) !important;
    border-color: var(--black-border) !important;
    color: #EDEDED !important;
}

body.admin-body.dark-mode .table {
    color: #EDEDED !important;
    border-color: var(--black-border) !important;
}

body.admin-body.dark-mode .table td,
body.admin-body.dark-mode .table th {
    background-color: transparent !important;
    border-color: var(--black-border) !important;
    color: #EDEDED !important;
}

/* ─── 9. BOUTON TOGGLE THÈME HAUTE DÉFINITION ─── */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 24px;
    padding: 7px 16px;
    background: rgba(0, 0, 0, 0.35);
    color: #FFFFFF !important;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .theme-toggle-btn {
    border-color: var(--blaze-red);
    background: #111111;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 10px var(--blaze-glow);
}

body.dark-mode .theme-toggle-btn:hover {
    background: #1A1A1A;
    border-color: var(--blaze-red-light);
}

/* ══════════════════════════════════════════════════════════════
   SNU — Ajustement final du thème sombre du site public
   Palette sobre : texte blanc, surfaces anthracite et rouge bordeaux.
   Ces règles passent volontairement après Bootstrap et les styles inline
   afin que toutes les pages publiques restent cohérentes.
   ══════════════════════════════════════════════════════════════ */
:root {
    --snu-dark-bg: #111315;
    --snu-dark-surface: #191c20;
    --snu-dark-surface-alt: #20242a;
    --snu-dark-border: #343941;
    --snu-dark-text: #ffffff;
    --snu-dark-muted: #ffffff;
    --snu-soft-red: #b84d58;
    --snu-soft-red-dark: #8f3741;
    --snu-soft-red-wash: rgba(184, 77, 88, .16);
}

body.dark-mode,
body.dark-mode main {
    background-color: var(--snu-dark-bg) !important;
    color: var(--snu-dark-text) !important;
}

body.dark-mode::before,
body.dark-mode.tech-bg::before,
body.dark-mode .tech-bg::before {
    background: rgba(17, 19, 21, .94) !important;
}

/* Lisibilité : le contenu textuel reste blanc dans tout le site. */
body.dark-mode,
body.dark-mode p,
body.dark-mode li,
body.dark-mode label,
body.dark-mode small,
body.dark-mode strong,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .text-muted,
body.dark-mode .text-secondary,
body.dark-mode .text-dark,
body.dark-mode .text-body,
body.dark-mode .text-white-50,
body.dark-mode .form-label,
body.dark-mode .form-floating > label {
    color: var(--snu-dark-text) !important;
}

body.dark-mode a:not(.btn),
body.dark-mode .nav-link,
body.dark-mode .btn-link {
    color: var(--snu-dark-text) !important;
}

/* Surfaces claires forcées par Bootstrap ou par les pages HTML. */
body.dark-mode .bg-white,
body.dark-mode .bg-light,
body.dark-mode .modal-content,
body.dark-mode .modal-body,
body.dark-mode .modal-footer,
body.dark-mode .card,
body.dark-mode .hero-feat-card,
body.dark-mode .service-card,
body.dark-mode .formation-card,
body.dark-mode .snu-team-card,
body.dark-mode .testimonial-item,
body.dark-mode .contact-link-card,
body.dark-mode #registrationFichePrint,
body.dark-mode .alert-light {
    background-color: var(--snu-dark-surface) !important;
    color: var(--snu-dark-text) !important;
    border-color: var(--snu-dark-border) !important;
}

body.dark-mode .container-fluid:not(.sticky-top),
body.dark-mode .container,
body.dark-mode .hero-header {
    background-color: transparent !important;
}

body.dark-mode .service-card:hover,
body.dark-mode .formation-card:hover,
body.dark-mode .hero-feat-card:hover,
body.dark-mode .snu-team-card:hover,
body.dark-mode .contact-link-card:hover {
    background-color: var(--snu-dark-surface-alt) !important;
    border-color: var(--snu-soft-red) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28) !important;
}

/* Rouge plus doux : il sert d'accent, jamais de grande nappe agressive. */
body.dark-mode .text-primary,
body.dark-mode .text-danger,
body.dark-mode [style*="#d10000"],
body.dark-mode [style*="#D10000"],
body.dark-mode [style*="color: red"],
body.dark-mode [style*="color:red"] {
    color: var(--snu-soft-red) !important;
}

body.dark-mode .bg-primary,
body.dark-mode .bg-danger,
body.dark-mode .modal-header,
body.dark-mode .formation-badge {
    background: var(--snu-soft-red-dark) !important;
}

body.dark-mode .btn-primary,
body.dark-mode .btn-danger,
body.dark-mode .btn-inscrire,
body.dark-mode .cm-mic-btn {
    background: var(--snu-soft-red) !important;
    border-color: var(--snu-soft-red) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(184, 77, 88, .22) !important;
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-danger:hover,
body.dark-mode .btn-inscrire:hover,
body.dark-mode .cm-mic-btn:hover {
    background: #c15b65 !important;
    border-color: #c15b65 !important;
    box-shadow: 0 5px 16px rgba(184, 77, 88, .3) !important;
}

body.dark-mode .btn-outline-primary,
body.dark-mode .btn-outline-danger {
    color: #e18a92 !important;
    border-color: var(--snu-soft-red) !important;
}

body.dark-mode .btn-outline-primary:hover,
body.dark-mode .btn-outline-danger:hover {
    background: var(--snu-soft-red-wash) !important;
    color: #ffffff !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode textarea,
body.dark-mode input,
body.dark-mode select {
    background-color: #121417 !important;
    color: #ffffff !important;
    border-color: var(--snu-dark-border) !important;
}

body.dark-mode .form-control::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #d5d8dc !important;
    opacity: .8;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus,
body.dark-mode input:focus,
body.dark-mode textarea:focus {
    border-color: var(--snu-soft-red) !important;
    box-shadow: 0 0 0 .2rem rgba(184, 77, 88, .24) !important;
}

body.dark-mode .footer,
body.dark-mode footer,
body.dark-mode .bg-dark {
    background: #0d0f11 !important;
    color: #ffffff !important;
    border-top-color: var(--snu-dark-border) !important;
}

body.dark-mode .footer p,
body.dark-mode .footer a,
body.dark-mode .footer .text-white-50 {
    color: #ffffff !important;
}

body.dark-mode .testimonial-item {
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28) !important;
}

body.dark-mode .testimonial-text h3,
body.dark-mode .testimonial-text h5,
body.dark-mode .testimonial-text p,
body.dark-mode .testimonial-text span.text-primary {
    color: #ffffff !important;
}

body.dark-mode #claudiaSpeakModal,
body.dark-mode #claudiaSpeakModal .cm-bubble,
body.dark-mode #claudiaSpeakModal .cm-controls {
    background: var(--snu-dark-surface) !important;
    color: #ffffff !important;
    border-color: var(--snu-dark-border) !important;
}

body.dark-mode #claudiaSpeakModal .cm-bubble,
body.dark-mode #claudiaSpeakModal input {
    color: #ffffff !important;
}

body.dark-mode #claudiaSpeakModal .cm-hint,
body.dark-mode #claudiaSpeakModal .cmodal-body p {
    color: #ffffff !important;
}

body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom,
body.dark-mode .border-start,
body.dark-mode .border-end {
    border-color: var(--snu-dark-border) !important;
}

body.dark-mode .spinner-grow,
body.dark-mode .progress-bar {
    background-color: var(--snu-soft-red) !important;
}

/* Page Contact : ses composants ont leurs propres styles inline. */
body.dark-mode #snu-hero-contact {
    background: var(--snu-dark-bg) !important;
    color: #ffffff !important;
}

body.dark-mode #snu-hero-contact .snu-shape {
    background: var(--snu-soft-red) !important;
    opacity: .12 !important;
}

body.dark-mode #snu-hero-contact .snu-word--big {
    color: var(--snu-soft-red) !important;
}

body.dark-mode #snu-hero-contact .snu-word--sub,
body.dark-mode #snu-hero-contact .snu-row-label,
body.dark-mode #snu-hero-contact .snu-row-value,
body.dark-mode #snu-hero-contact .snu-row {
    color: #ffffff !important;
}

body.dark-mode #snu-hero-contact .snu-card {
    background: var(--snu-soft-red-dark) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .3) !important;
}

body.dark-mode #snu-hero-contact .snu-separator {
    background: rgba(255, 255, 255, .24) !important;
}

body.dark-mode #snu-hero-contact + .container-fluid,
body.dark-mode #snu-hero-contact ~ .container-fluid {
    color: #ffffff !important;
}

/* Le fond technologique reste visible et stable sur petits écrans. */
@media (max-width: 767.98px) {
    body.tech-bg {
        background-attachment: scroll !important;
        background-position: center top !important;
        background-size: cover !important;
    }

    body.dark-mode.tech-bg::before {
        background: rgba(17, 19, 21, .95) !important;
    }

    body.dark-mode .navbar-collapse {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.dark-mode #snu-hero-contact {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.dark-mode #snu-hero-contact .snu-card,
    body.dark-mode #snu-hero-contact .snu-row-value {
        max-width: 100%;
    }
}

body.dark-mode #spinner {
    background: var(--snu-dark-bg) !important;
}

@media (prefers-reduced-motion: reduce) {
    body.dark-mode *,
    body.dark-mode *::before,
    body.dark-mode *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   NAVIGATION UNIFIÉE — une seule teinte de rouge par thème
   Clair : rouge officiel SNU. Sombre : rouge bordeaux SNU.
   ══════════════════════════════════════════════════════════════ */
:root {
    --snu-light-red: #d10000;
    --snu-dark-red: #8f3741;
}

/* Mode clair : la barre et ses contrôles restent entièrement rouges. */
html[data-theme="light"] .sticky-top,
html[data-theme="light"] .container-fluid.sticky-top,
body:not(.dark-mode) .sticky-top,
body:not(.dark-mode) .container-fluid.sticky-top {
    background: var(--snu-light-red) !important;
    border-bottom-color: rgba(255, 255, 255, .35) !important;
}

html[data-theme="light"] .sticky-top .navbar-collapse,
body:not(.dark-mode) .sticky-top .navbar-collapse {
    background: var(--snu-light-red) !important;
}

/* Mode sombre : même structure, avec une seule teinte bordeaux. */
html[data-theme="dark"] .sticky-top,
html[data-theme="dark"] .container-fluid.sticky-top,
body.dark-mode .sticky-top,
body.dark-mode .container-fluid.sticky-top,
body.dark-mode .snu-navbar {
    background: #000000 !important;
    background-image: none !important;
    border-bottom-color: rgba(255, 255, 255, .35) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"] .sticky-top .navbar-collapse,
body.dark-mode .sticky-top .navbar-collapse {
    background: #000000 !important;
    border-color: rgba(255, 255, 255, .25) !important;
}

/* Navigation, marque et bouton de thème : texte blanc sur rouge. */
html[data-theme="light"] .sticky-top .navbar-brand,
html[data-theme="light"] .sticky-top .nav-link,
html[data-theme="light"] .sticky-top .theme-toggle-btn,
body:not(.dark-mode) .sticky-top .navbar-brand,
body:not(.dark-mode) .sticky-top .nav-link,
body:not(.dark-mode) .sticky-top .theme-toggle-btn,
html[data-theme="dark"] .sticky-top .navbar-brand,
html[data-theme="dark"] .sticky-top .nav-link,
html[data-theme="dark"] .sticky-top .theme-toggle-btn,
body.dark-mode .sticky-top .navbar-brand,
body.dark-mode .sticky-top .nav-link,
body.dark-mode .sticky-top .theme-toggle-btn {
    color: #ffffff !important;
}

.sticky-top .theme-toggle-btn {
    background: rgba(255, 255, 255, .12) !important;
    border-color: rgba(255, 255, 255, .75) !important;
    box-shadow: none !important;
}

.sticky-top .theme-toggle-btn:hover,
.sticky-top .theme-toggle-btn:focus-visible {
    background: rgba(255, 255, 255, .22) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

body.dark-mode .sticky-top .navbar .navbar-nav .nav-link:hover,
body.dark-mode .sticky-top .navbar .navbar-nav .nav-link.active,
body:not(.dark-mode) .sticky-top .navbar .navbar-nav .nav-link:hover,
body:not(.dark-mode) .sticky-top .navbar .navbar-nav .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .12) !important;
    border-bottom-color: #ffffff !important;
}

/* Le contenu des blocs de navigation reste blanc, y compris sur mobile. */
@media (max-width: 991.98px) {
    html[data-theme="light"] .sticky-top .navbar-collapse,
    body:not(.dark-mode) .sticky-top .navbar-collapse,
    html[data-theme="dark"] .sticky-top .navbar-collapse,
    body.dark-mode .sticky-top .navbar-collapse {
        background: var(--snu-light-red) !important;
    }

    html[data-theme="dark"] .sticky-top .navbar-collapse,
    body.dark-mode .sticky-top .navbar-collapse {
        background: #000000 !important;
    }

    .sticky-top .navbar-nav .nav-link,
    .sticky-top .navbar-nav .theme-toggle-btn {
        color: #ffffff !important;
    }
}

/* Priorité finale pour le menu mobile et le fond sombre. */
@media (max-width: 991.98px) {
    .snu-navbar .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
    }

    .snu-navbar .navbar-nav .nav-link,
    .snu-navbar .navbar-nav .theme-toggle-btn {
        width: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}

html[data-theme="dark"] .snu-navbar,
html[data-theme="dark"] .snu-navbar .navbar-collapse,
body.dark-mode .snu-navbar,
body.dark-mode .snu-navbar .navbar-collapse {
    background: #000000 !important;
    background-image: none !important;
}

/* ══════════════════════════════════════════════════════════════
   CLAUDIA SNU — GARANTIE ABSOLUE DE LISIBILITÉ EN MODE SOMBRE
   Tout ce qui est noir, sombre (#1a1a1a, #333, #555) en mode clair
   devient OBLIGATOIREMENT blanc pur (#ffffff) ou très clair en mode sombre.
   ══════════════════════════════════════════════════════════════ */
body.dark-mode,
body.dark-mode [style*="color: #1a1a1a"],
body.dark-mode [style*="color:#1a1a1a"],
body.dark-mode [style*="color: #333"],
body.dark-mode [style*="color:#333"],
body.dark-mode [style*="color: #555"],
body.dark-mode [style*="color:#555"],
body.dark-mode [style*="color: #000"],
body.dark-mode [style*="color:#000"],
body.dark-mode [style*="color: black"],
body.dark-mode [style*="color:#000000"],
body.dark-mode [style*="color: #000000"],
body.dark-mode [style*="color: #6c757d"],
body.dark-mode [style*="color:#6c757d"],
body.dark-mode [style*="color: rgb(26, 26, 26)"],
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode li,
body.dark-mode label,
body.dark-mode small,
body.dark-mode strong,
body.dark-mode b,
body.dark-mode .text-dark,
body.dark-mode .text-secondary,
body.dark-mode .lead,
body.dark-mode .modal-title,
body.dark-mode .modal-body,
body.dark-mode .modal-body p,
body.dark-mode .modal-body label,
body.dark-mode .modal-body h5,
body.dark-mode .modal-body h6,
body.dark-mode .modal-body span,
body.dark-mode .modal-body div,
body.dark-mode .modal-content,
body.dark-mode .card-title,
body.dark-mode .card-text,
body.dark-mode .hero-feat-card h5,
body.dark-mode .hero-feat-card p,
body.dark-mode .service-card h3,
body.dark-mode .service-card h4,
body.dark-mode .service-card h5,
body.dark-mode .service-card p,
body.dark-mode .formation-card h3,
body.dark-mode .formation-card h4,
body.dark-mode .formation-card h5,
body.dark-mode .formation-card p,
body.dark-mode .snu-team-card .snu-name,
body.dark-mode .snu-team-card .snu-role,
body.dark-mode .contrat-box,
body.dark-mode .contrat-article,
body.dark-mode .contrat-article p,
body.dark-mode .contrat-article li {
    color: #ffffff !important;
}

body.dark-mode .text-muted,
body.dark-mode small.text-muted {
    color: #d1d5db !important;
}

body.dark-mode .bg-light,
body.dark-mode .modal-body,
body.dark-mode .modal-content,
body.dark-mode .contrat-box {
    background-color: #0d0f12 !important;
    border-color: #272a30 !important;
}

body.dark-mode .contrat-badge {
    background: #9B111E !important;
    color: #ffffff !important;
}

/*
 * Les pages publiques utilisent parfois les classes Bootstrap bg-white/bg-light
 * directement dans le HTML. Ces règles finales gardent un vrai noir uniforme
 * dans le mode sombre et la texture technologique reste visible en mode clair.
 */
html[data-theme="light"] body.tech-bg {
    background-color: #eef2f5 !important;
    background-image: url('../img/tech_background.png') !important;
}

html[data-theme="light"] body.tech-bg::before {
    background: rgba(255, 255, 255, .78) !important;
}

html[data-theme="light"] body.tech-bg .bg-white,
html[data-theme="light"] body.tech-bg .bg-light {
    background-color: rgba(255, 255, 255, .80) !important;
}

body.dark-mode,
body.dark-mode main,
body.dark-mode .bg-secondary {
    background-color: #000000 !important;
}

/* Le décor technologique reste visible en sombre : seules les cartes métier
 * restent noires afin de garder une hiérarchie nette et une bonne lisibilité. */
body.dark-mode.tech-bg {
    background-color: #05070a !important;
    background-image:
        linear-gradient(rgba(0, 0, 0, .48), rgba(0, 0, 0, .72)),
        url('../img/tech_background.png') !important;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
}

body.dark-mode.tech-bg::before {
    background:
        linear-gradient(rgba(0, 0, 0, .18), rgba(0, 0, 0, .45)),
        repeating-linear-gradient(0deg, rgba(0, 180, 255, .055) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(90deg, rgba(0, 180, 255, .04) 0 1px, transparent 1px 42px) !important;
    opacity: 1 !important;
}

body.dark-mode main,
body.dark-mode .container-fluid.bg-white,
body.dark-mode .container-fluid.bg-light,
body.dark-mode .bg-white,
body.dark-mode .bg-light {
    background-color: rgba(0, 0, 0, .34) !important;
    background-image: none !important;
}

body.dark-mode .news-card,
body.dark-mode .contrat-box,
body.dark-mode .contrat-box > *,
body.dark-mode .spec-item,
body.dark-mode .service-card,
body.dark-mode .formation-card,
body.dark-mode .modal-content,
body.dark-mode .modal-body,
body.dark-mode .modal-footer,
body.dark-mode .form-panel {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #252525 !important;
}

body.dark-mode .news-card p,
body.dark-mode .news-card .text-muted,
body.dark-mode .contrat-box .text-muted,
body.dark-mode .spec-item p,
body.dark-mode .form-label,
body.dark-mode .form-check-label {
    color: #f1f1f1 !important;
}

body.dark-mode .news-card h3,
body.dark-mode .news-card h4,
body.dark-mode .news-card h5,
body.dark-mode .contrat-box h2,
body.dark-mode .contrat-box h3,
body.dark-mode .contrat-box h4,
body.dark-mode .contrat-box h5,
body.dark-mode .spec-item h4,
body.dark-mode .spec-item h5 {
    color: #ffffff !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode textarea {
    background-color: #050505 !important;
    color: #ffffff !important;
    border-color: #3a3a3a !important;
}

body.dark-mode .form-control::placeholder,
body.dark-mode textarea::placeholder {
    color: #a8a8a8 !important;
}

body.dark-mode .snu-team-card .snu-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000 !important;
}

.snu-team-card .snu-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
}

.snu-team-card .snu-img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

body.dark-mode .snu-team-card .snu-img-wrap {
    background: #000000 !important;
}

/* Base fluide : aucun composant ne doit imposer une largeur supérieure au
 * viewport, même sur un téléphone compact ou un écran pliable. */
html {
    overflow-x: hidden;
    text-size-adjust: 100%;
}

body,
main,
section,
.container,
.container-fluid,
.row,
[class*="col-"] {
    min-width: 0;
}

body {
    min-width: 320px;
    overflow-x: hidden;
}

img,
svg,
video,
iframe,
table {
    max-width: 100%;
}

iframe {
    width: 100%;
}

.container,
.container-fluid {
    width: 100%;
}

.row {
    --bs-gutter-x: clamp(1rem, 3vw, 3rem);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
button,
a {
    overflow-wrap: anywhere;
}

.modal-dialog {
    width: auto;
    max-width: calc(100% - 1rem);
    margin: .5rem auto;
}

.modal-content {
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
}

@media (max-width: 575.98px) {
    body {
        min-width: 0;
    }

    .container,
    .container-fluid {
        padding-left: clamp(12px, 4vw, 24px) !important;
        padding-right: clamp(12px, 4vw, 24px) !important;
    }

    .navbar-brand .navbar-title {
        font-size: clamp(.9rem, 4vw, 1.2rem) !important;
    }

    .navbar-brand > div {
        min-width: 0;
    }

    .navbar-brand img {
        width: clamp(38px, 12vw, 52px) !important;
        height: clamp(38px, 12vw, 52px) !important;
        margin-right: 8px !important;
    }

    .hero-header,
    .hero-header .container {
        padding-top: clamp(4rem, 16vw, 7rem) !important;
        padding-bottom: clamp(2rem, 8vw, 4rem) !important;
    }

    .modal-dialog {
        max-width: calc(100% - .75rem);
        margin: .375rem auto;
    }

    .modal-body {
        padding: clamp(1rem, 5vw, 2rem) !important;
    }

    .modal-header {
        padding-left: clamp(1rem, 4vw, 1.5rem) !important;
        padding-right: clamp(1rem, 4vw, 1.5rem) !important;
    }

    .module-request-modal .modal-header .fs-2 {
        font-size: 1.4rem !important;
    }

    .form-control,
    .form-select,
    .btn {
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.dark-mode.tech-bg {
        background-attachment: scroll;
    }
}

/* Typographie réellement fluide : les textes suivent la largeur disponible
 * sans être écrasés ni sortir des cartes, formulaires ou colonnes mobiles. */
body {
    font-size: clamp(.96rem, .25vw + .9rem, 1.08rem);
    line-height: 1.6;
}

/* Fond global proportionnel : cover remplit chaque format sans déformer
 * l'image technologique et sans dépendre d'une largeur fixe de téléphone. */
body.tech-bg {
    min-height: 100svh;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
    background-attachment: scroll !important;
}

body.tech-bg::before {
    min-height: 100svh;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

body.dark-mode.tech-bg {
    background-position: center center !important;
    background-size: cover !important;
    background-attachment: scroll !important;
}

@media (min-width: 768px) {
    body.tech-bg,
    body.tech-bg::before {
        background-attachment: fixed !important;
    }
}

@media (max-aspect-ratio: 3/5) {
    body.tech-bg,
    body.tech-bg::before {
        background-position: 50% 35% !important;
    }
}

@media (min-aspect-ratio: 16/9) {
    body.tech-bg,
    body.tech-bg::before {
        background-position: 50% 50% !important;
    }
}

main h1,
main .display-1,
main .display-2,
main .display-3,
main .display-4 {
    font-size: clamp(1.85rem, 6vw, 4.5rem) !important;
    line-height: 1.08 !important;
    letter-spacing: clamp(-.04em, -.1vw, -.015em);
    overflow-wrap: anywhere;
}

main h2 {
    font-size: clamp(1.55rem, 4.5vw, 2.6rem) !important;
    line-height: 1.15 !important;
}

main h3 {
    font-size: clamp(1.3rem, 3.8vw, 2rem) !important;
    line-height: 1.2 !important;
}

main h4,
main h5,
main h6 {
    line-height: 1.25 !important;
    overflow-wrap: anywhere;
}

main p,
main li,
main label,
main small,
main .lead,
main .form-text {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

main p:not(.small):not(.lead),
main li {
    font-size: clamp(.92rem, 1.1vw, 1.06rem) !important;
}

main h4,
main h5,
main h6 {
    font-size: clamp(1.05rem, 2.2vw, 1.5rem) !important;
}

main p,
main li {
    line-height: 1.65;
}

main .lead {
    font-size: clamp(1rem, 2.2vw, 1.25rem) !important;
}

main .btn,
main button,
main .form-control,
main .form-select {
    min-height: 42px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

main .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

main .row > * {
    min-width: 0;
}

/* Les légendes sous les images de l'accueil grandissent avec le texte :
 * aucune phrase ne doit être coupée lorsque le téléphone est étroit. */
.about-image-caption {
    width: 100%;
    min-height: 60px;
    height: auto !important;
    padding: .75rem clamp(.5rem, 2vw, 1rem) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.about-image-caption h4 {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    font-size: clamp(.78rem, 1.4vw, .98rem) !important;
    line-height: 1.35 !important;
    text-align: center !important;
    overflow-wrap: anywhere;
}

/* Repli visuel lorsque le bundle Bootstrap n'est pas disponible : le bouton
 * module reste utilisable et la fenêtre reste centrée au-dessus de la page. */
.module-request-modal.show {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(0, 0, 0, .68);
}

.module-request-modal.show .modal-dialog {
    min-height: calc(100% - 1rem);
    display: flex;
    align-items: center;
}

main .text-nowrap,
main [style*="white-space: nowrap"] {
    white-space: normal !important;
}

@media (max-width: 575.98px) {
    body {
        font-size: clamp(.9rem, 3.4vw, 1rem);
        line-height: 1.55;
    }

    main h1,
    main .display-1,
    main .display-2,
    main .display-3,
    main .display-4 {
        font-size: clamp(1.65rem, 9vw, 2.7rem) !important;
        line-height: 1.1 !important;
    }

    main h2 {
        font-size: clamp(1.4rem, 7vw, 2.1rem) !important;
    }

    main h3 {
        font-size: clamp(1.2rem, 6vw, 1.75rem) !important;
    }

    main h4,
    main h5,
    main h6 {
        font-size: clamp(1.05rem, 4.8vw, 1.4rem) !important;
    }

    main p,
    main li {
        line-height: 1.6;
    }

    main .small,
    main small {
        font-size: clamp(.78rem, 3.2vw, .92rem) !important;
    }

    main .btn,
    main button {
        width: 100%;
        min-height: 44px;
        padding: .7rem .85rem !important;
    }

    main .btn-square,
    main .btn-sm-square,
    main .btn-lg-square,
    main .navbar-toggler,
    main .theme-toggle-btn {
        width: auto;
    }

    main .form-label {
        font-size: .9rem !important;
        line-height: 1.35;
    }

    main .form-control,
    main .form-select {
        min-height: 44px;
        font-size: 1rem;
    }

    main .section-kicker {
        max-width: 100%;
        padding: 5px 10px;
        font-size: .68rem;
        line-height: 1.35;
        white-space: normal;
    }

    main .d-flex:not(.navbar):not(.btn):not(.btn-group) {
        min-width: 0;
        flex-wrap: wrap;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   FENÊTRE DÉTAIL DES SERVICES & ATOUTS ACCUEIL : OCCUPE 60% DE L'ÉCRAN
   ════════════════════════════════════════════════════════════════════════ */
#serviceDetailModal .modal-dialog,
#heroFeatModal .modal-dialog,
.service-modal-dialog,
.hero-feat-modal-dialog {
    margin: 1.75rem auto !important;
}

@media (min-width: 992px) {
    #serviceDetailModal .modal-dialog,
    #heroFeatModal .modal-dialog,
    .service-modal-dialog,
    .hero-feat-modal-dialog {
        width: 60vw !important;
        max-width: 60vw !important;
        min-width: 640px !important;
    }

    #serviceDetailModal #serviceModalImg,
    #heroFeatModal #heroFeatImg {
        max-height: 280px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    #serviceDetailModal .modal-dialog,
    #heroFeatModal .modal-dialog,
    .service-modal-dialog,
    .hero-feat-modal-dialog {
        width: 75vw !important;
        max-width: 75vw !important;
    }

    #serviceDetailModal #serviceModalImg,
    #heroFeatModal #heroFeatImg {
        max-height: 230px !important;
    }
}

@media (max-width: 767.98px) {
    #serviceDetailModal .modal-dialog,
    #heroFeatModal .modal-dialog,
    .service-modal-dialog,
    .hero-feat-modal-dialog {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: 0.5rem auto !important;
    }

    #serviceDetailModal #serviceModalImg,
    #heroFeatModal #heroFeatImg {
        max-height: 180px !important;
    }
}
