/*
 * 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: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .02em;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  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: 14px;
  line-height: 1.2;
  min-height: 38px;
  padding: 8px 15px;
  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: 28px;
  border: 1px solid var(--trait, #e6e6ee);
  border-radius: 22px;
  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: 16px; margin-bottom: 18px; }
.retours__titre { font-size: 21px; margin: 0; }
.retours__contexte { margin: 6px 0 0; font-size: 14px; color: var(--texte-doux, #525252); overflow-wrap: anywhere; }
.retours__fermer {
  font: inherit; font-size: 24px; line-height: 1;
  width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: 6px;
  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: 18px; }
.retours__formulaire[hidden] { display: none; }
.retours__choix { border: 0; margin: 0; padding: 0; min-width: 0; }
.retours__choix legend { font-size: 15px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.retours__options { display: flex; flex-wrap: wrap; gap: 8px; }
.retours__option {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--controle, #858797); border-radius: var(--r-pilule, 999px);
  font-size: 15px; 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: 6px; }
.retours__champ label { font-size: 15px; 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: 10px 12px; font: inherit; font-size: 16px; line-height: 1.5;
  background: #fff; color: var(--texte, #171717);
}
.retours__champ textarea:focus { border-color: var(--action, #5148d8); }
.retours__compteur { font-size: 13px; color: var(--texte-doux, #525252); min-height: 0; }
.retours__compteur:empty { display: none; }
.retours__confidentialite { margin: 0; font-size: 13px; line-height: 1.5; color: var(--texte-doux, #525252); }
.retours__message { margin: 0; font-size: 15px; }
.retours__message--erreur { color: var(--erreur, #a12222); }
.retours__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* 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: 18px; }
.retours__merci { margin: 0; font-size: 17px; 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: 5px 8px; font-size: 13px; }
  .bouton-avis__long { display: none; }
  .bouton-avis__court { display: inline; }
  .retours { padding: 18px 16px; margin-block-end: 12px; }
  .retours__titre { font-size: 19px; }
}
/* É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; } }
