/*
 * Formulaires en modale (ajout et modification des facultés, départements, promotions…) au style de la modale
 * « Importer les étudiants » : blocs numérotés à icône séparés par des filets, champs arrondis, bouton principal
 * au dégradé de l'université. Composants : <x-modal-form.bloc> et <x-modal-form.pied> dans un conteneur .mf.
 * La numérotation des blocs suit les blocs visibles (un bloc masqué, [hidden], ne compte pas).
 */
.mf, .modal-content:has(.mf) {
    --mf-marine: #12324b; --mf-bleu: #185fa5; --mf-ciel: #eef6fb; --mf-filet: #eef2f7; --mf-champ: #cfe0ee;
    --mf-gris: #6b7f93; --mf-surface: #ffffff; --mf-texte: #16324F; --mf-fond: #f7fafd;
}
html[data-cn-theme="dark"] .mf, html[data-cn-theme="dark"] .modal-content:has(.mf) {
    --mf-marine: #f1f5f9; --mf-bleu: #8cc2f5; --mf-ciel: #1d3247; --mf-filet: #2b3c4e; --mf-champ: #2b3c4e;
    --mf-gris: #b5c4d3; --mf-surface: #16212c; --mf-texte: #f1f5f9; --mf-fond: #1b2836;
}
@media (min-width: 576px) { .modal-dialog:has(.mf) { max-width: 680px; } }
@media (min-width: 992px) { .modal-dialog:has(.mf.mf-large) { max-width: 780px; } }
.modal-content:has(.mf) { background: var(--mf-surface) !important; color: var(--mf-texte); }
.modal-content:has(.mf) > .modal-body { background: var(--mf-surface) !important; }

.mf { color: var(--mf-texte); counter-reset: mf-bloc; }
.mf-intro { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--mf-fond);
            border: 1px solid var(--mf-filet); font-size: 13.5px; line-height: 1.5; margin-bottom: 4px; }
.mf-intro strong { color: var(--mf-marine); }

.mf-bloc { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--mf-filet); counter-increment: mf-bloc; }
.mf-bloc[hidden] { display: none; counter-increment: none; }
.mf > .mf-bloc:first-child, .mf-intro + .mf-bloc { border-top: 0; }
/* Icône du bloc à la couleur secondaire de l'université (theme_secondaire, --theme-hero-end) : fond teinté, pictogramme
   et pastille du numéro dans cette couleur. */
.mf-ico { position: relative; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
          background: color-mix(in srgb, var(--theme-hero-end, #185fa5) 12%, #fff); color: var(--theme-hero-end, #185fa5); }
html[data-cn-theme="dark"] .mf-ico { background: color-mix(in srgb, var(--theme-hero-end, #185fa5) 30%, #16212c);
                                     color: color-mix(in srgb, var(--theme-hero-end, #185fa5) 45%, #fff); }
.mf-ico svg { width: 17px; height: 17px; }
.mf-ico::after { content: counter(mf-bloc); position: absolute; top: -6px; right: -6px; width: 17px; height: 17px; border-radius: 50%;
                 background: var(--theme-hero-end, #185fa5); color: #fff; font-size: 10.5px; font-weight: 800;
                 display: grid; place-items: center; border: 2px solid var(--mf-surface); }
.mf-corps { flex: 1 1 auto; min-width: 0; }
.mf-titre { font-size: 14px; font-weight: 700; color: var(--mf-marine); margin: 4px 0 8px; display: flex; align-items: center; gap: 6px; }
.mf-aide { font-size: 12.5px; color: var(--mf-gris); margin: -4px 0 10px; line-height: 1.5; }

/* Champs : grille de deux colonnes (une sur téléphone) ; .mf-plein occupe toute la ligne. */
.mf-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.mf-grille > .mf-plein, .mf-grille > .row, .mf-grille > .institution-type-fields { grid-column: 1 / -1; }
.mf .form-group { margin-bottom: 10px; }
.mf label, .mf .control-label { font-size: 12.5px; font-weight: 600; color: var(--mf-texte); margin-bottom: 4px; }
.mf .form-control, .mf .form-select { border-radius: 8px; border-color: var(--mf-champ); background-color: var(--mf-surface); color: var(--mf-texte);
                                      min-height: 38px; font-size: 13.5px; }
.mf .form-control:focus, .mf .form-select:focus { border-color: var(--mf-bleu); box-shadow: 0 0 0 3px rgba(24, 95, 165, .14); }
.mf .form-text, .mf small.text-muted { font-size: 12px; color: var(--mf-gris) !important; }
.mf .select2-container .select2-selection--single { border-radius: 8px; border-color: var(--mf-champ); min-height: 38px; }
/* Options : cases à cocher du thème alignées en tuiles légères. */
.mf-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mf-options > .checkbox { margin: 0; padding: 9px 12px; border: 1px solid var(--mf-champ); border-radius: 10px; background: var(--mf-surface); }
.mf-options > .checkbox label { font-weight: 600; margin: 0; }
/* Blocs du type (faculté / institution) déjà mis en forme par leurs partiels : marges resserrées. */
.mf .faculty-type-fields .form-group, .mf .institution-type-fields .form-group { margin-bottom: 10px; }
.mf .institution-type-fields { margin: 0; }

.mf-pied { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--mf-filet); }
.mf-pied .btn { border-radius: 10px; font-weight: 600; padding: 8px 16px; }
.mf-pied .mf-annuler { background: var(--mf-surface); border: 1px solid var(--mf-champ); color: var(--mf-gris); }
.mf-pied .mf-annuler:hover { color: var(--mf-texte); }
.mf-pied .mf-valider { border: 0; color: #fff; box-shadow: 0 4px 12px rgba(16, 62, 105, .18); transition: filter .15s, transform .15s;
    background: linear-gradient(135deg, var(--theme-hero-start, #0f2f57) 0%, var(--theme-hero-middle, #185fa5) 60%,
        var(--theme-hero-end, var(--theme-hero-middle, #185fa5)) 100%); }
.mf-pied .mf-valider:hover, .mf-pied .mf-valider:focus { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }

@media (max-width: 575.98px) {
    .mf-grille, .mf-options { grid-template-columns: 1fr; }
    .mf-bloc { gap: 10px; }
    .mf-pied .btn { flex: 1; }
}
