/* ============================================================
   Reglages & Profil — langage visuel iOS (groupes inset, lignes
   44px, chevrons, sections pliables). Consomme uniquement les
   tokens de variables.css.
   ============================================================ */

/* Groupe : liste inset arrondie, une seule bordure fine. */
.set-group {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

/* Ligne : hauteur tap 44px min, libelle a gauche, valeur/chevron a droite. */
.set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.set-row:last-child {
    border-bottom: none;
}

.set-row:hover {
    background: var(--surface2);
}

.set-row-label {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.set-row-value {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}

.set-row-chevron {
    flex: none;
    display: inline-flex;
    color: var(--muted2, var(--muted));
}

/* Section pliable : l'en-tete porte un chevron qui tourne. */
.set-fold-head {
    user-select: none;
}

.set-fold-caret {
    flex: none;
    display: inline-flex;
    color: var(--muted);
    transition: transform var(--dur-fast) var(--ease-out);
}

.set-fold-head.open .set-fold-caret {
    transform: rotate(90deg);
}

.set-fold-body {
    padding: 4px 14px 12px;
}

.set-fold-body[hidden] {
    display: none;
}

/* Ligne danger (deconnexion, purge) : texte rouge, centre facon iOS. */
.set-row--danger .set-row-label {
    color: var(--red);
    text-align: center;
    font-weight: 600;
}

/* Bloc de liens de la page Profil (vers Reglages). */
.profile-links {
    margin-top: 4px;
}

/* Cartes pliables de la page Reglages : l'en-tete devient le toggle. */
#page-settings .card-header.set-fold-head {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#page-settings .card-header.set-fold-head .set-fold-caret {
    margin-left: auto;
}

#page-settings .card.set-folded .card-body {
    display: none;
}

#page-settings .card.set-folded {
    margin-bottom: 10px;
}

/* ─── Zone de danger du profil (suppression de compte) ───
   Volontairement sobre : un bord rouge et un bouton rouge, pas un bloc
   entierement rouge. L'action est grave, l'ecran n'a pas besoin de crier. */
.danger-zone {
    border-color: var(--red);
}

.danger-zone .card-title {
    color: var(--red);
}

.danger-zone-text {
    font-size: var(--text-sm);
    color: var(--muted);
    line-height: var(--leading-loose);
    margin-bottom: 14px;
}

.danger-zone-input {
    width: 100%;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-code);
}

.danger-zone-error {
    display: none;
    font-size: var(--text-xs);
    color: var(--red);
    margin-bottom: 10px;
}

.danger-zone-error.show {
    display: block;
}

.danger-zone-btn {
    width: 100%;
    padding: 12px 18px;
    background: var(--red);
    border: 1.5px solid var(--red);
    border-radius: var(--radius);
    color: var(--on-primary);
    font-family: var(--font-display);
    font-weight: var(--weight-emphasis);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: opacity var(--dur-fast) var(--ease-out);
}

.danger-zone-btn:hover {
    opacity: .9;
}

/* Annuler une suppression n'est pas une action dangereuse : bouton neutre. */
.danger-zone-btn--calme {
    background: none;
    border-color: var(--border);
    color: var(--text);
}

/* ── Ma formation (Profil) : trois lignes facon reglages iOS ────────────── */
.formation {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  overflow: hidden;
}

.formation-ligne,
.choix-ligne {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.formation-ligne + .formation-ligne,
.choix-ligne + .choix-ligne {
  border-top: 1px solid var(--border);
}

.formation-ligne:active,
.choix-ligne:active {
  background: var(--surface2);
}

.formation-ligne:focus-visible,
.choix-ligne:focus-visible,
.choix-parcours__btn:focus-visible,
.choix-semestre:focus-visible {
  outline: 2px solid var(--green3);
  outline-offset: -2px;
}

.formation-ligne__texte,
.choix-ligne__texte {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.formation-ligne__titre {
  font-size: var(--text-xs);
  color: var(--muted);
}

.formation-ligne__valeur,
.choix-ligne__titre {
  font-size: var(--text-md);
  font-weight: var(--weight-emphasis);
  overflow-wrap: anywhere;
}

.formation-ligne__valeur--vide {
  color: var(--green-text);
}

.formation-ligne__chevron,
.choix-ligne > .upte-icon:last-child {
  flex: 0 0 auto;
  color: var(--muted2);
}

/* ── Feuille de choix du parcours ─────────────────────────────────────── */
.choix-parcours__tete {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 calc(var(--space-5) * -1) var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.choix-parcours__titre {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-heading);
  text-align: center;
}

.choix-parcours__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--tap-min);
  height: var(--tap-min);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.choix-parcours__btn:active {
  background: var(--surface2);
}

.choix-contexte {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
}

.choix-recherche {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  margin-bottom: var(--space-3);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--muted);
}

