/**
 * Sélecteur d'entreprise — habillage de fcg-entreprise-picker.js
 *
 * Même grammaire que fcg-address-autocomplete.css :
 *  — contrastes ≥ 4,5:1 sur tous les textes ;
 *  — options d'au moins 44 px de haut (confort tactile) ;
 *  — état actif visible au clavier autant qu'à la souris ;
 *  — respect de prefers-reduced-motion.
 */

.fcg-ep {
  position: relative;
}

/* ── Liste de suggestions ─────────────────────────────────────────────── */
.fcg-ep__list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cfdae7;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 28, 46, 0.16);
  -webkit-overflow-scrolling: touch;
}
.fcg-ep__list[hidden] {
  display: none;
}

.fcg-ep__list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.35;
}
.fcg-ep__list li:hover,
.fcg-ep__list li.is-active {
  background: #eaf3fb;
}
/* Barre latérale : repère l'option courante sans compter uniquement sur la couleur */
.fcg-ep__list li.is-active {
  box-shadow: inset 3px 0 0 #12557f;
}

.fcg-ep__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f1c2e;
}
.fcg-ep__main mark {
  background: transparent;
  color: #12557f;
  font-weight: 800;
}
.fcg-ep__enseigne {
  font-weight: 500;
  color: #556475;
}
.fcg-ep__enseigne::before {
  content: "— ";
}
.fcg-ep__sub {
  font-size: 0.8rem;
  color: #556475;
}

/* ── Badges « Siège » / « Fermé » ─────────────────────────────────────── */
.fcg-ep__badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.fcg-ep__badge--siege {
  background: #e3f1ea;
  color: #1d6b3f;
}
.fcg-ep__badge--ferme {
  background: #fbe7e7;
  color: #9b2226;
}

/* ── Message d'état (également annoncé aux lecteurs d'écran) ───────────── */
.fcg-ep__status {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #556475;
  min-height: 1em;
}
.fcg-ep__status:empty {
  margin: 0;
  min-height: 0;
}

.fcg-ep__msg {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  background: #f3f6fa;
  color: #33475b;
}
.fcg-ep__msg[hidden] {
  display: none;
}
.fcg-ep__msg--ok {
  background: #e3f1ea;
  color: #1d6b3f;
}
.fcg-ep__msg--info {
  background: #fff6e0;
  color: #7a4e00;
}

/* ── Carte de l'entreprise choisie ────────────────────────────────────── */
.fcg-ep__card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid #cfdae7;
  border-left: 4px solid #12557f;
  border-radius: 10px;
  background: #fff;
}
.fcg-ep__card[hidden] {
  display: none;
}
.fcg-ep__card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fcg-ep__card-nom {
  font-size: 0.98rem;
  color: #0f1c2e;
  overflow-wrap: anywhere;
}
.fcg-ep__card-meta {
  font-size: 0.8rem;
  color: #556475;
}
.fcg-ep__card-adresse {
  margin-top: 4px;
  font-size: 0.88rem;
  color: #33475b;
  line-height: 1.4;
}
.fcg-ep__edit,
.fcg-ep__manual {
  flex: none;
  padding: 6px 10px;
  border: 1px solid #cfdae7;
  border-radius: 8px;
  background: #fff;
  color: #12557f;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.fcg-ep__edit:hover,
.fcg-ep__manual:hover,
.fcg-ep__edit:focus-visible,
.fcg-ep__manual:focus-visible {
  background: #eaf3fb;
  border-color: #12557f;
  outline: none;
}
.fcg-ep__manual {
  margin-top: 8px;
}

/* ── Champs remplis depuis le registre : verrouillés mais lisibles ─────── */
.is-locked {
  background-color: #f3f6fa !important;
  color: #33475b;
  cursor: default;
}

/* ── Autre établissement ──────────────────────────────────────────────── */
.fcg-ep__etabs {
  margin: 8px 0 0;
}
.fcg-ep__etabs[hidden] {
  display: none;
}
.fcg-ep__details {
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  padding: 0 14px;
  background: #fafcfe;
}
.fcg-ep__details summary {
  padding: 10px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #12557f;
  cursor: pointer;
}
.fcg-ep__details[open] summary {
  border-bottom: 1px solid #e1e8f0;
}
.fcg-ep__note {
  margin: 10px 0 6px;
  font-size: 0.8rem;
  color: #556475;
}
.fcg-ep__radios {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 10px;
}
.fcg-ep__radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.fcg-ep__radio:hover {
  background: #eaf3fb;
}
.fcg-ep__radio input {
  margin-top: 3px;
  flex: none;
}
.fcg-ep__radio span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.88rem;
  color: #0f1c2e;
}
.fcg-ep__radio strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.fcg-ep__radio small {
  font-size: 0.8rem;
  color: #556475;
}

@media (prefers-reduced-motion: no-preference) {
  .fcg-ep__list li,
  .fcg-ep__edit,
  .fcg-ep__manual,
  .fcg-ep__radio {
    transition: background-color 120ms ease-out, border-color 120ms ease-out;
  }
}
