/* =====================================================
   CIVIKA — Fiche d'information d'une commune sans site
   Feuille autonome : ces pages ne dépendent d'aucun réglage de commune.
   ===================================================== */
:root {
    --bleu: #2563eb;
    --violet: #7c3aed;
    --bleu-fonce: #0f172a;
    --encre: #101a2b;
    --gris: #56606f;
    --fond: #ffffff;
    --alt: #f4f7fb;
    --bordure: #e3e8ef;
    --rayon: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0; background: var(--fond); color: var(--encre);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16.5px; line-height: 1.7; font-weight: 380;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; font-weight: 650; margin: 0 0 12px; }
a { color: var(--bleu); }
.conteneur { max-width: 1400px; margin: 0 auto; padding: 0 32px; }
.ico { vertical-align: -.18em; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* ---------- En-tête et mention de non-officialité ---------- */
.fiche-entete { border-bottom: 1px solid var(--bordure); background: #fff; }
.fiche-entete .conteneur {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; min-height: 88px; flex-wrap: wrap;
}
.marque img { height: 56px; display: block; }
.fiche-avis {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fef3c7; color: #8a4b0f; border-radius: 999px;
    padding: 6px 14px; font-size: 13px; font-weight: 600;
}

/* ---------- Bandeau : clair et typographique, le bleu reste un accent ---------- */
.fiche-hero {
    position: relative; overflow: hidden;
    padding: clamp(44px, 6vw, 76px) 0 clamp(30px, 4vw, 44px);
    border-bottom: 1px solid var(--bordure);
    /* Se termine sur un gris très clair : le bloc entier se détache du contenu
       qui suit, resté blanc, sans recourir à un aplat qui écraserait les halos. */
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 30%, #f1f3f7 100%);
}
/* Deux halos entrelacés, bleu et violet, ancrés à gauche : la couleur est
   présente sans aplat, et le recouvrement des deux teintes crée le dégradé. */
.fiche-hero::before,
.fiche-hero::after {
    content: ""; position: absolute; border-radius: 50%;
    pointer-events: none; z-index: 0;
}
.fiche-hero::before {
    top: -330px; left: -250px; width: 780px; height: 780px;
    background: radial-gradient(circle, color-mix(in srgb, var(--bleu) 15%, transparent), transparent 65%);
}
.fiche-hero::after {
    top: -250px; left: 150px; width: 580px; height: 580px;
    background: radial-gradient(circle, color-mix(in srgb, var(--violet) 13%, transparent), transparent 65%);
    mix-blend-mode: multiply;
}
.fiche-hero .conteneur { position: relative; z-index: 1; }
@media (max-width: 720px) {
    .fiche-hero::before { top: -240px; left: -200px; width: 560px; height: 560px; }
    .fiche-hero::after  { top: -190px; left: 40px;   width: 420px; height: 420px; }
}
.fiche-fil { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
/* Fond translucide plutôt qu'un gris opaque : les pastilles se posent sur le
   halo sans le masquer, et restent lisibles quelle que soit la teinte dessous. */
.fiche-fil span {
    font-size: 12.5px; font-weight: 600; color: var(--gris);
    background: rgba(0, 0, 0, .055); border-radius: 999px; padding: 5px 12px;
}
.fiche-hero h1 {
    font-size: clamp(38px, 6.5vw, 68px); color: var(--encre);
    margin: 0 0 20px; letter-spacing: -.03em; line-height: 1.05;
}
.fiche-reperes {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: 10px 26px;
}
.fiche-reperes li {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 15px; color: var(--gris);
}
.fiche-reperes .ico { color: var(--bleu); }
.fiche-reperes strong { color: var(--encre); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Corps ---------- */
.fiche-corps {
    display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 40px;
    align-items: stretch; padding-top: 44px; padding-bottom: 56px;
}
/* La colonne latérale occupe toute la hauteur de la section : l'encart
   commercial peut ainsi rester collé pendant tout le défilement. */
.fiche-cote { display: flex; flex-direction: column; height: 100%; }
@media (max-width: 1040px) {
    .fiche-corps { grid-template-columns: 1fr; }
    .fiche-cote { height: auto; }
}
.bloc {
    background: var(--alt); border-radius: var(--rayon);
    padding: 24px 26px; margin-bottom: 20px;
}
.bloc h2 { font-size: 20px; }
.prose p { margin: 0 0 12px; }
.fiche-source { font-size: 13px; color: var(--gris); margin: 14px 0 0; }

/* Bloc « Contacter la mairie » : l'information la plus recherchée */
.bloc-mairie { background: #fff; border: 2px solid var(--bleu); }
.bloc-mairie h2 { display: flex; align-items: center; gap: 9px; color: var(--bleu-fonce); }
.mairie-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 760px) { .mairie-grille { grid-template-columns: 1fr; gap: 18px; } }
.mairie-coord p { display: flex; gap: 10px; align-items: start; margin: 0 0 10px; font-size: 15px; }
.mairie-coord .ico { margin-top: 4px; color: var(--bleu); flex-shrink: 0; }
.mairie-horaires h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; }
.mairie-horaires .ico { color: var(--bleu); }
.mairie-horaires table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.mairie-horaires th {
    text-align: left; font-weight: 550; color: var(--gris); padding: 4px 12px 4px 0;
    white-space: nowrap; vertical-align: baseline;
}
.mairie-horaires td { padding: 4px 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.mairie-note {
    font-size: 13px; color: var(--gris); margin: 10px 0 0;
    display: flex; gap: 7px; align-items: start;
}
.mairie-note .ico { margin-top: 3px; flex-shrink: 0; }

/* Extrait encyclopédique, présenté comme une citation attribuée */
.wiki-extrait {
    margin: 0; padding: 0 0 0 18px; border-left: 3px solid var(--bordure);
}
.wiki-extrait h3 {
    font-size: 15px; margin: 16px 0 6px; color: var(--gris);
    text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.wiki-extrait h3:first-child { margin-top: 0; }
.wiki-extrait p { margin: 0 0 10px; }

.fiche-donnees { margin: 0; display: grid; gap: 2px; }
.fiche-donnees > div {
    display: grid; grid-template-columns: 190px 1fr; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid var(--bordure);
}
.fiche-donnees > div:last-child { border-bottom: none; }
.fiche-donnees dt { color: var(--gris); font-size: 14.5px; }
.fiche-donnees dd { margin: 0; font-weight: 600; }
@media (max-width: 560px) { .fiche-donnees > div { grid-template-columns: 1fr; gap: 0; } }

/* 6 communes en 3 colonnes : deux rangées régulières */
.fiche-voisines {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
@media (max-width: 780px) { .fiche-voisines { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .fiche-voisines { grid-template-columns: 1fr; } }
.fiche-voisines a {
    display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
    background: #fff; border: 1px solid var(--bordure); border-radius: 10px;
    padding: 10px 14px; text-decoration: none; color: inherit; font-weight: 550; font-size: 15px;
    /* Un nom long est tronqué plutôt que de casser la hauteur de la grille */
    white-space: nowrap; overflow: hidden;
}
.fiche-voisines a:hover { border-color: var(--bleu); color: var(--bleu); }
.voisine-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.voisine-cp { color: var(--gris); font-size: 13px; font-weight: 400; flex-shrink: 0; }

/* ---------- Encart commercial ---------- */
/* Encart commercial : collant, à sa hauteur naturelle — ni hauteur maximale ni
   défilement interne, qui tronqueraient l'argumentaire. La mention légale n'est
   donc plus placée dessous mais auprès du formulaire, là où l'on demande
   justement une correction ou un retrait. */
.bloc-offre {
    background: linear-gradient(160deg, var(--bleu-fonce), #1b2f52);
    color: #fff; position: sticky; top: 20px;
}
@media (max-width: 1040px) { .bloc-offre { position: static; } }
.bloc-offre h2 { color: #fff; font-size: 19px; }
.bloc-offre p { font-size: 15px; color: rgba(255, 255, 255, .88); }
/* Le tarif dans son propre cadre : il se détache du texte sans changer de fond,
   la bordure suffit à l'isoler sur le dégradé sombre de l'encart. */
.offre-encart {
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: var(--rayon);
    padding: 14px 18px 16px; margin: 20px 0 18px;
}
/* « À partir de » sur sa propre ligne, discret : le montant reste l'accroche */
.offre-prix { margin: 0 0 4px !important; line-height: 1.15; }
.offre-apartir {
    display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: rgba(255, 255, 255, .6); margin-bottom: 2px;
}
.offre-montant {
    font-size: 46px; font-weight: 750; color: #fff;
    letter-spacing: -.03em; margin-right: 2px;
}
.offre-unite { font-size: 15px; color: rgba(255, 255, 255, .8); }
.offre-detail {
    font-size: 13.5px !important; color: rgba(255, 255, 255, .72) !important;
    margin: 0 !important; line-height: 1.45;
}
/* Juste au-dessus du bouton : lève les deux objections d'un élu — le coût et
   l'engagement — au moment précis où il décide de cliquer. Le filet marque la
   rupture avec l'argumentaire qui précède, sans peser comme une bordure pleine. */
.offre-essai {
    margin: 20px 0 12px !important; padding-top: 18px; text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .18);
    font-size: 15.5px !important; font-weight: 700;
    color: #fff !important;
}
.offre-points {
    list-style: none; margin: 14px 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 12px;
}
/* Deux enfants explicites : sans cela, chaque nœud de texte deviendrait
   lui-même un élément de grille et la mise en page éclaterait. */
.offre-points li {
    display: grid; grid-template-columns: 19px minmax(0, 1fr); gap: 9px; align-items: start;
    font-size: 13.5px; line-height: 1.55; color: rgba(255, 255, 255, .78);
}
.offre-picto { display: flex; padding-top: 3px; opacity: .7; }
.offre-points strong { color: #fff; font-weight: 650; }
.offre-points code, .offre-detail code {
    background: rgba(255, 255, 255, .14); padding: 1px 6px; border-radius: 5px;
    font-size: 12.5px; overflow-wrap: anywhere;
}
.offre-cta {
    display: block; text-align: center; margin-top: 18px; background: #fff; color: var(--bleu-fonce);
    padding: 13px 20px; border-radius: 999px; text-decoration: none; font-weight: 700;
}
.offre-cta:hover { background: #e8eefb; }
/* Site officiel : mis en avant AVANT toute proposition commerciale */
.bloc-officiel { background: #fff; border: 2px solid var(--bordure); }
.bloc-officiel h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; }
.bloc-officiel h2 .ico { color: var(--bleu); }
.bloc-officiel p { font-size: 14.5px; color: var(--gris); margin: 0 0 14px; }
.officiel-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--bleu); color: #fff; padding: 12px 18px; border-radius: 999px;
    text-decoration: none; font-weight: 650; font-size: 15px;
}
.officiel-cta:hover { filter: brightness(1.08); }

.bloc-mention { background: #fff; border: 1px solid var(--bordure); margin-bottom: 0; }
.bloc-mention h2 { font-size: 16px; }
.bloc-mention p { font-size: 14px; color: var(--gris); margin: 0 0 10px; }
.bloc-mention p:last-child { margin-bottom: 0; }

/* Formulaire à gauche, mention légale à droite : elle reste visible au moment
   où l'on remplit une demande de correction ou de retrait.
   Colonne et gouttière identiques à .fiche-corps pour que la mention s'aligne
   exactement sous l'encart commercial. */
.contact-grille {
    display: grid; grid-template-columns: minmax(0, 1fr) 420px;
    gap: 40px; align-items: start;
}
@media (max-width: 1040px) { .contact-grille { grid-template-columns: 1fr; } }

/* ---------- Formulaire ---------- */
.fiche-contact { background: var(--alt); padding: clamp(36px, 5vw, 56px) 0; }
/* Le titre est dans la colonne de gauche : sa marge haute est annulée pour
   qu'il s'aligne sur le bord supérieur de la mention, à droite. */
.fiche-contact h2 { font-size: 26px; margin: 0 0 20px; }
.contact-principal { min-width: 0; }
/* Le formulaire occupe toute la largeur du conteneur : les champs courts
   se répartissent sur une grille souple plutôt que sur deux colonnes fixes. */
.fiche-form { max-width: none; }
/* Deux colonnes maintenues sur grand écran, une seule sur mobile */
.form-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 640px) { .form-grille { grid-template-columns: 1fr; } }
.fiche-form p { margin: 0 0 14px; }
.fiche-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
/* Hauteur strictement identique entre input et select : le select natif
   n'applique pas le padding vertical de la même façon selon le navigateur. */
.fiche-form input, .fiche-form select, .fiche-form textarea {
    width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--bordure);
    border-radius: 10px; font: inherit; background: #fff; color: inherit;
    line-height: normal; appearance: none; -webkit-appearance: none;
}
.fiche-form textarea { height: auto; padding: 12px 14px; }
/* Chevron du select redessiné, puisque l'apparence native est neutralisée */
.fiche-form select {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356606f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 40px; cursor: pointer;
}
.fiche-form input:focus, .fiche-form select:focus, .fiche-form textarea:focus { outline: none; border-color: var(--bleu); }
.fiche-form textarea { resize: none; min-height: 130px; }
.fiche-form button {
    border: none; background: var(--bleu); color: #fff; font: inherit; font-weight: 650; font-size: 15.5px;
    padding: 13px 28px; border-radius: 999px; cursor: pointer;
}
.fiche-form button:hover { filter: brightness(1.08); }
.fiche-rgpd { font-size: 12.5px; color: var(--gris); }
/* Aide contextuelle, affichée seulement quand le motif devient obligatoire */
.champ-aide { display: block; margin-top: 6px; font-size: 12.5px; color: var(--gris); }
.champ-aide[hidden] { display: none; }
.hp { position: absolute !important; left: -9999px; height: 0; overflow: hidden; }
.fiche-retour {
    display: flex; gap: 10px; align-items: center; padding: 13px 16px;
    border-radius: 10px; margin-bottom: 18px; font-weight: 550;
}
.fiche-retour.ok { background: #e5f6ec; color: #166534; }
.fiche-retour.erreur { background: #fdeaea; color: #b42323; }

/* ---------- Pièges à robots du tunnel d'essai ----------
   Cachés sans attribut aria-hidden ni tabindex="-1" — ces marqueurs
   auraient signalé à un bot un peu regardant que le champ est un leurre.
   Le nom de classe reste anodin et le rendu est aplati (dimensions et
   opacité à zéro), le champ reste dans le flux du DOM.
   Nous conservons aussi .hp (utilisé par les autres formulaires publics)
   pour ne rien casser dans les vues existantes. */
.essai-piege {
    position: absolute; width: 0; height: 0; overflow: hidden;
    opacity: 0; pointer-events: none;
}
.essai-piege input { border: 0; }

/* ---------- Engagement du tunnel d'essai ---------- */
/* La case à cocher hérite sinon des dimensions de .fiche-form input
   (width: 100%, height: 48px), qui écrasent la mise en page en collant le
   libellé en colonne étroite à droite. */
.essai-engagement {
    background: var(--alt); padding: 14px 16px; border-radius: 8px; margin: 6px 0 18px;
}
.essai-engagement > label {
    display: flex; gap: 10px; align-items: flex-start;
    font-weight: 400; font-size: 14.5px; line-height: 1.5; margin: 0; cursor: pointer;
}
.essai-engagement input[type="checkbox"] {
    flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0;
    padding: 0; border: 1.5px solid var(--bordure); border-radius: 4px;
    appearance: auto; -webkit-appearance: auto; accent-color: var(--bleu);
}

/* ---------- Pied ---------- */
.fiche-pied { background: var(--bleu-fonce); color: rgba(255, 255, 255, .82); padding: 28px 0; }
.fiche-pied p { margin: 0 0 6px; font-size: 14.5px; }
.fiche-pied strong { color: #fff; }
.fiche-pied-mention { font-size: 13px; color: rgba(255, 255, 255, .58); }