.choix-recherche input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap-min);
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--text-md);
  outline: none;
}

.choix-liste {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  overflow: hidden;
}

.choix-ligne__sous {
  font-size: var(--text-sm);
  color: var(--muted);
}

.choix-ligne--choisie {
  background: var(--green-dim);
}

.choix-ligne--choisie > .upte-icon:last-child {
  color: var(--green-text);
}

.choix-badge {
  display: inline-block;
  margin-left: var(--space-1);
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-body);
  vertical-align: middle;
}

.choix-note,
.choix-aide {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.choix-vide {
  padding: var(--space-5) var(--space-4);
  text-align: center;
}

.choix-vide__titre {
  margin: 0 0 var(--space-1);
  font-weight: var(--weight-emphasis);
}

.choix-vide__texte {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.choix-squelette {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.choix-squelette span {
  height: var(--tap-min);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  animation: choix-pulse var(--dur-flip) var(--ease-out) infinite alternate;
}

@keyframes choix-pulse {
  from { opacity: 1; }
  to { opacity: .5; }
}

.choix-annee {
  margin-bottom: var(--space-4);
}

.choix-annee__titre {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
}

.choix-annee__puces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.choix-semestre {
  min-height: var(--tap-min);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-weight: var(--weight-emphasis);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.choix-semestre:active,
.choix-semestre--choisi {
  border-color: var(--green3);
  background: var(--green-dim);
}

.choix-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.choix-champ {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
}

.choix-etiquette {
  padding: 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.choix-puces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choix-puce {
  position: relative;
  display: inline-flex;
}

.choix-puce input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choix-puce span {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg2);
  font-size: var(--text-sm);
  cursor: pointer;
}

.choix-puce input:checked + span {
  border-color: var(--green3);
  background: var(--green-dim);
  font-weight: var(--weight-emphasis);
}

.choix-puce input:focus-visible + span {
  outline: 2px solid var(--green3);
}

.choix-saisie {
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text);
  font-size: var(--text-md);
}

.choix-pas {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.choix-pas .choix-parcours__btn {
  background: var(--bg2);
}

.choix-pas__valeur {
  min-width: 120px;
  font-weight: var(--weight-emphasis);
  text-align: center;
}

.choix-erreur {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--red);
}

.choix-cta {
  min-height: var(--tap-min);
}

@media (prefers-reduced-motion: reduce) {
  .choix-squelette span { animation: none; }
}

/* ── Import de la fiche d'UE et cours du parcours ─────────────────────── */



.fiche-ue__choisir {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  margin-bottom: var(--space-2);
  cursor: pointer;
}

.fiche-ue .btn-ghost.choix-cta {
  width: 100%;
}

.fiche-ue__bandeau {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--orange-dim);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.fiche-ue__bandeau .upte-icon {
  flex: 0 0 auto;
  color: var(--orange);
}

.fiche-ue__bloc {
  margin-bottom: var(--space-5);
}

.fiche-ue__entete {
  position: sticky;
  top: 52px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  padding: var(--space-2) 0;
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-heading);
}

.fiche-ue__total {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: var(--weight-emphasis);
  color: var(--muted);
  white-space: nowrap;
}

.fiche-ue__total--ok {
  color: var(--green-text);
}

.fiche-ue__total--ko {
  color: var(--red);
}

.fiche-ue__ligne {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  transition: opacity var(--dur-fast) var(--ease-out);
}

.fiche-ue__ligne--retiree {
  opacity: 0.45;
}

.fiche-ue__ligne--douteuse .choix-saisie {
  border-color: var(--orange3);
}

.fiche-ue__rang {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.fiche-ue__garde {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--tap-min);
  height: var(--tap-min);
  cursor: pointer;
}

.fiche-ue__garde input,
.cours-sugg input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--green3);
}

.fiche-ue__code {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: var(--weight-emphasis);
  text-transform: uppercase;
}

.fiche-ue__credits {
  flex: 0 0 auto;
  width: 56px;
  text-align: center;
}

.fiche-ue__unite {
  flex: 0 0 auto;
  font-size: var(--text-sm);
  color: var(--muted);
}

.fiche-ue__intitule {
  width: 100%;
}

.fiche-ue__alerte {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--orange);
}

.fiche-ue__ajout {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
}

.fiche-ue__pied {
  position: sticky;
  /* Colle au bas du panneau, par-dessus sa marge interne. */
  bottom: calc(var(--space-5) * -1);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-4) calc(var(--space-5) * -1) calc(var(--space-5) * -1);
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.fiche-ue__pied .btn {
  justify-content: center;
  width: 100%;
}

