/* ==========================================================================
   Cartographie des réformes — full-width blue hero band
   ========================================================================== */

#cartographie {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F8FAFC;
    color: #10233F;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cartographie-hero {
    background: linear-gradient(135deg, #1e5f8e 0%, #164c7a 100%);
    padding: 64px 0 72px;
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.cartographie-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.cartographie-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: debtFloat 10s ease-in-out infinite reverse;
}

@keyframes debtFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.cartographie-hero__breadcrumb {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.cartographie-hero__breadcrumb .breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cartographie-hero__breadcrumb .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.cartographie-hero__breadcrumb .breadcrumb-item a:hover {
    color: #FFFFFF;
}

.cartographie-hero__breadcrumb .breadcrumb-separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
}

.cartographie-hero__breadcrumb .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    font-weight: 600;
}

.cartographie-hero__title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1.2;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    color: #FFFFFF;
    position: relative;
}

.cartographie-hero__subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 720px;
    line-height: 1.7;
    font-weight: 400;
    margin: 0;
    position: relative;
}

.cartographie-wrapper {
    padding: 48px 0 64px;
}

/* ==========================================================================
   Barre de filtres horizontale — carte élégante, dégradé discret,
   champs identifiés par icône, plutôt qu'une simple rangée de <select>.
   ========================================================================== */
.filters-bar__carte {
    border-radius: 18px;
    border: 1px solid #E5E7EB;
    background:
        linear-gradient(180deg, #FFFFFF 0%, #FBFCFE 100%);
    box-shadow: 0 4px 16px rgba(16, 35, 63, 0.05), 0 1px 2px rgba(16, 35, 63, 0.04);
    padding: 22px 26px 24px;
}

.filters-bar__entete {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #10233F;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #EEF1F6;
}

.filters-bar__entete i {
    color: #1e5f8e;
    font-size: 0.95rem;
}

.filters-bar__grille {
    display: grid;
    grid-template-columns: repeat(5, 1fr) auto;
    gap: 16px;
    align-items: end;
}

.filters-bar__champ label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    margin-bottom: 8px;
}

.filters-bar__champ label i {
    color: #1e5f8e;
    font-size: 0.78rem;
    width: 14px;
    text-align: center;
}

.filters-bar__select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    padding: 11px 34px 11px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #10233F;
    background: #F9FAFB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236B7280' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 14px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.filters-bar__select:hover {
    border-color: #C7D2DD;
}

.filters-bar__select:focus {
    outline: none;
    border-color: #1e5f8e;
    box-shadow: 0 0 0 3px rgba(30, 95, 142, 0.12);
    background-color: #FFFFFF;
}

.filters-bar__champ--action {
    display: flex;
}

.filters-bar__reset {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #4B5563;
    border-radius: 10px;
    padding: 11px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filters-bar__reset:hover {
    background: #FEF2F2;
    border-color: rgba(220, 38, 38, 0.3);
    color: #DC2626;
}

@media (max-width: 991px) {
    .filters-bar__grille {
        grid-template-columns: repeat(2, 1fr);
    }
    .filters-bar__champ--action {
        grid-column: span 2;
    }
}

@media (max-width: 576px) {
    .filters-bar__grille {
        grid-template-columns: 1fr;
    }
    .filters-bar__champ--action {
        grid-column: span 1;
    }
}

/* ==========================================================================
   Cartes statistiques — pastille dégradée + chiffre, dans le même langage
   visuel que les cartes "Chiffres clés" de la page d'accueil.
   ========================================================================== */
.stat-carte {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFE 100%);
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(16, 35, 63, 0.05);
    transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s ease;
}

.stat-carte:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(16, 35, 63, 0.10);
}

.stat-carte__icone {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #FFFFFF;
}

