/* Plateforme publique du cadastre solaire.
   Contrastes conformes au RGAA, aucune police distante, aucune image décorative. */

:root {
  --navy: #0F2942;
  --or: #D2961F;
  --encre: #14202b;
  --gris: #5b6b7a;
  --trait: #d7dee5;
  --fond: #f4f6f8;
  --blanc: #fff;
  --faible: #2b83ba;
  --moyen: #d98c1e;
  --fort: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--encre);
  background: var(--fond);
  line-height: 1.55;
}

.evitement {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: .6rem 1rem; z-index: 2000;
}
.evitement:focus { left: 0; }

.bandeau {
  background: var(--navy); color: #fff; padding: .9rem 1.2rem;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.titre { display: flex; align-items: center; gap: .8rem; }
.marque { font-size: 1.9rem; color: var(--or); }
.bandeau h1 { font-size: 1.25rem; margin: 0; }
.sous-titre { margin: 0; font-size: .88rem; color: #c8d4de; }

.bandeau nav { display: flex; flex-wrap: wrap; gap: .3rem; }
.onglet {
  background: transparent; color: #dce6ee; border: 1px solid transparent;
  padding: .45rem .8rem; border-radius: 4px; cursor: pointer; font-size: .92rem;
}
.onglet:hover { background: rgba(255, 255, 255, .12); }
.onglet:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.onglet.actif { background: #fff; color: var(--navy); font-weight: 600; }

main { max-width: 1400px; margin: 0 auto; padding: 1rem; }
.vue { display: none; }
.vue.active { display: block; }
#vue-carte.active { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1rem; }

.colonne-carte { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
#carte { height: 62vh; min-height: 380px; border-radius: 6px; border: 1px solid var(--trait); }

.recherche { background: var(--blanc); border: 1px solid var(--trait); border-radius: 6px; padding: .8rem; position: relative; }
.recherche label { font-weight: 600; display: block; margin-bottom: .35rem; }
.recherche .ligne { display: flex; gap: .5rem; }
.recherche input[type=search] { flex: 1; padding: .55rem .7rem; border: 1px solid var(--trait); border-radius: 4px; font-size: 1rem; }
.recherche button, .formulaire button, .action {
  background: var(--navy); color: #fff; border: 0; border-radius: 4px;
  padding: .55rem 1rem; cursor: pointer; font-size: .95rem;
}
.recherche button:hover, .formulaire button:hover, .action:hover { background: #1b3a5c; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--or); outline-offset: 2px;
}

.propositions {
  list-style: none; margin: .4rem 0 0; padding: 0; position: absolute; left: .8rem; right: .8rem;
  background: #fff; border: 1px solid var(--trait); border-radius: 4px; z-index: 900; max-height: 260px; overflow: auto;
}
.propositions li button {
  display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--encre);
  padding: .5rem .7rem; cursor: pointer; font-size: .93rem;
}
.propositions li button:hover { background: #eef3f7; }

.legende {
  background: var(--blanc); border: 1px solid var(--trait); border-radius: 6px; padding: .55rem .8rem;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; font-size: .88rem;
}
.titre-legende { font-weight: 600; }
.graduation { display: inline-flex; align-items: center; gap: .35rem; }
.pastille { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.pastille.faible { background: var(--faible); }
.pastille.moyen { background: var(--moyen); }
.pastille.fort { background: var(--fort); }
.legende .fond { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.legende select { padding: .3rem; border: 1px solid var(--trait); border-radius: 4px; }

.carte-blanche { background: var(--blanc); border: 1px solid var(--trait); border-radius: 6px; padding: 1rem; }
.carte-blanche.large { max-width: 900px; margin: 0 auto; }
.carte-blanche h2 { margin-top: 0; font-size: 1.1rem; color: var(--navy); }
.marche { padding-left: 1.2rem; }
.marche li { margin-bottom: .4rem; }
.discret { color: var(--gris); font-size: .87rem; }

.colonne-fiche { min-width: 0; }
.bloc { margin-bottom: 1rem; }
.bloc h3 { font-size: .95rem; margin: 0 0 .5rem; color: var(--navy); text-transform: uppercase; letter-spacing: .02em; }

table.donnees { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.donnees th, table.donnees td { text-align: left; padding: .32rem .2rem; border-bottom: 1px solid var(--trait); }
table.donnees th { font-weight: 500; color: var(--gris); }
table.donnees td { text-align: right; font-variant-numeric: tabular-nums; }

.formulaire { display: grid; gap: .7rem; margin: .8rem 0; }
.champ { display: grid; grid-template-columns: 1fr auto; gap: .4rem; align-items: center; }
.champ label { grid-column: 1 / -1; font-weight: 500; font-size: .92rem; }
.champ input, .champ select { padding: .45rem .6rem; border: 1px solid var(--trait); border-radius: 4px; font-size: .95rem; }
.champ .unite { color: var(--gris); font-size: .9rem; }

.resultat-cle { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin: .8rem 0; }
.chiffre { background: #f0f4f8; border-radius: 6px; padding: .6rem; text-align: center; }
.chiffre .valeur { font-size: 1.35rem; font-weight: 700; color: var(--navy); display: block; }
.chiffre .quoi { font-size: .78rem; color: var(--gris); }

.jauge { padding: .5rem .8rem; border-radius: 4px; font-weight: 600; text-align: center; margin: .6rem 0; }
.jauge.favorable { background: #e3f3e6; color: #1d6b2c; }
.jauge.moyenne { background: #fdf1dd; color: #8a5a09; }
.jauge.defavorable { background: #fbe6e4; color: #96271c; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.action.secondaire { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.action.secondaire:hover { background: #eef3f7; }

.alerte { background: #fdf1dd; border-left: 4px solid var(--or); padding: .6rem .8rem; margin: .7rem 0; font-size: .9rem; }
.contrainte { border-left: 4px solid var(--fort); background: #fbe6e4; padding: .6rem .8rem; margin: .5rem 0; font-size: .9rem; }
.contrainte a { color: #96271c; }

details.replie { border-top: 1px solid var(--trait); padding-top: .5rem; margin-top: .8rem; }
details.replie summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--navy); }
details.replie table { margin-top: .5rem; font-size: .84rem; }

.page-texte { max-width: 820px; margin: 0 auto; }
.page-texte article { background: var(--blanc); border: 1px solid var(--trait); border-radius: 6px; padding: 1.2rem; margin-bottom: 1rem; }
.page-texte h2 { margin-top: 0; color: var(--navy); font-size: 1.15rem; }
.page-texte p { white-space: pre-line; }

.pied { background: var(--navy); color: #c8d4de; padding: 1rem 1.2rem; font-size: .84rem; margin-top: 1.5rem; }
.pied p { margin: .3rem 0; }
.pied a { color: #fff; }

.message { padding: .6rem .8rem; border-radius: 4px; margin: .6rem 0; font-size: .9rem; }
.message.bon { background: #e3f3e6; color: #1d6b2c; }
.message.mauvais { background: #fbe6e4; color: #96271c; }

@media (max-width: 980px) {
  #vue-carte.active { grid-template-columns: 1fr; }
  #carte { height: 48vh; }
}

/* Le sélecteur de fichier natif affiche un libellé dans la langue du navigateur :
   il reste accessible au clavier, mais derrière un bouton rédigé en français. */
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; }
.groupe-fichier { display: flex; align-items: center; gap: .6rem; position: relative; grid-column: 1 / -1; }
