/*
 * Bêta et « Donner mon avis ».
 * Feuille autonome : un en-tête redessiné n'a qu'à garder un bouton
 * [data-retours-ouvrir] et l'étiquette .etiquette-beta pour hériter du parcours.
 * Identité Polideo (lot 9B) : jetons de portail.css, action violette, arrondis
 * discrets. Le contrat du parcours 9A est inchangé.
 */
.etiquette-beta {
  display: inline-block;
  font-size: var(--t-12);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .02em;
  padding: var(--e-1) var(--e-2);
  border: 1px solid transparent;
  border-radius: var(--r-s);
  color: var(--action, #5148d8);
  background: var(--teinte, #f4f3ff);
  vertical-align: middle;
  white-space: nowrap;
}
.entete .etiquette-beta { align-self: center; }

.bouton-avis {
  font: inherit;
  font-size: var(--t-15);
  line-height: 1.2;
  min-height: 38px;
  padding: var(--e-2) var(--e-4);
  border: 1px solid var(--trait-forte, #c4c5d0);
  border-radius: var(--r-pilule, 999px);
  background: var(--fond, #fff);
  color: var(--texte, #171717);
  cursor: pointer;
  white-space: nowrap;
}
.bouton-avis:hover { background: var(--survol, #f5f5f5); }
.bouton-avis:focus-visible { outline: 2px solid var(--accent, #0b5fd0); outline-offset: 2px; }
.bouton-avis__court { display: none; }

/* ---- Boîte de dialogue ---- */
.retours {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: var(--e-6);
  border: 1px solid var(--trait, #e6e6ee);
  border-radius: var(--r-l);
  background: var(--fond, #fff);
  color: var(--texte, #171717);
}
.retours::backdrop { background: rgba(32, 33, 42, .38); }
.retours__entete { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e-4); margin-bottom: var(--e-4); }
.retours__titre { font-size: var(--t-21); margin: 0; }
.retours__contexte { margin: var(--e-1) 0 0; font-size: var(--t-15); color: var(--texte-doux, #525252); overflow-wrap: anywhere; }
.retours__fermer {
  font: inherit; font-size: var(--t-27); line-height: 1;
  width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: var(--r-s);
  background: transparent; color: var(--texte-doux, #525252); cursor: pointer;
}
.retours__fermer:hover { background: var(--survol, #f5f5f5); color: var(--texte, #171717); }
.retours__formulaire { display: grid; gap: var(--e-4); }
.retours__formulaire[hidden] { display: none; }
.retours__choix { border: 0; margin: 0; padding: 0; min-width: 0; }
.retours__choix legend { font-size: var(--t-15); font-weight: 600; padding: 0; margin-bottom: var(--e-2); }
.retours__options { display: flex; flex-wrap: wrap; gap: var(--e-2); }
.retours__option {
  display: inline-flex; align-items: center; gap: var(--e-2);
  padding: var(--e-2) var(--e-3); border: 1px solid var(--controle, #858797); border-radius: var(--r-pilule, 999px);
  font-size: var(--t-15); cursor: pointer;
}
.retours__option:has(input:checked) { border-color: var(--action, #5148d8); color: var(--action, #5148d8); background: var(--teinte, #f4f3ff); font-weight: 600; }
.retours__option input { margin: 0; accent-color: var(--action, #5148d8); }
.retours__champ { display: grid; gap: var(--e-1); }
/* Objectif de la visite (lot 11A) : replié par défaut, même vocabulaire visuel. */
.retours__objectif { border: 1px solid var(--trait, #e6e6ee); border-radius: var(--r-m, 10px); padding: 0 var(--e-3); }
.retours__objectif > summary { cursor: pointer; padding: var(--e-3) 0; font-size: var(--t-15); font-weight: 600; list-style-position: inside; }
.retours__objectif > summary:focus-visible { outline: 2px solid var(--accent, #0b5fd0); outline-offset: 2px; }
.retours__objectif[open] > summary { border-bottom: 1px solid var(--trait, #e6e6ee); }
.retours__objectif-corps { display: grid; gap: var(--e-4); padding: var(--e-3) 0 var(--e-4); }
.retours__champ select,
.retours__champ input[type="text"] {
  width: 100%; min-width: 0; max-width: 100%;
  border: 1px solid var(--controle, #858797); border-radius: var(--r-m, 10px);
  padding: var(--e-2) var(--e-3); font: inherit; font-size: var(--t-17); line-height: 1.4;
  background: #fff; color: var(--texte, #171717);
}
.retours__champ select:focus, .retours__champ input[type="text"]:focus { border-color: var(--action, #5148d8); }
.retours__champ label { font-size: var(--t-15); font-weight: 600; }
.retours__facultatif { font-weight: 400; color: var(--texte-doux, #525252); }
.retours__champ textarea {
  width: 100%; min-width: 0; min-height: 76px; resize: vertical;
  border: 1px solid var(--controle, #858797); border-radius: var(--r-m, 10px);
  padding: var(--e-2) var(--e-3); font: inherit; font-size: var(--t-17); line-height: 1.5;
  background: #fff; color: var(--texte, #171717);
}
.retours__champ textarea:focus { border-color: var(--action, #5148d8); }
.retours__compteur { font-size: var(--t-13); color: var(--texte-doux, #525252); min-height: 0; }
.retours__compteur:empty { display: none; }
.retours__confidentialite { margin: 0; font-size: var(--t-13); line-height: 1.5; color: var(--texte-doux, #525252); }
.retours__message { margin: 0; font-size: var(--t-15); }
.retours__message--erreur { color: var(--erreur, #a12222); }
.retours__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2); }
/* Bouton principal du formulaire, identique sur toutes les pages : `.bouton--noir`
   n'est défini que par espaces.css, que les outils et les rubriques ne chargent pas. */
.retours .bouton--noir { background: var(--action, #5148d8); color: #fff; border-color: var(--action, #5148d8); }
.retours .bouton--noir:hover { background: var(--action-survol, #4037b8); color: #fff; }
.retours .bouton--noir[disabled] { background: var(--fond, #fff); color: var(--texte-tenu, #8a8a8a); border-color: var(--trait, #e7e7e7); cursor: default; }
.retours__confirmation { display: grid; gap: var(--e-4); }
.retours__merci { margin: 0; font-size: var(--t-17); line-height: 1.5; }
.retours__merci:focus { outline: none; }
.retours__merci:focus-visible { outline: 2px solid var(--accent, #0b5fd0); outline-offset: 4px; }

@media (max-width: 700px) {
  /* Sur mobile, l'avis rejoint la rangée de navigation plutôt que d'ouvrir une
     rangée de plus dans l'en-tête : l'actualité garde son premier écran. */
  .entete__rangee .navigation { width: auto; flex: 1 1 auto; }
  .entete__rangee .bouton-avis { order: 4; margin-inline-start: auto; }
  .bouton-avis { padding: var(--e-1) var(--e-2); font-size: var(--t-13); }
  .bouton-avis__long { display: none; }
  .bouton-avis__court { display: inline; }
  .retours { padding: var(--e-4) var(--e-4); margin-block-end: var(--e-3); }
  .retours__titre { font-size: var(--t-21); }
}
/* Écrans intermédiaires (tablette) : marque, Bêta et recherche sur la première
   rangée ; navigation et avis sur la seconde, au lieu d'un bouton isolé. */
@media (min-width: 701px) and (max-width: 1000px) {
  .entete__rangee .navigation { order: 3; flex: 1 1 60%; margin-inline-start: 0; }
  .entete__rangee .recherche { margin-inline-start: auto; }
  .entete__rangee .bouton-avis { order: 4; }
}
/* Très petits écrans : marque, Bêta et avis sur la première rangée, recherche
   pleine largeur, puis navigation — trois rangées au lieu de quatre. */
@media (max-width: 360px) {
  .entete__rangee .bouton-avis { order: 2; margin-inline-start: auto; }
  .entete__rangee .recherche { order: 3; flex: 1 1 100%; max-width: none; margin-inline-start: 0; }
  .entete__rangee .navigation { order: 4; }
}
@media print { .bouton-avis, .retours { display: none; } }