.stat-carte--bleu .stat-carte__icone { background: linear-gradient(135deg, #1e5f8e, #164c7a); }
.stat-carte--teal .stat-carte__icone { background: linear-gradient(135deg, #0F9B6E, #0b7a56); }
.stat-carte--or   .stat-carte__icone { background: linear-gradient(135deg, #D4AF37, #b8860b); }
.stat-carte--rouge .stat-carte__icone { background: linear-gradient(135deg, #DC2626, #b91a22); }

.stat-carte__corps h6 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    margin: 0 0 4px;
}

.stat-carte__corps h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #10233F;
    letter-spacing: -0.01em;
    margin: 0;
}

/* ==========================================================================
   Panneau carte du Togo
   ========================================================================== */
#cartographie .card {
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

#cartographie .card:hover {
    box-shadow: 0 8px 24px rgba(16, 35, 63, 0.08);
}

#cartographie .table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6B7280;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    padding: 14px 16px;
    white-space: nowrap;
}

#cartographie .table tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #374151;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
}

#cartographie .table tbody tr {
    transition: background 0.15s ease;
}

#cartographie .table tbody tr:hover {
    background: #FAFBFC;
}

/* ==========================================================================
   REFONTE — Carte du Togo en SVG vectoriel "futuriste"
   ========================================================================== */
#cartographie {
    --carto-bg-1: #060d1a;
    --carto-bg-2: #0f2544;
    --carto-accent: #2e90d9;
    --carto-accent-clair: #7fccff;
    --carto-gold: #d4af37;
    --carto-line: rgba(127, 204, 255, 0.16);
}

.carto-panel {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(46, 144, 217, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 85% 88%, rgba(212, 175, 55, 0.10) 0%, transparent 40%),
        linear-gradient(160deg, var(--carto-bg-1) 0%, var(--carto-bg-2) 100%);
    box-shadow: 0 24px 60px rgba(6, 13, 26, 0.35);
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

/* Grille technique en fond */
.carto-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--carto-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--carto-line) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at 50% 45%, #000 55%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 55%, transparent 90%);
    pointer-events: none;
}

/* Balayage lumineux discret */
.carto-panel::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -30%;
    width: 60%;
    height: 140%;
    background: linear-gradient(100deg, transparent 40%, rgba(127, 204, 255, 0.06) 50%, transparent 60%);
    animation: carto-balayage 9s ease-in-out infinite;
    pointer-events: none;
}

@keyframes carto-balayage {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(220%); }
}

.carto-panel__header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 22px 26px 0;
}

.carto-panel__titre {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #FFFFFF;
    margin: 0 0 4px;
}

.carto-panel__sous-titre {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    margin: 0;
}

.carto-panel__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(127, 204, 255, 0.12);
    border: 1px solid rgba(127, 204, 255, 0.3);
    color: var(--carto-accent-clair);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.carto-panel__badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--carto-accent-clair);
    box-shadow: 0 0 8px 2px var(--carto-accent-clair);
    animation: carto-blink 1.8s ease-in-out infinite;
}

@keyframes carto-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.carto-panel__corps {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    padding: 24px 24px 16px;
}

.carto-svg-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG : on interdit l'étirement vertical */
#togo-svg-map,
.carto-svg-wrapper svg {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    display: block;
}

/* Régions : état par défaut, survol, sélection.
   --intensite (0 à 1, posée en JS selon le volume de données de la région
   par rapport à la région la plus active) fait varier la saturation du
   remplissage : plus une région a de programmes, plus elle "s'allume" —
   c'est ce qui rend la carte réactive aux filtres plutôt qu'un simple
   allumé/éteint. */
.togo-region {
    fill: rgba(46, 144, 217, calc(0.14 + var(--intensite, 0.35) * 0.5));
    stroke: url(#togo-outline-gradient);
    stroke-width: 1.4;
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill 0.4s ease, stroke-width 0.25s ease, filter 0.25s ease;
}

.togo-region:hover {
    fill: rgba(127, 204, 255, 0.42);
    filter: drop-shadow(0 0 10px rgba(127, 204, 255, 0.45));
}

.togo-region.est-vide {
    fill: rgba(148, 163, 184, 0.12);
}

.togo-region.est-survolee {
    fill: rgba(212, 175, 55, 0.20);
    stroke: var(--carto-gold);
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4));
}

.togo-region.est-selectionnee {
    fill: rgba(212, 175, 55, 0.30);
    stroke: var(--carto-gold);
    stroke-width: 2.4;
    filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.55));
}

.togo-selection-marker {
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(.2,.8,.2,1);
}

.togo-selection-marker__pulse {
    animation: carto-pulse 2.2s ease-out infinite;
    transform-origin: center;
}

.togo-selection-marker__anneau {
    animation: carto-anneau 2.2s ease-out infinite;
    transform-origin: center;
}

