/* ============================================================
   BDOM Bukavu — Couche de présentation partagée
   Chargée après responsive.css : harmonise les pages publiques
   (en-têtes, sections, cartes, boutons, couleurs de marque).
   ============================================================ */

:root {
    color-scheme: light;

    /* Palette de marque (déclinaisons du vert institutionnel) */
    --brand-900: #013a20;
    --brand-800: #004f28;
    --brand-700: #006400;
    --brand-600: #0a7a3c;
    --brand-050: #eef5f0;
    --accent: #cc0000;
    --accent-600: #a30000;

    /* Texte et surfaces */
    --ink-900: #1b2a21;
    --ink-700: #3f4d45;
    --ink-500: #6c7a72;
    --surface: #ffffff;
    --surface-muted: #f6f8f6;
    --line: #e4e9e5;

    /* Rayons et ombres */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-pill: 999px;
    --sh-sm: 0 1px 2px rgba(16, 32, 24, .06), 0 1px 3px rgba(16, 32, 24, .05);
    --sh-md: 0 4px 12px rgba(16, 32, 24, .07), 0 2px 4px rgba(16, 32, 24, .04);
    --sh-lg: 0 14px 34px rgba(16, 32, 24, .10), 0 4px 10px rgba(16, 32, 24, .05);
}

/* ============================================================
   1. Compatibilité Bootstrap 5 -> Bootstrap 4.6
   Les vues utilisent des utilitaires BS5 (me-*, fw-bold, gap-*,
   opacity-*...) absents de la version chargée : sans ces règles
   les icônes restent collées au texte et les titres ne sont pas gras.
   ============================================================ */

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.ms-5 { margin-left: 3rem !important; }
.ms-auto { margin-left: auto !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.me-5 { margin-right: 3rem !important; }
.me-auto { margin-right: auto !important; }

.ps-0 { padding-left: 0 !important; }
.ps-1 { padding-left: .25rem !important; }
.ps-2 { padding-left: .5rem !important; }
.ps-3 { padding-left: 1rem !important; }
.ps-4 { padding-left: 1.5rem !important; }
.ps-5 { padding-left: 3rem !important; }

.pe-0 { padding-right: 0 !important; }
.pe-1 { padding-right: .25rem !important; }
.pe-2 { padding-right: .5rem !important; }
.pe-3 { padding-right: 1rem !important; }
.pe-4 { padding-right: 1.5rem !important; }
.pe-5 { padding-right: 3rem !important; }

.fw-light { font-weight: 300 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fw-bolder { font-weight: 800 !important; }

.fs-1 { font-size: 2.5rem !important; }
.fs-2 { font-size: 2rem !important; }
.fs-3 { font-size: 1.75rem !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

.opacity-0 { opacity: 0 !important; }
.opacity-10 { opacity: .1 !important; }
.opacity-25 { opacity: .25 !important; }
.opacity-50 { opacity: .5 !important; }
.opacity-75 { opacity: .75 !important; }
.opacity-100 { opacity: 1 !important; }

.gap-0 { gap: 0 !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

.text-start { text-align: left !important; }
.text-end { text-align: right !important; }

.d-grid { display: grid !important; }
.d-grid > .btn { width: 100%; }

/* Gouttières BS5 (.g-*) : espacement vertical des colonnes */
.row.g-3 > [class*="col"] { padding-top: .5rem; padding-bottom: .5rem; }
.row.g-4 > [class*="col"] { padding-top: .75rem; padding-bottom: .75rem; }
.row.g-0 { margin-right: 0; margin-left: 0; }
.row.g-0 > [class*="col"] { padding-right: 0; padding-left: 0; }

/* Fonds translucides façon BS5 */
.bg-primary.bg-opacity-10 { background-color: rgba(0, 100, 0, .10) !important; }
.bg-secondary.bg-opacity-10 { background-color: rgba(204, 0, 0, .10) !important; }
.bg-success.bg-opacity-10 { background-color: rgba(10, 122, 60, .10) !important; }
.bg-danger.bg-opacity-10 { background-color: rgba(204, 0, 0, .10) !important; }
.bg-warning.bg-opacity-10 { background-color: rgba(224, 152, 0, .12) !important; }
.bg-info.bg-opacity-10 { background-color: rgba(10, 122, 60, .10) !important; }
.bg-white.bg-opacity-10 { background-color: rgba(255, 255, 255, .12) !important; }

/* Bouton de fermeture BS5 */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    opacity: .5;
    cursor: pointer;
}
.btn-close:hover { opacity: .85; }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* Select BS5 */
.form-select {
    display: block;
    width: 100%;
    padding: .55rem 2.25rem .55rem .9rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink-900);
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c7a72' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") right .8rem center/14px 10px no-repeat;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    appearance: none;
    -webkit-appearance: none;
}

/* ============================================================
   2. Couleurs de marque à la place du bleu Bootstrap
   ============================================================ */

.bg-primary { background-color: var(--brand-700) !important; }
.bg-info { background-color: var(--brand-600) !important; }
.text-primary { color: var(--brand-700) !important; }
.text-info { color: var(--brand-600) !important; }
.border-primary { border-color: var(--brand-700) !important; }
.badge-primary, .badge.bg-primary { background-color: var(--brand-700) !important; color: #fff !important; }
.badge-info, .badge.bg-info { background-color: var(--brand-600) !important; color: #fff !important; }
.page-item.active .page-link { background-color: var(--brand-700); border-color: var(--brand-700); }
.page-link { color: var(--brand-700); }
.list-group-item.active { background-color: var(--brand-700); border-color: var(--brand-700); }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--brand-700); border-color: var(--brand-700); }
.progress-bar { background-color: var(--brand-700); }
.spinner-border.text-primary { color: var(--brand-700) !important; }

.btn-primary {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--brand-800);
    border-color: var(--brand-800);
}
.btn-outline-primary {
    color: var(--brand-700);
    border-color: var(--brand-700);
}
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
    color: #fff;
}
.btn-primary:focus,
.btn-outline-primary:focus,
.btn-primary.focus {
    box-shadow: 0 0 0 .2rem rgba(0, 100, 0, .25);
}

