/* NT Software web : bases (palette, typographie, accessibilité).
   Palette blanche et bleue du poste depuis la 1.16.0 (client/ntic_hub/ui/theme.py, docs/ARCHITECTURE.md § 4.19).
   Aucune police ni ressource externe : polices du système. Contrastes AA vérifiés sur fond blanc. */

:root {
  /* fonds et traits */
  --fond: #ffffff;
  --fond-doux: #f5f8fc;      /* zèbre */
  --entete: #edf3fa;
  --segment: #e7eef7;
  --survol: #eaf2fc;
  --selection: #cfe0f5;
  --bord: #d3deeb;
  --bord-fort: #8fa6c2;      /* champs : trait net */
  --trait: #e3eaf3;
  /* textes */
  --encre: #0f1e33;          /* 16,5:1 */
  --encre-2: #2f4560;        /* 9,6:1 */
  --discret: #566a82;        /* 5,6:1 */
  /* bleus (classeur TDB) */
  --bleu: #1c5cab;           /* 6,6:1 */
  --bleu-fonce: #154a8c;     /* 8,6:1 */
  --bleu-pale: #eaf2fc;
  --bleu-2: #2a7fd4;
  --bleu-2-fonce: #1f66ad;   /* 5,9:1 */
  /* états */
  --bon: #047857;
  --bon-fond: #e7f8f0;
  --mauvais: #b91c1c;
  --mauvais-fond: #fdecec;
  --attention: #9a4a08;      /* plus foncé que celui du poste (#b45309) : AA sur fond pâle */
  --attention-fond: #fef5e1;
  --info-fond: #eaf2fc;
  /* logo */
  --indigo-clair: #6366f1;
  --indigo-fonce: #4338ca;
  --cyan-logo: #22d3ee;

  --police: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, "Noto Sans", "DejaVu Sans",
    Arial, sans-serif;
  --police-mono: Consolas, "Cascadia Mono", ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", monospace;

  --rayon: 12px;
  --rayon-petit: 8px;
  --ombre: 0 1px 2px rgb(15 30 51 / 6%), 0 6px 20px rgb(15 30 51 / 7%);
  --ombre-forte: 0 12px 40px rgb(15 30 51 / 22%);
  --anneau: 3px solid var(--bleu-fonce);

  --largeur-nav: 16rem;
  --hauteur-barre: 3.5rem;
  --largeur-contenu: 78rem;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* fenêtre modale ouverte : la page derrière ne défile plus */
html.defilement-bloque {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 650;
  color: var(--encre);
}

ul,
ol {
  padding: 0;
}

a {
  color: var(--bleu);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--bleu-fonce);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

code {
  font-family: var(--police-mono);
}

::selection {
  background: var(--selection);
  color: var(--encre);
}

/* Focus clavier toujours visible (anneau bleu foncé décalé : lisible sur blanc comme sur bleu) */
:focus-visible {
  outline: var(--anneau);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

[tabindex="-1"]:focus {
  outline: none;
}

/* Texte lu par les lecteurs d'écran seulement */
.visuellement-cache {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Lien d'évitement : visible au premier Tab */
.lien-evitement {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--rayon-petit);
  background: var(--bleu-fonce);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.lien-evitement:focus {
  transform: none;
  color: #fff;
}

/* Écran de démarrage (index.html), remplacé par l'application dès qu'elle est chargée */
.demarrage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  color: var(--encre-2);
  text-align: center;
}

.demarrage--erreur {
  color: var(--mauvais);
}

.demarrage--erreur .spinner {
  display: none;
}

.noscript {
  padding: 1.5rem;
  text-align: center;
  color: var(--mauvais);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mode contraste élevé de Windows : bordures et focus gardés */
@media (forced-colors: active) {
  :focus-visible {
    outline: 3px solid CanvasText;
  }
}