@keyframes carto-pulse {
    0%   { transform: scale(0.4); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

@keyframes carto-anneau {
    0%, 100% { r: 7; }
    50% { r: 9; }
}

/* Marqueurs de localités (points de programmes) */
.togo-localite {
    fill: var(--carto-accent-clair);
    stroke: #061224;
    stroke-width: 1;
    cursor: pointer;
    transition: r 0.15s ease, fill 0.15s ease;
}

.togo-localite:hover {
    fill: var(--carto-gold);
}

.togo-localite__label {
    fill: rgba(255, 255, 255, 0.75);
    font-size: 8px;
    font-family: 'Poppins', sans-serif;
    pointer-events: none;
}

/* Légende, sous la carte */
.carto-legende {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 26px 22px;
}

.carto-legende__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
}

.carto-legende__puce {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* Info-bulle personnalisée (remplace les popups Leaflet) */
.carto-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 220px;
    max-width: 280px;
    background: rgba(10, 20, 38, 0.96);
    border: 1px solid rgba(127, 204, 255, 0.25);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    padding: 16px 18px;
    color: #FFFFFF;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.carto-tooltip.est-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Panneau "Synthèse & comparaison des régions"
   ========================================================================== */
.synthese-carte {
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFE 100%);
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(16, 35, 63, 0.05);
    padding: 22px 24px;
}

.synthese-carte h6 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #10233F;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #EEF1F6;
}

.synthese-carte h6 i {
    color: #1e5f8e;
}

.synthese-resume {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.synthese-resume li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 0.88rem;
    color: #4B5563;
}

.synthese-resume li:last-child {
    border-bottom: none;
}

.synthese-resume strong {
    color: #10233F;
    font-weight: 700;
}

/* Comparaison entre régions : mini barres horizontales, une paire
   (physique / financier) par région, dans les mêmes couleurs sémantiques
   que la section "Chiffres clés" de la page d'accueil. */
.comparaison-regions__titre {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6B7280;
    margin: 0 0 14px;
}

.comparaison-regions__legende {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.comparaison-regions__legende span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6B7280;
}

.comparaison-regions__legende span::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.comparaison-regions__legende span.legende-physique::before { background: #0F766E; }
.comparaison-regions__legende span.legende-financier::before { background: #7C3AED; }

.comparaison-region {
    margin-bottom: 14px;
    cursor: pointer;
    border-radius: 10px;
    padding: 8px;
    margin-left: -8px;
    margin-right: -8px;
    transition: background 0.2s ease;
}

.comparaison-region:hover,
.comparaison-region.est-survolee {
    background: #F5F8FB;
}

.comparaison-region:last-child {
    margin-bottom: 0;
}

.comparaison-region__entete {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.comparaison-region__nom {
    font-size: 0.85rem;
    font-weight: 700;
    color: #10233F;
}

.comparaison-region__nombre {
    font-size: 0.72rem;
    color: #9CA3AF;
    font-weight: 600;
}

.comparaison-region__barre {
    height: 7px;
    border-radius: 999px;
    background: #EEF1F6;
    overflow: hidden;
    margin-bottom: 4px;
    position: relative;
}

.comparaison-region__remplissage {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}

.comparaison-region__barre--physique .comparaison-region__remplissage { background: linear-gradient(90deg, #0F766E, #14b892); }
.comparaison-region__barre--financier .comparaison-region__remplissage { background: linear-gradient(90deg, #7C3AED, #a378f2); }

.carto-tooltip h4 {
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--carto-accent-clair);
}

.carto-tooltip p {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
}

.carto-tooltip p strong {
    color: #FFFFFF;
}

@media (max-width: 991px) {
    .cartographie-hero {
        padding: 48px 0 56px;
    }

    .cartographie-hero__title {
        font-size: 1.8rem;
    }

    .cartographie-wrapper {
        padding: 32px 0 48px;
    }

    .carto-panel { min-height: auto; }
    #togo-svg-map { max-width: 280px; }
    .carto-panel__corps { padding: 16px; }
}

/* Téléphone : indicateurs en grille 2 × 2, icône au-dessus du chiffre */
@media (max-width: 767.98px) {
    .stat-carte {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
    }

    .stat-carte__icone {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: .95rem;
    }

    .stat-carte__corps h6 {
        font-size: .64rem;
        line-height: 1.35;
    }

    .stat-carte__corps h3 {
        font-size: 1.35rem;
    }

    .stat-carte:hover {
        transform: none;
    }
}