.fiche-ue__ecart {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.fiche-ue__ecart-code {
  margin: 0 0 var(--space-1);
  font-weight: var(--weight-heading);
}

.fiche-ue__ecart-txt {
  margin: 0 0 var(--space-1);
  font-size: var(--text-sm);
}

.fiche-ue__ecart-txt span {
  display: inline-block;
  min-width: 72px;
  color: var(--muted);
}

.fiche-ue__choix {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.fiche-ue__opt {
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.fiche-ue__opt[aria-pressed="true"] {
  border-color: var(--green3);
  background: var(--green-dim);
  font-weight: var(--weight-emphasis);
}

.fiche-ue__opt:focus-visible {
  outline: 2px solid var(--green3);
  outline-offset: 2px;
}

.cours-sugg {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  padding: var(--space-2) 0;
  cursor: pointer;
}

.cours-sugg + .cours-sugg {
  border-top: 1px solid var(--border);
}


.cours-sugg input {
  flex: 0 0 auto;
}

.cours-sugg__texte {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cours-sugg__titre {
  font-weight: var(--weight-emphasis);
  overflow-wrap: anywhere;
}

.cours-sugg__sous {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* ── Parcours v2 (2.13.1) ─────────────────────────────────────────────────
   Reference : listes groupees de Reglages et Rappels (iOS). Un seul bouton
   plein par ecran, cibles de 44 px, aucune icone decorative : seuls
   restent le chevron (navigation), le plus (ajout), le cadenas (verrou)
   et les points du menu. */

/* En-tete de carte : titre, resume, outils a droite (Mes cours, Ma formation). */
.mes-cours__tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.mes-cours__titres {
  min-width: 0;
}

.mes-cours__titre {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-heading);
  line-height: var(--leading-tight);
}

.mes-cours__resume {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.mes-cours__resume:empty {
  display: none;
}

.mes-cours__outils {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-1);
}

.mes-cours__corps {
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.mc-menu-btn,
.mc-texte-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--green-text);
  font: inherit;
  font-size: var(--text-md);
  cursor: pointer;
}

.mc-menu-btn {
  color: var(--text);
}

.mc-texte-btn--fort {
  font-weight: var(--weight-heading);
}

.mc-menu-btn:active,
.mc-texte-btn:active {
  background: var(--surface2);
}

.mc-menu-btn:focus-visible,
.mc-texte-btn:focus-visible,
.mc-ligne:focus-visible,
.mc-propose:focus-visible,
.mc-lien:focus-visible,
.mc-menu__item:focus-visible {
  outline: 2px solid var(--green3);
  outline-offset: -2px;
}

/* Liste groupee des cours. */
.mc-groupe {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  overflow: hidden;
}

.mc-ligne {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: calc(var(--tap-min) + var(--space-3));
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.mc-ligne + .mc-ligne {
  border-top: 1px solid var(--border);
}

.mc-ligne:active {
  background: var(--surface2);
}

.mc-ligne > .upte-icon:last-child {
  flex: 0 0 auto;
  color: var(--muted2);
}

/* Couleur du cours : une barre fine, celle de l'emploi du temps. */
.mc-ligne__marque {
  flex: 0 0 auto;
  align-self: stretch;
  width: var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--mc-c);
}

.mc-ligne__texte {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mc-ligne__titre {
  font-size: var(--text-md);
  font-weight: var(--weight-emphasis);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.mc-ligne__sous {
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mc-ligne__manque {
  font-style: italic;
}

.mc-ligne--ajout {
  color: var(--green-text);
}

.mc-ligne--ajout .mc-ligne__titre {
  font-weight: var(--weight-body);
}

.mc-ligne--choix {
  cursor: pointer;
}

.mc-case {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--green3);
}

.mc-groupe--selection {
  margin-bottom: calc(var(--tap-min) + var(--space-6));
}

.mc-propose {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--tap-min);
  margin-top: var(--space-3);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--green-dim);
  color: var(--green-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-emphasis);
  text-align: left;
  cursor: pointer;
}

/* Etat vide : une action principale, une secondaire, un lien. */
.mc-vide {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-3) 0 var(--space-1);
  text-align: center;
}

.mc-vide__titre {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-heading);
}

.mc-vide__texte {
  margin: 0 auto var(--space-2);
  max-width: 36ch;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--muted);
}

.mc-vide__cta {
  justify-content: center;
  width: 100%;
  min-height: var(--tap-min);
}

.mc-lien {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--green-text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

/* Barre du mode selection, au-dessus des onglets du bas. */
.mc-barre {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-tabs-space) + var(--safe-bottom));
  z-index: var(--z-barre);
  display: flex;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.mc-barre__supprimer {
  justify-content: center;
  width: 100%;
  max-width: 480px;
  min-height: var(--tap-min);
  border: 0;
  background: var(--red);
  color: var(--on-primary);
  font-weight: var(--weight-heading);
}

.mc-barre__supprimer:disabled {
  background: var(--surface2);
  color: var(--muted);
}

