/**
 * assets/css/frontend/reseau.css — Cartographie & Maillage Territorial COOPPÈRE v3.0
 * Modèle institutionnel sobre (#1b4332 vert forêt profond, #b59449 or institutionnel, #fdfcf9 papier chaud)
 */
:root {
    --rs-green: #1b4332;
    --rs-green-mid: #2d6a4f;
    --rs-green-soft: #e9f2ec;
    --rs-gold: #b59449;
    --rs-gold-soft: #f9f4e8;
    --rs-dark: #1f2933;
    --rs-muted: #52606d;
    --rs-border: #e2dec9;
    --rs-surface: #ffffff;
    --rs-bg: #f7f5ef;
}

body.page-reseau {
    padding-top: 0;
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--rs-bg);
    color: var(--rs-dark);
    min-height: 100vh;
}

.page-reseau .background-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.035;
    z-index: -1;
    pointer-events: none;
    background: url("../../../logo-cooppere-text.png") center / contain no-repeat;
    width: 90vw;
    height: 90vh;
    max-width: 1100px;
    max-height: 750px;
}

.page-reseau .main-content {
    max-width: 1220px;
    margin: 0 auto;
    padding: 6.2rem 1.5rem 4rem;
}

/* ==================== HERO & COMPTEURS ==================== */
.reseau-hero {
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-top: 4px solid var(--rs-green);
    border-radius: 12px;
    padding: 2.2rem 2rem 1.8rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 6px 22px rgba(27, 67, 50, 0.05);
    text-align: center;
}

.reseau-hero__eyebrow {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rs-gold);
    margin-bottom: 0.5rem;
}

.page-reseau .hero-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--rs-green);
    margin: 0 0 0.6rem;
}

.page-reseau .hero-subtitle {
    color: var(--rs-muted);
    font-size: 0.98rem;
    line-height: 1.6;
    max-width: 820px;
    margin: 0 auto 1.5rem;
}

.page-reseau .hero-subtitle a {
    color: var(--rs-green);
    font-weight: 600;
    text-decoration: underline;
}

.reseau-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.25rem 0 1.4rem;
    padding: 1.1rem 0;
    border-top: 1px solid #eeeadd;
    border-bottom: 1px solid #eeeadd;
}

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

.reseau-kpi__value {
    display: block;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--rs-green);
}

.reseau-kpi__label {
    font-size: 0.8rem;
    color: var(--rs-muted);
    font-weight: 500;
}

.reseau-quickbar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rq-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.rq-btn--primary {
    background: var(--rs-green);
    color: #fff;
}

.rq-btn--primary:hover {
    background: #143325;
}

.rq-btn--outline {
    background: #fff;
    color: var(--rs-green);
    border-color: var(--rs-green);
}

.rq-btn--outline:hover {
    background: var(--rs-green-soft);
}

.rq-btn--admin {
    background: var(--rs-gold-soft);
    color: #7c5e1e;
    border-color: #dec68b;
}

/* ==================== GRILLE CARTE + REGISTRE ==================== */
.reseau-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.95fr;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
    align-items: stretch;
}

@media (max-width: 980px) {
    .reseau-grid {
        grid-template-columns: 1fr;
    }
}

.map-card,
.registre-card {
    background: var(--rs-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--rs-border);
    display: flex;
    flex-direction: column;
}

.map-card__header {
    padding: 1.1rem 1.35rem;
    background: #fbfaf6;
    border-bottom: 1px solid var(--rs-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.map-card__header h3,
.registre-card__header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rs-green);
}

.map-card__sub {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--rs-muted);
}

.map-layer-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.layer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #cfd6cf;
    background: #fff;
    color: var(--rs-dark);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.layer-btn.active,
.layer-btn:hover {
    background: var(--rs-green);
    color: #fff;
    border-color: var(--rs-green);
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.dot--ula {
    background: #1b4332;
    border: 1.5px solid #fff;
}

.dot--project {
    background: #b59449;
    border: 1.5px solid #fff;
}

#map {
    height: 460px;
    width: 100%;
    z-index: 1;
}