/* ============================================================
   3. En-tête de page unifié (.page-hero / .page-header)
   ============================================================ */

.page-hero,
.page-header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(2.75rem, 6vw, 4.75rem) 0 clamp(3.5rem, 7vw, 5.5rem);
    background: linear-gradient(125deg, var(--brand-900) 0%, var(--brand-800) 42%, var(--brand-600) 100%);
    color: #fff;
    border-bottom: 4px solid var(--accent);
}

/* Halo lumineux discret, à la place des aplats bruts */
.page-hero::before,
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 120% at 85% 0%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 60%),
        radial-gradient(45% 90% at 8% 100%, rgba(204, 0, 0, .22) 0%, rgba(204, 0, 0, 0) 65%);
    pointer-events: none;
}

/* Neutralise les voiles sombres définis page par page */
.page-hero::after,
.page-header::after {
    background: none !important;
}

/* Les fonds posés en ligne ou via les utilitaires ne priment plus */
.page-hero[style*="background"],
.page-header[style*="background"] {
    background-image: linear-gradient(125deg, var(--brand-900) 0%, var(--brand-800) 42%, var(--brand-600) 100%) !important;
}
.page-header.bg-primary,
.page-header.bg-dark,
.page-header.bg-success,
.page-hero.bg-primary {
    background-color: transparent !important;
}

/* Variante avec photo : l'image passe sous le degrade de marque */
.page-hero--media,
.page-header--media {
    background-image:
        linear-gradient(125deg, rgba(1, 58, 32, .88) 0%, rgba(0, 79, 40, .80) 45%, rgba(10, 122, 60, .70) 100%),
        var(--hero-image);
    background-size: cover, cover;
    background-position: center, center;
}

.page-hero .container,
.page-header .container {
    position: relative;
    z-index: 3;
}

.page-hero h1,
.page-header h1 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.01em;
    margin-bottom: .75rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.page-hero .lead,
.page-header .lead,
.page-hero > .container p,
.page-header > .container p {
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, .88);
    max-width: 46rem;
    margin-bottom: 0;
}

/* Centrage uniquement pour les en-tetes centres */
.page-hero .text-center .lead,
.page-header .text-center .lead,
.page-hero .text-center > p,
.page-header .text-center > p {
    margin-left: auto;
    margin-right: auto;
}

