/**
 * Recherche et consultation du rôle d'évaluation.
 * Styles isolés du thème (déplacés depuis szm/_layouts.scss).
 * Bloc : szmclient_role_evaluation.
 *
 * Les sélecteurs sont ancrés sur la classe racine .role-eval-search (toujours
 * présente sur le wrapper du template), pas sur un id de formulaire.
 */

/* ───────────────────────── Conteneurs ───────────────────────── */
#block-szm-cerveaumunicipalrechercheroleevaluation {
  margin: 0 auto;
}

.role-eval-search {
  margin-bottom: 1.5rem;
}

.role-eval-search__intro {
  margin-bottom: 0.75rem;
}

/* ──────────── Barre horizontale : sélecteur + champs + bouton ──────────── */
.role-eval-search__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 2.5rem;
  margin-bottom: 1.75rem;
}

/* ──────────────── Type de recherche : pilules segmentées ──────────────── */
.role-eval-search__types fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.role-eval-search__types legend {
  float: none;
  width: auto;
  margin: 0 0 0.4rem;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.85;
}

.role-eval-search__types .fieldset-wrapper {
  margin: 0;
}

.role-eval-search__types .form-radios {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.role-eval-search__types .form-radios .form-item {
  margin: 0;
}

/* Le rond natif est masqué : le label devient une pilule cliquable. */
.role-eval-search__types .form-radios .form-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.role-eval-search__types .form-radios label.option {
  display: block;
  margin: 0;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.role-eval-search__types .form-radios label.option:hover {
  background: rgba(255, 255, 255, 0.15);
}

.role-eval-search__types .form-radios .form-radio:checked + label.option {
  background: var(--bs-white, #fff);
  color: var(--bs-blue, #003471);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.role-eval-search__types .form-radios .form-radio:focus-visible + label.option {
  outline: 2px solid var(--bs-white, #fff);
  outline-offset: 2px;
}

/* ──────────────── Champs + bouton ──────────────── */
.role-eval-search__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
}

.role-eval-search__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0;
  flex: 1 1 auto;
}

/* Sous-groupe adresse (numéro + rue) sur la même ligne. */
.role-eval-search #edit-adresse-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0;
}

/* Largeurs maîtrisées : on évite les champs pleine largeur. */
.role-eval-search__fields .form-item {
  position: relative;
  margin: 0;
  max-width: 100%;
}

.role-eval-search .form-item-matricule {
  width: 16rem;
}

.role-eval-search .form-item-lot {
  width: 16rem;
}

.role-eval-search .form-item-adresse-group-num-civique {
  width: 8rem;
}

.role-eval-search .form-item-adresse-group-rue {
  flex: 1 1 16rem;
  min-width: 13rem;
  max-width: 22rem;
}

.role-eval-search__fields label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.role-eval-search__fields .form-control,
.role-eval-search__fields .form-select {
  width: 100%;
}

/* La description passe en absolu : elle n'augmente pas la hauteur du champ,
   ce qui garde le bouton aligné sur l'input (et non sous la description). */
.role-eval-search .form-item-matricule .description,
.role-eval-search .form-item-lot .description {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0.8;
}

/* Bouton « Chercher » aligné au bas des champs (donc sur l'input). */
.role-eval-search__actions,
.role-eval-search__actions .form-actions {
  margin: 0;
}

.role-eval-search__actions .form-actions {
  display: flex;
}

.role-eval-search__actions .button,
.role-eval-search__actions [type="submit"] {
  margin: 0;
  white-space: nowrap;
}

/* ───────────────────────── Résultat / fiche ───────────────────────── */
.role-eval-search__result:empty {
  display: none;
}

#role-evaluation-result-wrapper {
  transition: all 0.3s ease-in-out;
  font-family: var(--bs-body-font-family), sans-serif;
}

#role-evaluation-result-wrapper .card {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

#role-evaluation-result-wrapper th {
  width: 45%;
  color: var(--bs-body-color);
  font-weight: 600;
}

#role-evaluation-result-wrapper td {
  color: var(--bs-body-color);
}

.role-eval-fiche th {
  width: 45%;
}

/* ───────────────────────── Statistiques ───────────────────────── */
.role-eval-stats-wrapper {
  margin-top: 1.25rem;
}

.role-eval-stats th {
  font-weight: 600;
}
