/* ==========================================================================
   FORMULAIRES — champs, listes déroulantes, cases à cocher, mot de passe
   ========================================================================== */

.champ { display: grid; gap: var(--e-2); }
.champ__libelle { font-size: var(--t-1); font-weight: 700; color: var(--md-encre); }
.champ__groupe { position: relative; display: flex; }

.champ__saisie,
.liste-deroulante {
  width: 100%; height: 50px; padding: 0 var(--e-4);
  border: var(--trait-1) solid var(--md-trait-2); border-radius: var(--rayon-1);
  background-color: var(--md-papier); color: var(--md-encre); font-size: var(--t-2);
  transition: border-color var(--duree-1) var(--courbe), box-shadow var(--duree-1) var(--courbe);
}
.champ__saisie::placeholder { color: var(--md-encre-3); }
.champ__saisie:hover, .liste-deroulante:hover { border-color: var(--md-encre-3); }
.champ__saisie:focus, .liste-deroulante:focus { outline: none; border-color: var(--md-encre); box-shadow: 0 0 0 3px var(--marque-trait); }

/* mot de passe : l'œil vit dans le champ */
.champ__groupe .champ__saisie { padding-right: 52px; }
.champ__oeil {
  position: absolute; top: 4px; right: 4px; bottom: 4px; width: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--rayon-1); background: transparent; color: var(--md-encre-3); cursor: pointer;
}
.champ__oeil:hover, .champ__oeil[aria-pressed="true"] { background: var(--md-papier-2); color: var(--md-encre); }

.liste-deroulante {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='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 12px center; background-size: 18px;
}
.liste-deroulante--compacte { height: 42px; font-size: var(--t-1); }

.case { display: inline-flex; align-items: center; gap: var(--e-2); color: var(--md-encre-2); font-size: var(--t-1); cursor: pointer; }
.case input { width: 18px; height: 18px; margin: 0; accent-color: var(--nuit); cursor: pointer; }
.case__n { margin-left: auto; font-family: var(--f-mono); font-size: var(--t-0); color: var(--md-encre-3); }

/* ------------------------------------------------- liste de choix avec recherche
   design.js remplace l'affichage des <select class="liste-deroulante"> : bouton
   + panneau avec champ de recherche. Le <select> reste dans la page, masqué. */
.choix { position: relative; display: block; width: 100%; }
.choix__natif { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choix__bouton { display: flex; align-items: center; text-align: left; line-height: 1.2; }
.choix__valeur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix.est-ouvert .choix__bouton { border-color: var(--md-encre); box-shadow: 0 0 0 3px var(--marque-trait); }
.choix__panneau {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  min-width: 100%; width: max-content; max-width: min(420px, calc(100vw - 32px));
  padding: var(--e-2); background: var(--md-papier);
  border: var(--trait-1) solid var(--md-trait-2); border-radius: var(--rayon-2); box-shadow: var(--ombre-2);
}
.choix__panneau.a-droite { left: auto; right: 0; }
.site .choix .choix__recherche, .choix__recherche {
  min-height: 0;
  width: 100%; height: 40px; margin-bottom: var(--e-2); padding: 0 var(--e-3) 0 36px;
  border: var(--trait-1) solid var(--md-trait-2); border-radius: var(--rayon-1);
  background: var(--md-papier-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E") no-repeat 12px center / 16px;
  color: var(--md-encre); font-size: var(--t-1);
}
.site .choix .choix__recherche:focus, .choix__recherche:focus { outline: none; border-color: var(--md-encre); background-color: var(--md-papier); }
.choix__liste { max-height: 300px; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.choix__option {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e-3);
  padding: var(--e-2) var(--e-3); border-radius: var(--rayon-1);
  color: var(--md-encre-2); font-size: var(--t-1); cursor: pointer;
}
.choix__option.est-actif { background: var(--marque-voile); color: var(--md-encre); }
.choix__option[aria-selected="true"] { color: var(--md-encre); font-weight: 700; }
.choix__option[aria-selected="true"]::after {
  content: ""; flex: none; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") no-repeat center / contain;
}
.choix__option[aria-disabled="true"] { color: var(--md-encre-3); cursor: default; }
.choix__vide { margin: var(--e-2) var(--e-3); color: var(--md-encre-3); font-size: var(--t-1); }
