/* Réseau CSE France — feuille de style principale (complète Bootstrap 5.3) */
:root {
    /* Charte CSE'France (d'après le logo) */
    --rc-encre: #10374c;      /* bleu nuit */
    --rc-bleu: #1e6885;       /* bleu pétrole */
    --rc-bleu-fonce: #17546b;
    --rc-bleu-pale: #e7f0f4;
    --rc-or: #f3ba4c;         /* jaune */
    --rc-or-fonce: #9a6608;   /* jaune foncé, lisible sur fond clair */
    --rc-corail: var(--rc-or);
    --rc-sable: #f6f5f1;
    --rc-gris: #66727c;
    --rc-bord: #e2e4e3;
    --bs-primary: #1e6885;
    --bs-primary-rgb: 30, 104, 133;
    --bs-link-color: #1e6885;
    --bs-link-color-rgb: 30, 104, 133;
    --bs-link-hover-color: #10374c;
    --bs-link-hover-color-rgb: 16, 55, 76;
    --bs-body-font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-color: #1b2a33;
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: .9rem;
}

body { background: var(--rc-sable); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
h1, h2, h3, h4, .display-5, .display-6 { font-weight: 750; letter-spacing: -.02em; color: var(--rc-encre); }

.btn-primary { --bs-btn-bg: var(--rc-bleu); --bs-btn-border-color: var(--rc-bleu); --bs-btn-hover-bg: var(--rc-bleu-fonce); --bs-btn-hover-border-color: var(--rc-bleu-fonce); --bs-btn-active-bg: var(--rc-encre); --bs-btn-active-border-color: var(--rc-encre); --bs-btn-disabled-bg: var(--rc-bleu); --bs-btn-disabled-border-color: var(--rc-bleu); }
.btn-outline-primary { --bs-btn-color: var(--rc-bleu); --bs-btn-border-color: var(--rc-bleu); --bs-btn-hover-bg: var(--rc-bleu); --bs-btn-hover-border-color: var(--rc-bleu); --bs-btn-active-bg: var(--rc-bleu-fonce); --bs-btn-active-border-color: var(--rc-bleu-fonce); }
.text-primary { color: var(--rc-bleu) !important; }
.bg-primary, .text-bg-primary { background-color: var(--rc-bleu) !important; }
.form-check-input:checked { background-color: var(--rc-bleu); border-color: var(--rc-bleu); }
.btn-accent { --bs-btn-color: var(--rc-encre); --bs-btn-bg: var(--rc-or); --bs-btn-border-color: var(--rc-or); --bs-btn-hover-color: var(--rc-encre); --bs-btn-hover-bg: #e9a92f; --bs-btn-hover-border-color: #e9a92f; --bs-btn-active-bg: #dc9c22; --bs-btn-active-color: var(--rc-encre); font-weight: 600; }
.text-accent { color: var(--rc-or-fonce) !important; }
.bg-encre { background: var(--rc-encre) !important; }
.bg-bleu-pale { background: var(--rc-bleu-pale) !important; }

/* Navigation */
.navbar-rc { background: #fff; border-bottom: 1px solid var(--rc-bord); }
.navbar-rc .navbar-brand { font-weight: 800; color: var(--rc-encre); letter-spacing: -.02em; }
.navbar-rc .navbar-brand img { height: 2.4rem; width: auto; display: block; }
.navbar-rc .nav-link { font-weight: 600; color: #3c4559; }
.navbar-rc .nav-link.active, .navbar-rc .nav-link:hover { color: var(--rc-bleu); }

/* Hero */
.hero { background: radial-gradient(900px 380px at 88% -10%, rgba(243,186,76,.30), transparent 60%), linear-gradient(160deg, var(--rc-encre) 0%, var(--rc-bleu) 100%); color: #fff; }
.hero h1 { color: #fff; }
.hero .lead { color: #d3e3ea; }
.hero-recherche { background: #fff; border-radius: 1rem; padding: .5rem; box-shadow: 0 20px 40px -20px rgba(0,0,0,.45); }
.hero-recherche .form-control, .hero-recherche .form-select { border: 0; box-shadow: none; }
.stat-hero { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-hero { color: var(--rc-or) !important; }
.stat-hero-label { color: #b9d0da; font-size: .85rem; }

/* Cartes */
.carte { background: #fff; border: 1px solid var(--rc-bord); border-radius: var(--bs-border-radius-lg); transition: transform .15s ease, box-shadow .15s ease; }
a.carte, .carte-lien { color: inherit; text-decoration: none; }
a.carte:hover, .carte-lien:hover .carte { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(16,55,76,.35); }
.annonce-vignette { aspect-ratio: 4 / 3; background: #eceae4; border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0; overflow: hidden; display: grid; place-items: center; color: #b4b0a6; font-size: 2.5rem; position: relative; }
.annonce-vignette img { width: 100%; height: 100%; object-fit: cover; }
.annonce-vignette .badge { position: absolute; top: .6rem; left: .6rem; font-size: .75rem; }
.annonce-prix { font-weight: 800; font-size: 1.1rem; color: var(--rc-encre); }
.module-icone { width: 3rem; height: 3rem; border-radius: .8rem; display: grid; place-items: center; font-size: 1.4rem; }
.categorie-pastille { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1rem .5rem; text-align: center; font-weight: 600; font-size: .9rem; }
.categorie-pastille i { font-size: 1.6rem; color: var(--rc-bleu); }
.cse-logo { width: 3.25rem; height: 3.25rem; border-radius: .7rem; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.cse-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--rc-bleu-pale); color: var(--rc-bleu); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }

/* Formulaires */
.form-label { font-weight: 600; }
.form-control:focus, .form-select:focus { border-color: #7fb0c3; box-shadow: 0 0 0 .2rem rgba(30,104,133,.18); }
.filtres { position: sticky; top: 1rem; }

/* Galerie d'annonce */
.galerie-principale { aspect-ratio: 4 / 3; background: #eceae4; border-radius: var(--bs-border-radius-lg); overflow: hidden; }
.galerie-principale img { width: 100%; height: 100%; object-fit: contain; }
.galerie-miniatures img { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: .5rem; cursor: pointer; border: 2px solid transparent; }
.galerie-miniatures img.active { border-color: var(--rc-bleu); }

/* Messagerie */
.fil-messages { max-height: 60vh; overflow-y: auto; }
.bulle { max-width: 78%; padding: .6rem .9rem; border-radius: 1rem; white-space: pre-wrap; word-wrap: break-word; }
.bulle-moi { background: var(--rc-bleu); color: #fff; border-bottom-right-radius: .25rem; margin-left: auto; }
.bulle-autre { background: #fff; border: 1px solid var(--rc-bord); border-bottom-left-radius: .25rem; }
.conversation-item.active { background: var(--rc-bleu-pale); }

/* Contenus Markdown */
.contenu-riche { line-height: 1.7; }
.contenu-riche > :first-child { margin-top: 0; }
.contenu-riche > :last-child { margin-bottom: 0; }
.contenu-riche h2 { font-size: 1.35rem; margin-top: 2rem; }
.contenu-riche h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.contenu-riche table { width: 100%; margin: 1rem 0; border-collapse: collapse; background: #fff; }
.contenu-riche th, .contenu-riche td { border: 1px solid var(--rc-bord); padding: .45rem .7rem; }
.contenu-riche th { background: var(--rc-bleu-pale); }
.contenu-riche blockquote { border-left: 4px solid var(--rc-or); padding: .4rem 1rem; background: #fff; color: #444; }

/* Guide */
.guide-entete { background: linear-gradient(160deg, var(--rc-encre) 0%, #1a4f66 100%); color: #fff; border-bottom: 4px solid var(--rc-or); }
.guide-entete h1 { color: #fff; }
.guide-entete .lead { color: #cfe0e8; }
.reference-legale { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.verrou { background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f6f4ef 10px, #f6f4ef 20px); }

/* Mini-sites CSE : la couleur est injectée par CSE via --cse */
.minisite-entete { background: var(--cse, #1f4fd1); color: #fff; }
.minisite-entete h1 { color: #fff; }
.minisite-entete .cse-logo { background: rgba(255,255,255,.16) !important; box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
.minisite-nav { background: #fff; border-bottom: 1px solid var(--rc-bord); }
.minisite-nav .nav-link { color: #3c4559; font-weight: 600; border-bottom: 3px solid transparent; border-radius: 0; }
.minisite-nav .nav-link.active { color: var(--cse); border-bottom-color: var(--cse); }
.btn-cse { --bs-btn-color: #fff; --bs-btn-bg: var(--cse); --bs-btn-border-color: var(--cse); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--cse); --bs-btn-hover-border-color: var(--cse); filter: saturate(1.05); }
.btn-cse:hover { filter: brightness(.92); }

/* Espace élus */
.menu-espace .list-group-item { border: 0; border-radius: .5rem !important; font-weight: 600; color: #3c4559; }
.menu-espace .list-group-item.active { background: var(--rc-bleu-pale); color: var(--rc-bleu); }

footer.pied { background: var(--rc-encre); color: #b9cad3; border-top: 4px solid var(--rc-or); }
footer.pied .logo-pied { height: 2.6rem; width: auto; }
footer.pied a { color: #e3edf1; text-decoration: none; }
footer.pied a:hover { text-decoration: underline; }

.pagination { --bs-pagination-active-bg: var(--rc-bleu); --bs-pagination-active-border-color: var(--rc-bleu); }
.min-w-0 { min-width: 0; }

/* Accents de la charte */
.icone-or { background: rgba(243,186,76,.22); color: var(--rc-or-fonce); }
.icone-bleu { background: var(--rc-bleu-pale); color: var(--rc-bleu); }
.trait-or { display: inline-block; width: 2.5rem; height: 4px; border-radius: 2px; background: var(--rc-or); }
.badge-moderation { background: rgba(243,186,76,.25); color: var(--rc-or-fonce); }

/* Formules */
.formule { border-top: 4px solid var(--rc-bord); }
.formule-libre { border-top-color: var(--rc-bleu); }
.formule-option { border-top-color: var(--rc-or); }
.formule-actuelle { box-shadow: 0 0 0 2px var(--rc-or); }
.formule ul li { padding: .2rem 0; }
.formule .tarif { font-size: 1.35rem; font-weight: 800; color: var(--rc-encre); }

/* Menu principal : une seule ligne sur les écrans moyens */
@media (min-width: 1200px) {
    .navbar .nav-link, .navbar .btn { white-space: nowrap; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar .navbar-nav .nav-link { padding-left: .45rem; padding-right: .45rem; font-size: .95rem; }
    .navbar .navbar-brand img { height: 34px; width: auto; }
}

/* Page Aide */
@media (min-width: 992px) {
    .aide-sommaire { position: sticky; top: 5.5rem; }
}
.aide-sommaire li { padding: .15rem 0; }
.aide section { scroll-margin-top: 5rem; }
.aide h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.aide h3 { font-size: 1.1rem; margin-top: 1.6rem; scroll-margin-top: 5rem; }
.aide dt { margin-top: .8rem; }
.aide table { font-size: .92rem; }

/* Contrats acceptés en ligne */
.contrat-defilant { max-height: 340px; overflow-y: auto; border: 1px solid #c9dde6; border-radius: .5rem; padding: 1rem 1.25rem; background: #f8fbfc; font-size: .9rem; }
.contrat-defilant h2, .contrat-texte h2 { font-size: 1.1rem; margin-top: 1.4rem; }
.contrat-defilant table, .contrat-texte table { font-size: .85rem; }
.contrat-acceptation .form-check-label { font-weight: 600; }
@media print {
    .contrat-page { max-width: none !important; padding: 0 !important; }
    header, footer, nav { display: none !important; }
}
