/* --- INTER (polices locales) --- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/inter-latin-300-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-latin-700-normal.woff2') format('woff2');
}

/* --- VARIABLES & RESET --- */
:root {
    --primary: #0f172a;
    --secondary: #334155;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% -10%, #e0f2fe 0%, #f0f9ff 30%, var(--bg-body) 60%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container--narrow {
    max-width: 1100px;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all 0.2s ease;
}

/* Fond assombri pour contraste WCAG AA (blanc sur bleu ≥ 4.5:1) */
.btn-primary {
    background-color: var(--accent-hover);
    color: #fff;
}
.btn-primary:hover { background-color: #1d4ed8; transform: translateY(-1px); }

.btn-outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* --- TAGS --- */
.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-orange { background: #ffedd5; color: #9a3412; }

/* --- NAV --- */
.nav-maquette {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: lowercase;
    letter-spacing: -0.03em;
}
.logo-text { display: inline-flex; align-items: baseline; }
.logo-fin { font-weight: 600; }
.logo-adsl { font-weight: 700; }
.logo-ext { font-weight: 500; }

/* Drapeau France (bleu blanc rouge) dans le logo */
.logo-flag {
    display: inline-flex;
    width: 24px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.logo-flag-stripe {
    flex: 1;
    min-width: 0;
}
.logo-flag-blue { background: #002395; }
.logo-flag-white { background: #fff; border-left: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; }
.logo-flag-red { background: #ED2939; }

.nav-links {
    display: flex;
    gap: 24px;
}
.nav-links a { font-size: 0.95rem; color: var(--secondary); font-weight: 500; }
.nav-links a:hover { color: var(--accent); }

.nav-search {
    margin-left: auto;
}

/* Recherche commune dans la nav */
.nav-search {
    position: relative;
    min-width: 200px;
    max-width: 280px;
    background: #f1f5f9;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.nav-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--primary);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    outline: none;
    transition: box-shadow 0.2s;
}
.nav-search-input::placeholder { color: var(--text-muted); font-size: 0.8rem; }
.nav-search-input:focus { outline: none; }
.nav-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.nav-search::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center;
    pointer-events: none;
}
.nav-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1001;
}
.nav-search-suggestions.is-visible { display: block; }
.nav-search-suggestions ul { padding: 8px 0; margin: 0; list-style: none; }
.nav-search-suggestions li { padding: 0; border: none; }
.nav-search-suggestions a {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text-main);
}
.nav-search-suggestions a:hover { background: #f8fafc; color: var(--accent); }
.nav-search-suggestions p { margin: 0; padding: 12px 14px; font-size: 0.875rem; }

/* --- HERO (HOME) --- */
.hero {
    padding: 140px 0 100px;
    text-align: center;
    background: radial-gradient(circle at top center, #e0f2fe 0%, transparent 40%);
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--primary);
    letter-spacing: -1px;
}

.hero p,
.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 24px;
}

.section-search {
    position: relative;
    z-index: 100;
    padding: 24px 0 40px;
}
.section-search .search-container {
    margin-top: 24px;
    position: relative;
    z-index: 100;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    margin-bottom: 24px;
}
/* Pas de marge en haut pour le premier bloc de la colonne principale (ex. page commune) */
main section:first-child .section-head {
    margin-top: 0;
}

.section-head i,
.section-head .section-head-icon,
.section-head .icon {
    font-size: 2rem;
    color: var(--accent);
    flex-shrink: 0;
    display: inline-block;
    min-width: 2rem;
    min-height: 2rem;
}
.section-head .icon { width: 2rem; height: 2rem; }

/* Icônes SVG (sprite) */
.icon {
    display: inline-block;
    vertical-align: -0.125em;
    fill: currentColor;
    flex-shrink: 0;
}

.section-head h2 {
    margin: 0;
    border: none;
    padding: 0;
}
.section-head--subtitle {
    align-items: flex-start;
}
.section-head--subtitle i {
    font-size: 1.25rem;
    margin-top: 2px;
}
.section-head--subtitle .subtitle {
    font-size: 1rem;
    line-height: 1.5;
}

/* --- SEARCH BOX --- */
.search-container {
    width: 100%;
    max-width: none;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.15), 0 0 0 1px var(--border);
    transition: 0.3s;
}
.search-box:focus-within {
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.25), 0 0 0 2px var(--accent);
}

.search-box .search-icon,
.search-box .icon {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
}
.search-box .icon { width: 1.25em; height: 1.25em; }

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    background: transparent;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}
.search-suggestions.is-visible {
    display: block;
}
.search-suggestions ul { padding: 8px 0; }
.search-suggestions li { padding: 0; border: none; }
.search-suggestions a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.95rem;
}
.search-suggestions a:hover { background: #f8fafc; }
.search-suggestions a:hover .search-result-commune { color: var(--accent); }

/* Style des résultats de recherche */
.search-results-list { list-style: none; margin: 0; padding: 8px 0; }
.search-results-list li { padding: 0; border: none; }
.search-result-postal {
    display: inline-block;
    width: 54px;
    padding: 3px 0;
    background: var(--accent);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    flex-shrink: 0;
}
.search-result-commune {
    color: var(--text);
    font-weight: 500;
}
.search-no-result {
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Style pour nav-search résultats aussi */
.nav-search-suggestions a {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-search-suggestions .search-result-postal {
    width: 50px;
    padding: 2px 0;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    text-align: center;
    flex-shrink: 0;
}
.nav-search-suggestions .search-result-commune {
    color: var(--text);
    font-weight: 500;
}
.nav-search-suggestions a:hover .search-result-commune { color: var(--accent); }

/* --- COMMUNE HERO --- */
.commune-hero {
    padding: 60px 0 80px;
    text-align: left;
}
.commune-hero .hero-subtitle {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

.commune-hero h1 {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.status-sentence {
    font-size: 1.1rem;
    padding: 12px 18px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    max-width: 800px;
    border: 1px solid transparent;
}
.status-sentence--info {
    color: #0369a1;
    background: rgba(224, 242, 254, 0.8);
    border-color: rgba(186, 230, 253, 0.6);
}
.status-sentence--alert {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}
.status-sentence--alert i { color: #d97706; }
.status-sentence--danger {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}
.status-sentence--danger i { color: #dc2626; }
.status-sentence__link {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}
.status-sentence__link:hover {
    text-decoration-thickness: 2px;
}

/* --- STATS GRID (HOME) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card a { display: flex; flex-direction: column; flex: 1; }

.stat-card-icon {
    font-size: 1.75rem;
    color: var(--accent);
    margin-bottom: 10px;
    flex-shrink: 0;
}
.stat-card-icon i,
.stat-card-icon .icon { display: block; }
.stat-card-icon .icon { width: 1.75rem; height: 1.75rem; }
.stat-title { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 2.5rem; font-weight: 700; color: var(--primary); letter-spacing: -1px; }
.stat-desc { font-size: 0.875rem; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.text-green { color: var(--success); }

/* Page département : cartes "En chiffres" en colonne + compact */
.stats-grid--dep {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.stats-grid--dep .stat-card { min-height: 0; }

.stats-grid--compact .stat-card {
    padding: 14px 18px;
}
.stats-grid--compact .stat-card-icon {
    font-size: 1.35rem;
    margin-bottom: 6px;
}
.stats-grid--compact .stat-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
    font-weight: 600;
}
.stats-grid--compact .stat-value {
    font-size: 1.75rem;
}
.stats-grid--compact .stat-progress-block { margin-top: 8px; }
.stats-grid--compact .stat-bar-label { font-size: 0.8rem; margin-bottom: 4px; }
.stats-grid--compact .stat-bar-label--inline { font-size: 0.8rem; }
.stats-grid--compact .progress-container::before { height: 4px; }
.stats-grid--compact .progress-container .progress-bar { height: 4px; margin-top: -4px; }
.stats-grid--compact {
    gap: 10px;
}

.stat-progress-block { margin-top: auto; flex-shrink: 0; }
.stat-bar-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: left;
    margin-bottom: 6px;
}
.stat-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.stat-value-row .stat-value { margin-bottom: 0; }
.stat-bar-label--inline {
    margin-bottom: 0;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-container {
    width: 100%;
    flex-shrink: 0;
}
/* Piste grise en arrière-plan */
.progress-container::before {
    content: '';
    display: block;
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
}
/* Barre bleue au-dessus de la piste */
.progress-container .progress-bar {
    display: block;
    height: 6px;
    margin-top: -6px;
    background: #3b82f6;
    border-radius: 3px;
    width: 0%;
    transition: width 1.5s ease-out;
}
/* Carte 2 : commercialisation arrêtée — orange (cohérent avec page commune « Fin de commercialisation ») */
.progress-container--alert .progress-bar {
    background: #d97706;
}
/* Carte 3 : réseau fermé — rouge (cohérent avec page commune « Arrêt technique ») */
.progress-container--red .progress-bar {
    background: #dc2626;
}
.progress-container--black .progress-bar {
    background: #171717;
}

/* --- DASHBOARD GRID (COMMUNE) --- */
.stats-overlap { margin-top: -40px; position: relative; z-index: 10; margin-bottom: 60px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); }

.card-label { text-transform: uppercase; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 8px; display: block; }
.date-big { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.countdown { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: 4px; display: flex; align-items: center; gap: 6px; }

/* Cartes Fin de commercialisation (alert) et Arrêt technique (danger) */
.card--alert.card--pending {
    border-bottom: 4px solid #d97706;
}
.card--alert.card--pending .card-label,
.card--alert.card--pending .countdown { color: #b45309; }
.card--alert.card--passed {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-bottom: 4px solid #d97706;
}
.card--alert.card--passed .card-label { color: #92400e; }
.card--alert.card--passed .date-big { color: #b45309; }
.card--alert.card--passed .countdown { color: #92400e; }

.card--danger.card--pending {
    border-bottom: 4px solid #dc2626;
}
.card--danger.card--pending .card-label,
.card--danger.card--pending .countdown { color: #b91c1c; }
.card--danger.card--passed {
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-bottom: 4px solid #dc2626;
}
.card--danger.card--passed .card-label { color: #991b1b; }
.card--danger.card--passed .date-big { color: #b91c1c; }
.card--danger.card--passed .countdown { color: #991b1b; }

.gauge-wrapper { display: flex; align-items: center; gap: 20px; }
.gauge {
    width: 70px; height: 70px; border-radius: 50%;
    background: conic-gradient(var(--success) 0% var(--gauge-pct, 0%), #e2e8f0 var(--gauge-pct, 0%) 100%);
    display: flex; align-items: center; justify-content: center; position: relative;
}
.gauge::before { content: ''; position: absolute; width: 56px; height: 56px; background: white; border-radius: 50%; }
.gauge-text { position: absolute; font-weight: 700; font-size: 1rem; color: var(--primary); }

.infofibre-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent, #2563eb);
    text-decoration: none;
    border: 1px solid var(--accent, #2563eb);
    border-radius: var(--radius, 6px);
    transition: background 0.2s, color 0.2s;
}
.infofibre-link:hover {
    background: var(--accent, #2563eb);
    color: #fff;
}

/* --- MAIN GRID / LAYOUT --- */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 80px;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 360px; /* aside largeur fixe (carte + tableau) */
    gap: 48px;
    padding-bottom: 80px;
}
/* Colonne main au-dessus de l'aside pour que le dropdown recherche ne soit pas masqué par la carte */
.content-layout main {
    position: relative;
    z-index: 2;
}

@media (max-width: 900px) {
    .main-grid,
    .content-layout { grid-template-columns: 1fr; }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.section-header h2 { font-size: 1.5rem; color: var(--primary); }

h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--primary);
    letter-spacing: -0.02em;
}
p { margin-bottom: 16px; color: #475569; font-size: 1rem; }

/* --- CHART INTÉGRÉ (sans fond blanc) --- */
.chart-wrapper {
    margin-bottom: 60px;
    position: relative;
}

/* Hauteur fixe pour éviter le layout shift quand Chart.js charge (CLS). font-size fixe pour limiter l’inflation iOS. */
/* Ne pas forcer width/height sur le canvas : Chart.js gère la taille (responsive) pour éviter la déformation du ratio. */
.chart-wrapper--integrated {
    background: transparent;
    padding: 24px 0;
    height: 400px;
    box-sizing: border-box;
    font-size: 16px;
    position: relative;
}

.chart-wrapper--integrated canvas {
    display: block;
    max-width: 100%;
}

/* --- SECTIONS PLEINE LARGEUR (Explications + Dans chaque département) --- */
.home-full-width {
    width: 100%;
}

.departements-list {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px 40px;
}

.departements-region-block {
    break-inside: avoid;
}

.departements-region {
    font-size: 1.25rem;
    margin: 0 0 16px;
    color: var(--primary);
}

.departements-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-dep {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* --- MAP PLACEHOLDER --- */
.map-visual {
    background: #e2e8f0;
    border-radius: var(--radius);
    height: 400px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23cbd5e1" fill-opacity="0.4"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}
.map-overlay {
    background: rgba(255,255,255,0.9);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 300px;
}

/* --- TIMELINE --- */
.timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 32px;
    position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 30px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item:last-child::before { display: none; }

.timeline-icon {
    width: 30px;
    height: 30px;
    background: white;
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
    color: var(--accent);
}
.timeline-icon.done { background: var(--accent); color: white; border-color: var(--accent); }
.timeline-content h3 { font-size: 1.1rem; margin-bottom: 4px; }
.timeline-content p { color: var(--text-muted); font-size: 0.9rem; }
.timeline-date { font-size: 0.8rem; font-weight: 600; color: var(--secondary); margin-bottom: 4px; display: block; }

/* --- WIDGETS / SIDEBAR --- */
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.widget h3 { font-size: 1.1rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.link-list li { padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.link-list li:last-child { border: none; }
.link-list a { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }
.link-list a:hover { color: var(--accent); }

.sidebar-widget {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.map-preview {
    height: 250px;
    background-color: #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23cbd5e1" fill-opacity="0.4" fill-rule="evenodd"%3E%3Cpath d="M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z"/%3E%3C/g%3E%3C/svg%3E');
}
.map-pin {
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Carte commune (Leaflet) — contours GeoJSON — z-index bas pour rester sous le dropdown recherche */
.commune-map {
    position: relative;
    z-index: 0;
    overflow: hidden;
    margin-bottom: 16px;
}
.commune-map .leaflet-container {
    font-family: inherit;
}
.commune-map-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-height: 250px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- OFFER TABLE --- */
.offer-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}
.offer-table th { background: #f8fafc; text-align: left; padding: 16px; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.offer-table td { padding: 16px; border-bottom: 1px solid var(--border); }
.offer-table .price { font-weight: 700; color: var(--primary); }
.offer-table img { max-height: 48px; width: auto; }

/* --- FAQ ACCORDION --- */
.faq-section { margin-top: 60px; }
.accordion-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; background: white; overflow: hidden; }
.accordion-header {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
}
.accordion-header:hover { background: #f8fafc; }
.accordion-header .icon { width: 1em; height: 1em; flex-shrink: 0; transition: transform 0.2s; }
.accordion-item.is-open .accordion-header .icon { transform: rotate(180deg); }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion-content-inner { padding: 16px 20px 20px; }
.accordion-content p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* --- INFO BOX --- */
.notification-box {
    padding: 16px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.notification-box.notification-primary { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.notification-box.notification-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.notification-box.notification-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* --- FOOTER --- */
.footer-maquette {
    background: var(--primary);
    color: #cbd5e1;
    margin-top: 60px;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}
.footer-maquette .logo,
.footer-maquette .logo-text,
.footer-maquette .logo-fin,
.footer-maquette .logo-adsl,
.footer-maquette .logo-ext {
    color: #ffffff;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 { color: #f8fafc; margin-bottom: 16px; font-size: 1rem; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: #cbd5e1; }
.footer-col a:hover { color: #f8fafc; }

.copyright {
    text-align: center;
    border-top: 1px solid #475569;
    padding-top: 20px;
}
.copyright p,
.footer-maquette p {
    color: #cbd5e1;
}

/* --- INFOS (Questions / Réponses) --- */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.info-list li {
    margin-bottom: 12px;
}
.info-list .link-card {
    display: block;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #ffffff;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- SECTIONS & TITRES UTILITAIRES --- */
.section-head--spaced-sm {
    margin-bottom: 16px;
}
.section-head--spaced-md {
    margin-bottom: 24px;
}
.subtitle {
    margin-bottom: 24px;
}
.subtitle-muted {
    margin-bottom: 24px;
    color: var(--text-muted);
}
.content-block {
    margin-bottom: 24px;
}
.content-block--spaced-lg {
    margin-bottom: 40px;
}
.content-block--spaced-md {
    margin-bottom: 32px;
}

/* --- OFFRES FIBRE --- */
.section-offres {
    margin-top: 40px;
}
/* Décalage au scroll vers l’ancre pour que le sous-titre reste visible sous la nav sticky */
#offres-fibre {
    scroll-margin-top: 72px;
}
.offer-table th.offer-logo-col {
    width: 160px;
}
.offer-table th.offer-test-col {
    width: 220px;
}
/* nowrap uniquement pour le tableau offres fibre (boutons/prix), pas pour la sidebar commune (codes postaux) */
.section-offres .offer-table td:last-child {
    white-space: nowrap;
}
/* sidebar commune : largeur contrainte + retour à la ligne (ex. plusieurs codes postaux) */
.sidebar-widget .offer-table {
    table-layout: fixed;
    width: 100%;
}
.sidebar-widget .offer-table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.offer-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}
/* Offres fibre : en responsive, logo + prix sur une ligne (2 col.), bouton en full width en dessous */
@media (max-width: 768px) {
    .section-offres .offer-table thead {
        display: none;
    }
    .section-offres .offer-table,
    .section-offres .offer-table tbody {
        display: block;
    }
    .section-offres .offer-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 12px 16px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
        align-items: center;
    }
    .section-offres .offer-table tbody tr:last-child {
        border-bottom: none;
    }
    .section-offres .offer-table tbody td {
        padding: 0;
        border: none;
    }
    .section-offres .offer-table tbody td:first-child {
        grid-row: 1;
    }
    .section-offres .offer-table tbody td:nth-child(2) {
        grid-row: 1;
        min-width: 0;
    }
    .section-offres .offer-table tbody td:last-child {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .section-offres .offer-table tbody td:last-child .btn {
        width: 100%;
        box-sizing: border-box;
    }
    .section-offres .offer-table img {
        max-height: 40px;
    }
}

/* --- MISE EN PAGE CONTENU 2 COLONNES --- */
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 360px; /* aside largeur fixe pour ne pas s'élargir avec le contenu (ex. plusieurs codes postaux) */
    gap: 40px;
    margin-bottom: 48px;
}
@media (max-width: 900px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
}

/* Page d'accueil : carte France + prochaines échéances — 1 colonne en responsive */
.home-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}
@media (max-width: 768px) {
    .home-two-cols {
        grid-template-columns: 1fr;
    }
}

/* --- STATS GRID RÉSUMÉ --- */
.stats-grid--summary {
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* --- LOTS TABLE --- */
.lots-table th.col-lot { width: 25%; }
.lots-table th.col-communes { width: 15%; }
.lots-table th.col-logements { width: 15%; }
.lots-table th.col-fc { width: 22%; }
.lots-table th.col-ft { width: 23%; }

/* --- STATUS TABLE --- */
.status-table th.col-code { width: 10%; }
.status-table th.col-dep { width: 10%; }
.status-table th.col-nom { width: 40%; }
.status-table th.col-logements { width: 10%; }
.status-table th.col-fc,
.status-table th.col-ft { width: 15%; }

/* --- PAGE 404 --- */
.error-page-block {
    text-align: center;
    padding: 48px 24px;
}
.error-page-block p.error-text {
    margin-bottom: 24px;
    color: var(--text-muted);
}

/* --- MESSAGES D'ERREUR RECHERCHE --- */
.search-error-message {
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- ANIMATIONS --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- PAGE DÉPARTEMENT : carte + légende + tableau --- */
.dep-map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: white;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 500;
    font-size: 0.875rem;
}
.dep-map-legend a {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--accent);
}
.dep-map-legend a:hover { text-decoration: underline; }
.dep-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.dep-legend-color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    border-radius: 2px;
    flex-shrink: 0;
}
.dep-map-toggle .btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Carte département (Leaflet, comme page commune) — z-index bas pour rester sous le dropdown recherche */
.dep-map-wrapper {
    z-index: 0;
}
.dep-map-wrapper .leaflet-container {
    font-family: inherit;
}
.dep-map-wrapper .leaflet-tooltip.dep-map-tooltip-leaflet {
    padding: 8px 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    background: white;
    white-space: nowrap;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.table th {
    background: #f8fafc;
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    color: var(--secondary);
    border-bottom: 1px solid var(--border);
}
.table th .th-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.table th[data-sort] { cursor: pointer; }
.table .sort-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.9;
    margin-left: 2px;
}
.table .sort-indicator .sort-indicator-up,
.table .sort-indicator .sort-indicator-down,
.table .sort-indicator .icon {
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0.55;
    color: var(--secondary);
    -webkit-text-stroke: 0.3px currentColor;
}
.table .sort-indicator .icon { width: 0.9em; height: 0.9em; }
.table th[data-sort="asc"] .sort-indicator .sort-indicator-up {
    opacity: 1;
    color: var(--accent);
}
.table th[data-sort="desc"] .sort-indicator .sort-indicator-down {
    opacity: 1;
    color: var(--accent);
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: #f8fafc; }
.table-striped tbody tr:nth-child(even) { background: #fafafa; }
.table-striped tbody tr:nth-child(even):hover { background: #f1f5f9; }
.table a { color: var(--accent); font-weight: 500; }
.table a:hover { text-decoration: underline; }
.table .text-right { text-align: right; }
/* Date passée : fond gris clair, texte grisé (sans fond noir, sans barré) */
.table .cell-past {
    background: #f1f5f9;
    color: var(--text-muted);
}
.table .cell-past a { color: var(--text-muted); }
.table tbody tr:hover .cell-past { background: #e2e8f0; }

/* Pagination tableau (côté client, toutes les lignes restent dans le HTML pour le SEO) */
.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    padding-left: 16px;
    padding-right: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}
.table-pagination .pagination-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}
.table-pagination select {
    padding: 6px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    background: white;
}
.table-pagination .pagination-info { color: var(--text-muted); }
.table-pagination .pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 0;
}
.table-pagination .pagination-nav button {
    padding: 8px 14px;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-weight: 500;
}
.table-pagination .pagination-nav button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.table-pagination .pagination-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.table-pagination .pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.table-pagination .pagination-page {
    min-width: 36px;
    padding: 8px 10px;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-weight: 500;
}
.table-pagination .pagination-page:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.table-pagination .pagination-page.active,
.table-pagination .pagination-page:disabled {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    cursor: default;
}
.table-pagination .pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dep-map-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}
.dep-map-layout > div:last-child {
    max-width: 320px;
}
@media (max-width: 900px) {
    .dep-map-layout {
        grid-template-columns: 1fr;
    }
    .dep-map-layout > div:last-child {
        max-width: none;
    }
}

/* --- MOBILE --- */
@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .commune-hero h1 { font-size: 2rem; }
    .nav-links { display: none; }
}