/* Fil d'Ariane */
.page-hero .breadcrumb,
.page-header .breadcrumb {
    display: inline-flex;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--r-pill);
    padding: .4rem 1rem !important;
    margin-bottom: 0;
    font-size: .85rem;
    letter-spacing: .01em;
}
.page-hero .breadcrumb-item a,
.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, .78) !important;
    text-decoration: none;
    transition: color .2s ease;
}
.page-hero .breadcrumb-item a:hover,
.page-header .breadcrumb-item a:hover { color: #fff !important; }
.page-hero .breadcrumb-item.active,
.page-header .breadcrumb-item.active { color: #fff !important; font-weight: 500; }
.page-hero .breadcrumb-item + .breadcrumb-item::before,
.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, .45);
    content: "\203A";
}

/* Vague de bas de section : conservée mais nettement adoucie */
.wave-bottom {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}
.wave-bottom svg {
    display: block;
    width: 100%;
    height: auto;
    transform: scaleY(.45);
    transform-origin: bottom center;
}

/* ============================================================
   4. Rythme des sections et titres
   ============================================================ */

.section {
    padding-top: clamp(2.5rem, 5vw, 4.25rem);
    padding-bottom: clamp(2.5rem, 5vw, 4.25rem);
}

.section-header { margin-bottom: 2.5rem; }

.section-title {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: clamp(1.5rem, 2.6vw, 2.125rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--brand-800);
    letter-spacing: -.01em;
    margin-bottom: 1rem;
}

/* Une seule décoration sous le titre : le trait explicite l'emporte */
.section-header .section-title::after,
.text-center > .section-title::after {
    display: none;
}

/* Trait d'accent : aligne sur le titre, centre uniquement avec .mx-auto */
.title-underline {
    height: 3px;
    width: 64px;
    background: linear-gradient(90deg, var(--brand-700), var(--accent));
    border-radius: var(--r-pill);
    margin: 0 0 1.25rem;
}
.text-center > .title-underline,
.title-underline.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.section-text,
.section-header p {
    color: var(--ink-700);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 46rem;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   5. Cartes, boutons, formulaires
   ============================================================ */

.card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { box-shadow: var(--sh-md); }
.card.shadow-sm { box-shadow: var(--sh-sm) !important; }
.card-header {
    background-color: var(--surface-muted);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.card-header.bg-primary { background-color: var(--brand-700) !important; border-bottom-color: var(--brand-800); }
.card-body { padding: 1.5rem; }
.card-title { font-weight: 600; color: var(--ink-900); }

.btn {
    border-radius: var(--r-sm);
    font-weight: 600;
    letter-spacing: .01em;
    padding: .6rem 1.35rem;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: .35rem .85rem; }
.btn-lg { padding: .85rem 1.9rem; }

.form-control {
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: .55rem .9rem;
    color: var(--ink-900);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 .2rem rgba(0, 100, 0, .15);
}

.badge { font-weight: 600; letter-spacing: .02em; border-radius: var(--r-pill); padding: .35em .75em; }

.table thead th {
    background-color: var(--surface-muted);
    border-bottom: 2px solid var(--line);
    color: var(--ink-700);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .04em;
}

/* Encadre d'appel a l'action (presentation, impact) */
.cta-box {
    background: linear-gradient(125deg, var(--brand-800) 0%, var(--brand-600) 100%) !important;
    border-radius: var(--r-lg);
    color: #fff;
}
.cta-box .btn-light { color: var(--brand-800); font-weight: 600; }

/* Bandeau d'appel à l'action en bas de page */
.cta-section,
section.bg-primary {
    background: linear-gradient(125deg, var(--brand-800) 0%, var(--brand-600) 100%) !important;
    color: #fff;
}
section.bg-primary .btn-light {
    color: var(--brand-800);
    font-weight: 600;
}

/* Accessibilité : cible de focus visible et cohérente */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .6);
    outline-offset: 2px;
}
.section a:focus-visible,
.card a:focus-visible {
    outline-color: var(--brand-600);
}

/* ============================================================
   6. Adaptations mobiles et impression
   ============================================================ */

@media (max-width: 767.98px) {
    .page-hero,
    .page-header { padding: 2.25rem 0 3rem; }
    .page-hero .breadcrumb,
    .page-header .breadcrumb { font-size: .78rem; padding: .3rem .8rem !important; }
    .card-body { padding: 1.15rem; }
    .wave-bottom svg { transform: scaleY(.3); }
}

@media print {
    .page-hero,
    .page-header {
        background: none !important;
        color: #000 !important;
        border-bottom: 1px solid #000;
    }
    .page-hero h1,
    .page-header h1 { color: #000 !important; text-shadow: none; }
    .wave-bottom { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .btn:hover,
    .card:hover { transform: none; }
}
