/*
 * MesActes — feuille de raccord avec le design system Scolarix (uglcs.css, ux.css, gx.css, site.css).
 * Ne contient QUE ce qui n'existe pas dans Scolarix : accessibilité (lien d'évitement), bandeau hors ligne (PWA),
 * pastille de rôle de l'en-tête (copie de la règle écrite en ligne dans base_enseignant.php de Scolarix) et
 * quelques utilitaires des vues MesActes. Aucune couleur ni police propre : tout vient des jetons --ux-*.
 */
.ma-skip { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--ux-primary-dark); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; }
.ma-skip:focus { left: 0; color: #fff; }
.ma-offline { position: sticky; top: 0; z-index: 1990; display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--ux-warning-bg); color: var(--ux-warning-ink, #92400e); font-size: .85rem; font-weight: 600; }
.ma-offline[hidden] { display: none; }
.ma-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.header-role-badge { background: linear-gradient(135deg, var(--ux-primary), var(--ux-primary-dark)); color: #fff; padding: 4px 16px; border-radius: 30px; font-size: .7rem; font-weight: 600; }
.nk-menu-badge { margin-left: auto; font-size: .65rem; font-weight: 700; text-transform: uppercase; color: var(--ux-muted); }
.ma-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ma-ref { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .02em; }
.ma-form-narrow { max-width: 640px; }
main:focus { outline: none; }

/* ---- Alias : les composants MesActes restants (étapes, soldes, tunnel…) prennent les jetons de Scolarix ---- */
:root {
  --ma-bleu: var(--ux-primary-dark); --ma-bleu-fonce: var(--ux-primary-dark); --ma-bleu-pale: var(--ux-primary-50);
  --ma-encre: var(--ux-ink); --ma-texte-2: var(--ux-body); --ma-gris: var(--ux-muted); --ma-gris-clair: var(--ux-muted);
  --ma-filet: var(--ux-border); --ma-filet-leger: var(--ux-border); --ma-papier: var(--ux-bg); --ma-surface: var(--ux-surface);
  --ma-rouge-texte: var(--ux-danger); --ma-vert-succes: var(--ux-success); --ma-danger: var(--ux-danger); --ma-success: var(--ux-success);
  --ma-warning-bg: var(--ux-warning-bg); --ma-warning-text: var(--ux-warning-ink, #92400e);
  --ma-info-bg: var(--ux-primary-50); --ma-info-text: var(--ux-primary-dark);
  --ma-danger-bg: var(--ux-danger-bg, #fee2e2); --ma-success-bg: var(--ux-success-bg);
  --ma-border-control: var(--ux-border); --ma-focus: var(--ux-primary);
  --ma-font-titre: "Plus Jakarta Sans", system-ui, sans-serif; --ma-font-texte: "Plus Jakarta Sans", system-ui, sans-serif;
  --ma-radius-md: var(--ux-radius-sm, 8px);
}

/* ---- Site public : les composants MesActes restants lisent les jetons de site.css (préfixe --sx-) ---- */
.sx {
  --ux-ink: var(--sx-navy-900); --ux-body: var(--sx-navy-900); --ux-muted: #55657a; --ux-border: rgba(45, 74, 107, .2);
  --ux-surface: var(--sx-white); --ux-bg: var(--sx-cream); --ux-primary: var(--sx-action); --ux-primary-dark: var(--sx-action);
  --ux-primary-50: var(--sx-action-pale); --ux-danger: var(--sx-alert); --ux-success: var(--sx-success);
  --ux-warning-bg: var(--sx-gold-pale); --ux-warning-ink: var(--sx-gold-ink); --ux-success-bg: var(--sx-sage-pale);
  --ux-danger-bg: var(--sx-alert-bg); --ux-radius-sm: var(--sx-r-sm);
}
.sx .ma-bloc-plein { display: flex; width: 100%; }
.sx .ma-defilant { overflow-x: auto; }
.sx .sx-table { width: 100%; border-collapse: collapse; }
.sx .sx-table th, .sx .sx-table td { padding: .65rem .8rem; border-bottom: 1px solid var(--sx-line, rgba(45, 74, 107, .15)); text-align: left; vertical-align: top; }
.sx .sx-table th { color: var(--sx-navy); font-weight: 700; font-size: var(--sx-fs-14, .9rem); }
.sx .sx-table .ma-num { text-align: right; }
.sx-msg .fw-bold { display: block; }
.sx .ma-mb-block { width: 100%; }
@media (min-width: 576px) { .ma-mb-block { width: auto; } }
@media (max-width: 575px) { .ma-mb-block { width: 100%; } }
.sx .ma-compte__lien, .sx .ma-compte__oubli { margin-top: 1rem; }
.sx .ma-compte__renvoi { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---- Coque : éléments de la barre latérale et du menu du compte (sans styles en ligne : CSP stricte) ---- */
.ma-menu-inactif { opacity: .55; cursor: default; }
.nk-header-title.ma-gap { gap: 10px; }
.ma-form-lien { margin: 0; }
.ma-form-lien button { display: flex; align-items: center; width: 100%; gap: .75rem; padding: .55rem 1.25rem; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ma-form-lien button:hover { color: var(--ux-primary-dark); background: var(--ux-primary-50); }
.ma-form-lien .icon { font-size: 1.1rem; }
.gx-section { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gx-section > h2, .gx-section > h3 { font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; margin: 0; }
.btn > .icon { margin-right: .35rem; }
.btn-block { display: flex; width: 100%; justify-content: center; align-items: center; }
@media (max-width: 575.98px) { .ma-mb-block { display: flex; width: 100%; justify-content: center; } }

/* Les cartes d'indicateurs MesActes utilisent des <span> : même rendu que les <div> de Scolarix. */
.gx-kpi > .gx-kpi-label, .gx-kpi > .gx-kpi-value, .gx-kpi > .gx-kpi-sub { display: block; }
.gx-row > .gx-row-main, .gx-row-main > span { min-width: 0; }
.gx-row-main > .gx-row-title, .gx-row-main > .gx-row-sub { display: block; }

/* Zones tactiles : 44 × 44 px minimum (exigence d'accessibilité MesActes, plus stricte que Scolarix). */
.btn { min-height: 44px; }
.te-head-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; position: relative; }
.gx-back { min-height: 44px; }

/* uglcs.css (fin de fichier) pose sur tout <legend> une étiquette flottante à bordure bleue, propre aux fiches Scolarix :
   dans MesActes la légende d'un groupe de champs est un simple libellé au-dessus du groupe. */
.gx-page legend, .gx-page fieldset > legend {
  position: static; float: none; width: auto; height: auto; margin: 0 0 .5rem; padding: 0; background: none; border: 0; border-radius: 0;
  font-size: .9rem; font-weight: 700; color: var(--ux-ink);
}
/* En-tête de page : retour, surtitre, titre et résumé s'empilent (gx-head est une ligne dans Scolarix, avec un seul bloc de texte). */
.gx-head:has(> .gx-title) { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; }
.gx-head:has(> .gx-title) > p { margin: 0; max-width: 68ch; }

/* Titres des cartes : taille des titres de cartes gx-* de Scolarix (les <h2>/<h3> héritent sinon de la taille DashLite). */
.gx-card h2, .gx-card h3 { font-size: .95rem; font-weight: 700; color: var(--ux-ink); margin: 0 0 10px; letter-spacing: 0; line-height: 1.3; }
.gx-card .gx-card-head h2, .gx-card .gx-card-head h3 { margin: 0; }

/* ------------------------------------------------------------------
   Audit UI/UX (2026-11-27) — contrastes WCAG AA, tailles minimales, cibles tactiles, espace fin
   ------------------------------------------------------------------ */
/* Espace fine insécable (U+202F) des montants : absente de la police Jakarta (rendu « 5170000 »). */
@font-face { font-family: "MA-Espace"; src: local("Arial"), local("Segoe UI"), local("Helvetica"); unicode-range: U+202F; }
body, button, input, select, textarea { font-family: "MA-Espace", "Plus Jakarta Sans", system-ui, sans-serif; }

/* Texte secondaire : #7c8aa5 / #8094ae (≈ 3,1–3,5:1) → #5a6987 (≥ 4,8:1 sur blanc et sur #f5f6fa). */
body:not(.dark-mode) { --ux-muted: #5a6987; }
body:not(.dark-mode) .text-soft, body:not(.dark-mode) .sub-text, body:not(.dark-mode) .overline-title { color: #5a6987; }
body:not(.dark-mode) .user-status { color: #4458c7; }
/* Boutons contour : violet #8b5cf6 (3,9–4,2:1) → violet foncé du thème (≥ 7:1). */
.btn-outline-primary { color: var(--ux-primary-dark, #6d28d9); border-color: var(--ux-primary, #8b5cf6); }
.btn-outline-primary:hover, .btn-outline-primary:focus-visible { color: #fff; background-color: var(--ux-primary-dark, #6d28d9); border-color: var(--ux-primary-dark, #6d28d9); }

/* Tailles minimales : plus de texte sous 12 px. */
.nk-sidebar .nk-menu-heading .overline-title, .overline-title, .user-status, .header-role-badge, .gx-tabbar a span, .gx-tabbar span { font-size: max(12px, .75rem); }

/* Liens isolés (hors paragraphe) : cible tactile de 44 px de haut sur écran tactile. */
@media (max-width: 991.98px) {
  .gx-card-note a, .ma-dcarte__lien, .gx-card > a:not(.btn), .gx-head a:not(.btn), .form-note a, .gx-kpi-sub a, .gx-title + p a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
}

/* Deuxième passe : surcharges là où les règles du thème (theme.min, uglcs, gx) l'emportaient. */
body:not(.dark-mode) .text-soft, body:not(.dark-mode) .sub-text, body:not(.dark-mode) .form-note,
body:not(.dark-mode) .gx-sub, body:not(.dark-mode) .gx-back, body:not(.dark-mode) .gx-card-note,
body:not(.dark-mode) .gx-kpi-label, body:not(.dark-mode) .gx-kpi-sub, body:not(.dark-mode) .ma-solde__libelle,
body:not(.dark-mode) .ma-repli__note, body:not(.dark-mode) .nk-footer-copyright, body:not(.dark-mode) .overline-title,
body:not(.dark-mode) .gx-tabbar a { color: #5a6987 !important; }
body:not(.dark-mode) .gx-tabbar a.active, body:not(.dark-mode) .gx-tabbar a[aria-current] { color: var(--ux-primary-dark, #6d28d9) !important; }
/* Liens textuels : #7086f5 (≈ 3:1) → bleu foncé (≥ 6:1). */
.nk-content a:not([class*="btn"]):not(.nav-link):not(.dropdown-item):not(.nk-menu-link):not(.gx-back):not(.ma-filtre):not(.ma-onglet):not(.ma-puce) { color: #3f51b5; }
.badge-dim.bg-success { color: #047857; }
.badge, .ma-anneau__libelle { font-size: max(12px, .75rem); }
/* Espace fine des montants : la police est posée explicitement sur ces éléments. */
.ma-legende__valeur, .ma-rang__valeur, .ma-solde__valeur, td, .ma-ref { font-family: "MA-Espace", var(--ma-font-texte, "Plus Jakarta Sans"), sans-serif; }
.ma-kpi__valeur, .ma-fin__montant, .ma-dcarte__total { font-family: "MA-Espace", var(--ma-font-titre, "Plus Jakarta Sans"), sans-serif; }
@media (max-width: 991.98px) {
  .ma-legende a, a.ma-ref { display: inline-flex; align-items: center; min-height: 44px; }
}