.map-legend {
    padding: 0.7rem 1.25rem;
    background: #fbfaf6;
    border-top: 1px solid var(--rs-border);
    font-size: 0.78rem;
    color: var(--rs-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    align-items: center;
}

.map-legend__note {
    margin-left: auto;
    font-style: italic;
}

/* ==================== REGISTRE DES ULAS ==================== */
.registre-card {
    max-height: 585px;
}

.registre-card__header {
    padding: 1.1rem 1.35rem;
    background: #fbfaf6;
    border-bottom: 1px solid var(--rs-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.registre-card__header span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--rs-muted);
    background: #eeeadd;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.registre-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.4rem 0;
}

.ula-item {
    padding: 0.95rem 1.3rem;
    border-bottom: 1px solid #efece2;
    transition: background 0.15s ease;
}

.ula-item:hover {
    background: #f9fbf9;
}

.ula-item:last-child {
    border-bottom: none;
}

.ula-item__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.ula-name {
    font-weight: 700;
    color: var(--rs-green);
    font-size: 0.96rem;
    text-decoration: none;
}

.ula-name:hover {
    text-decoration: underline;
}

.ula-meta {
    font-size: 0.8rem;
    color: var(--rs-muted);
    margin-top: 0.28rem;
}

.status-recruiting {
    color: #8a6a26;
}

.ula-principles {
    font-size: 0.78rem;
    color: #3e4c59;
    margin-top: 0.35rem;
    background: #f6f5ef;
    padding: 0.28rem 0.55rem;
    border-radius: 4px;
}

.ula-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.ula-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #d5d2c4;
    background: #fff;
    color: var(--rs-dark);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ula-mini-btn:hover {
    border-color: var(--rs-green);
    color: var(--rs-green);
    background: var(--rs-green-soft);
}

.ula-mini-btn--lecteur {
    background: var(--rs-green-soft);
    border-color: #bfd8c7;
    color: var(--rs-green);
}

.ula-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    background: var(--rs-green-soft);
    color: var(--rs-green);
    border: 1px solid #c5ddd0;
    white-space: nowrap;
}

.ula-badge--gold {
    background: var(--rs-gold-soft);
    color: #7c5e1e;
    border-color: #e4cfa1;
}

.ula-badge--terra {
    background: #fff3e6;
    color: #9c4221;
    border-color: #fbd38d;
}

/* ==================== SECTIONS CHANTIERS & 7 CERCLES ==================== */
.reseau-section {
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    padding: 1.85rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.reseau-section__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eeeadd;
}

.reseau-section__eyebrow {
    display: block;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rs-gold);
    margin-bottom: 0.3rem;
}

.reseau-section__head h2 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.55rem;
    color: var(--rs-green);
    margin: 0 0 0.35rem;
}

.reseau-section__head p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--rs-muted);
    max-width: 720px;
}

.reseau-section__cta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.chantiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.15rem;
}

.chantier-card {
    border: 1px solid #e4e0d3;
    border-left: 4px solid var(--rs-gold);
    border-radius: 8px;
    padding: 1.15rem 1.25rem;
    background: #fcfbf8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chantier-card--urgent {
    border-left-color: #9b2c2c;
}

.chantier-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.chantier-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: var(--rs-gold-soft);
    color: #7c5e1e;
}

.chantier-badge--urgent {
    background: #fde8e8;
    color: #9b1c1c;
}

.chantier-loc {
    font-size: 0.76rem;
    color: var(--rs-muted);
}

.chantier-card h3 {
    font-size: 1rem;
    color: var(--rs-green);
    margin: 0 0 0.45rem;
}

.chantier-card p {
    font-size: 0.85rem;
    color: #3e4c59;
    line-height: 1.5;
    margin: 0 0 0.9rem;
}

.chantier-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

/* Grille des 7 Cercles */
.cercles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.cercle-card {
    border: 1px solid #e6e3d8;
    border-radius: 8px;
    padding: 1.1rem 1.2rem;
    background: #fcfbf8;
}

.cercle-card__head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
}

.cercle-code {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border: 1.5px solid var(--rs-green);
    border-radius: 4px;
}

.cercle-card h3 {
    font-size: 0.96rem;
    color: var(--rs-green);
    margin: 0;
}