@media (min-width: 901px) {
  .mc-barre {
    left: 240px;
    bottom: 0;
    padding-bottom: calc(var(--space-3) + var(--safe-bottom));
  }
}

/* Menu des actions rares (feuille au telephone, popover sur tablette). */
.mc-menu__liste {
  display: flex;
  flex-direction: column;
  min-width: 240px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mc-menu__item {
  min-height: calc(var(--tap-min) + var(--space-1));
  padding: 0 var(--space-4);
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  text-align: left;
  cursor: pointer;
}

.mc-menu__item + .mc-menu__item {
  border-top: 1px solid var(--border);
}

.mc-menu__item:active {
  background: var(--surface2);
}

.mc-menu__item--danger {
  color: var(--red);
}

/* Ma formation. */
.formation-carte__corps {
  padding-top: var(--space-2);
}

.formation-ligne--fixe {
  cursor: default;
}

.formation-ligne--fixe:active {
  background: transparent;
}

.formation-pied {
  display: flex;
  justify-content: center;
  margin: calc(var(--space-2) * -1) 0 var(--space-3);
}

.formation-pied:empty {
  display: none;
}

/* Feuilles de choix : texte court, case a cocher, recapitulatif. */
.choix-texte {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}

.choix-texte p {
  margin: 0;
}

.choix-case {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  font-weight: var(--weight-emphasis);
  cursor: pointer;
}

.choix-case input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--green3);
}

.choix-cta--plein {
  justify-content: center;
  width: 100%;
}

.choix-resume {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--bg2);
}

.choix-resume__ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
}

.choix-resume__ligne + .choix-resume__ligne {
  border-top: 1px solid var(--border);
}

.choix-resume__ligne span {
  flex: 0 0 auto;
  font-size: var(--text-sm);
  color: var(--muted);
}

.choix-resume__ligne strong {
  font-weight: var(--weight-emphasis);
  text-align: right;
  overflow-wrap: anywhere;
}

.choix-ligne--discrete .choix-ligne__titre {
  color: var(--green-text);
  font-weight: var(--weight-body);
}

.choix-semestre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.choix-semestre__sous {
  font-size: var(--text-xs);
  font-weight: var(--weight-body);
  color: var(--muted);
}

.fiche-ue__message {
  margin-bottom: var(--space-3);
}

/* Formulaire d'un cours : type (parcours ou libre), verrou, suppression. */
.cours-type {
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.cours-type__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  font-size: var(--text-md);
  cursor: pointer;
}

.cours-type__option input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green3);
}

.cours-type__note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.cours-verrou {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--muted);
}

.cours-verrou .upte-icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--green-text);
}

.cours-verrou[hidden] {
  display: none;
}

.cours-supprimer {
  margin-right: auto;
  color: var(--red);
}

/* Reinitialiser : toast avec delai d'annulation. */
.toast-annuler {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.toast-annuler__texte {
  flex: 1 1 auto;
  min-width: 0;
}

.toast-annuler__btn {
  flex: 0 0 auto;
  min-height: var(--tap-min);
}

/* Admin du referentiel. */
.admin-ref__section {
  margin-bottom: var(--space-5);
}

.admin-ref__entete {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-heading);
  color: var(--muted);
}

.admin-ref__groupe {
  border-radius: var(--radius-sm);
  background: var(--bg2);
  overflow: hidden;
}

.admin-ref__ligne {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}

.admin-ref__ligne + .admin-ref__ligne {
  border-top: 1px solid var(--border);
}

.admin-ref__texte {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-ref__titre {
  font-weight: var(--weight-emphasis);
  overflow-wrap: anywhere;
}

.admin-ref__sous {
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-ref__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.admin-ref__btn {
  min-width: 96px;
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-emphasis);
  cursor: pointer;
}

.admin-ref__btn--refus {
  color: var(--red);
}

.admin-ref__btn--ok {
  border-color: var(--green3);
  background: var(--green-dim);
  color: var(--green-text);
}

.admin-ref__btn:disabled {
  opacity: 0.5;
}

/* Champ d'une UE officielle : lu, pas saisi. Le texte reste lisible, le
   cadre disparait (lecture seule a la maniere des Reglages iOS). */
.modal .form-input:disabled {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  color: var(--text);
  opacity: 1;
  -webkit-text-fill-color: var(--text);
  cursor: default;
}

/* Bouton principal desactive (case pas encore cochee) : gris lisible.
   .btn-primary, declare apres .btn:disabled, lui reprenait son fond vert. */
.choix-parcours .btn-primary:disabled,
.fiche-ue .btn-primary:disabled {
  background: var(--surface2);
  color: var(--muted);
}

/* Profil > Aide : titre de groupe, facon Reglages iOS. */
.profile-aide__titre {
  margin: var(--space-5) var(--space-4) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-heading);
  color: var(--muted);
}