.cercle-card p {
    font-size: 0.83rem;
    color: var(--rs-muted);
    line-height: 1.5;
    margin: 0;
}

/* ==================== PROTOCOLE D'AFFILIATION ==================== */
.steps-card {
    background: var(--rs-surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--rs-border);
}

.steps-card__grid {
    display: grid;
    grid-template-columns: 1.4fr 0.85fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 900px) {
    .steps-card__grid {
        grid-template-columns: 1fr;
    }
}

.steps-card h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.4rem;
    color: var(--rs-green);
    margin: 0 0 0.65rem;
}

.steps-intro {
    font-size: 0.92rem;
    color: var(--rs-muted);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.steps-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--rs-dark);
    font-size: 0.9rem;
    line-height: 1.5;
}

.steps-list li::before {
    content: "▪";
    position: absolute;
    left: 0.2rem;
    color: var(--rs-gold);
    font-weight: 700;
}

.steps-list a {
    color: var(--rs-green);
    font-weight: 600;
}

.steps-Highlight {
    background: #fbf9f3;
    border: 1px solid #e4decb;
    border-radius: 10px;
    padding: 1.35rem 1.5rem;
}

.steps-Highlight h4 {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    color: var(--rs-green);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.steps-links-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.steps-links-vertical a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    background: #fff;
    border: 1px solid #e2dec9;
    border-radius: 6px;
    color: var(--rs-green);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.steps-links-vertical a:hover {
    background: var(--rs-green);
    color: #fff;
    border-color: var(--rs-green);
}

/* ==================== FICHE DÉTAILLÉE ULA (?ula=ID) ==================== */
.fiche-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.fiche-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--rs-green);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.fiche-back:hover {
    text-decoration: underline;
}

.fiche-ula {
    background: var(--rs-surface);
    border-radius: 12px;
    padding: 2.2rem;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--rs-border);
    border-top: 4px solid var(--rs-green);
    margin-bottom: 2rem;
}

.fiche-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.fiche-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.9rem;
    color: var(--rs-green);
    margin: 0 0 0.5rem;
}

.fiche-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.88rem;
    color: var(--rs-muted);
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eeeadd;
    margin-bottom: 1.35rem;
}

.fiche-section h3 {
    font-size: 1.05rem;
    color: var(--rs-green);
    margin: 0 0 0.5rem;
}

.fiche-desc {
    color: var(--rs-dark);
    line-height: 1.65;
    font-size: 0.96rem;
    margin-bottom: 1.5rem;
}

.fiche-two-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fiche-info-box {
    background: #fbfaf6;
    border: 1px solid #e6e2d3;
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.fiche-info-box h4 {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    color: var(--rs-green);
}

.fiche-info-box p {
    margin: 0;
    font-size: 0.88rem;
    color: #3e4c59;
    line-height: 1.5;
}

.fiche-lecteur-notice {
    background: #f5f9f6;
    border: 1px solid #c9dfd0;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}

.fiche-lecteur-notice strong {
    color: var(--rs-green);
    font-size: 0.95rem;
}

.fiche-lecteur-notice p {
    margin: 0.35rem 0 1rem;
    font-size: 0.86rem;
    color: var(--rs-muted);
}

.fiche-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fiche-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.btn-join {
    background: var(--rs-green);
    color: #fff;
}

.btn-carnet {
    background: #fff;
    border: 1px solid var(--rs-green);
    color: var(--rs-green);
}

/* Popups Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    border-top: 3px solid var(--rs-green);
}
.leaflet-popup-content {
    margin: 0.75rem 0.9rem;
    font-size: 0.84rem;
    line-height: 1.45;
}
.map-popup-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    background: var(--rs-green-soft);
    color: var(--rs-green);
    margin-bottom: 0.3rem;
}
.map-popup-badge--project {
    background: var(--rs-gold-soft);
    color: #7c5e1e;
}
.map-popup-title {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--rs-green);
    margin-bottom: 0.15rem;
}
.map-popup-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid #eee;
}
.map-popup-links a {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--rs-green);
    text-decoration: none;
}
.map-popup-links a:hover {
    text-decoration: underline;
}
