/* =========================================================================
   Portail Partenaires Hoster — socle : jetons, réinitialisation, typographie
   =========================================================================

   Deux thèmes définis par jetons. Le thème clair est la valeur de base sur
   :root ; le sombre ne redéfinit que les jetons, jamais les règles. Une
   couleur qui n'existerait que dans un bloc @media disparaîtrait dans
   l'autre thème — d'où la discipline : toute couleur naît ici.

   Aucune police distante : le portail doit s'afficher à l'identique sur un
   réseau d'intervention coupé d'Internet, devant un serveur en salle. */

:root {
  color-scheme: light dark;

  /* Surfaces, de la plus profonde à la plus haute */
  --bg:            #f4f6f8;
  --surface:       #ffffff;
  --surface-2:     #f0f3f6;
  --surface-3:     #e5eaef;
  --overlay:       rgba(16, 24, 32, .48);

  /* Traits */
  --border:        #d9e0e7;
  --border-strong: #bcc7d2;

  /* Texte */
  --text:          #16202b;
  --text-2:        #4a5b6d;
  --text-3:        #7b8b9c;
  --text-invert:   #ffffff;

  /* Accent de marque — le vert Hoster */
  --accent:        #0f9b78;
  --accent-hover:  #0c8567;
  --accent-soft:   #e2f5ef;
  --accent-text:   #076651;
  --on-accent:     #ffffff;

  /* Sémantique */
  --ok:            #0f9b78;
  --ok-soft:       #e2f5ef;
  --ok-text:       #076651;
  --warn:          #b06f00;
  --warn-soft:     #fdf0d8;
  --warn-text:     #7d4e00;
  --danger:        #c33232;
  --danger-soft:   #fbe6e6;
  --danger-text:   #8f2020;
  --info:          #2563c9;
  --info-soft:     #e5edfb;
  --info-text:     #1a4894;

  /* Rythme */
  --r-sm: 6px;  --r-md: 9px;  --r-lg: 14px;  --r-full: 999px;
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --shadow-1: 0 1px 2px rgba(16, 24, 32, .07), 0 1px 3px rgba(16, 24, 32, .05);
  --shadow-2: 0 4px 12px rgba(16, 24, 32, .09), 0 2px 4px rgba(16, 24, 32, .05);
  --shadow-3: 0 18px 48px rgba(16, 24, 32, .18);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono",
          Menlo, Consolas, monospace;

  --sidebar-w: 250px;
  --topbar-h: 60px;
}

:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  --bg:            #0d1117;
  --surface:       #151b23;
  --surface-2:     #1b232d;
  --surface-3:     #232d39;
  --overlay:       rgba(2, 5, 8, .68);

  --border:        #262f3b;
  --border-strong: #384453;

  --text:          #e6edf3;
  --text-2:        #9aabbd;
  --text-3:        #6d7f92;
  --text-invert:   #0d1117;

  --accent:        #2fd4a7;
  --accent-hover:  #4ee0b8;
  --accent-soft:   rgba(47, 212, 167, .12);
  --accent-text:   #5fe3bd;
  --on-accent:     #04241c;

  --ok:            #2fd4a7;
  --ok-soft:       rgba(47, 212, 167, .12);
  --ok-text:       #5fe3bd;
  --warn:          #e0a23a;
  --warn-soft:     rgba(224, 162, 58, .13);
  --warn-text:     #edbb63;
  --danger:        #f06363;
  --danger-soft:   rgba(240, 99, 99, .13);
  --danger-text:   #ff8a8a;
  --info:          #5b9bf8;
  --info-soft:     rgba(91, 155, 248, .13);
  --info-text:     #85b6fb;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .32);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, .40);
  --shadow-3: 0 20px 52px rgba(0, 0, 0, .58);
}

/* La préférence système ne s'applique que si l'utilisateur n'a rien choisi :
   le sélecteur [data-theme] doit toujours l'emporter, dans les deux sens. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6f8; --surface: #ffffff; --surface-2: #f0f3f6;
    --surface-3: #e5eaef; --overlay: rgba(16, 24, 32, .48);
    --border: #d9e0e7; --border-strong: #bcc7d2;
    --text: #16202b; --text-2: #4a5b6d; --text-3: #7b8b9c; --text-invert: #ffffff;
    --accent: #0f9b78; --accent-hover: #0c8567; --accent-soft: #e2f5ef;
    --accent-text: #076651; --on-accent: #ffffff;
    --ok: #0f9b78; --ok-soft: #e2f5ef; --ok-text: #076651;
    --warn: #b06f00; --warn-soft: #fdf0d8; --warn-text: #7d4e00;
    --danger: #c33232; --danger-soft: #fbe6e6; --danger-text: #8f2020;
    --info: #2563c9; --info-soft: #e5edfb; --info-text: #1a4894;
    --shadow-1: 0 1px 2px rgba(16, 24, 32, .07), 0 1px 3px rgba(16, 24, 32, .05);
    --shadow-2: 0 4px 12px rgba(16, 24, 32, .09), 0 2px 4px rgba(16, 24, 32, .05);
    --shadow-3: 0 18px 48px rgba(16, 24, 32, .18);
  }
}

/* ---------------------------------------------------------- réinitialisation */

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 640; line-height: 1.25; letter-spacing: -.011em; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

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

code, kbd, .mono { font-family: var(--mono); font-size: .92em; font-variant-ligatures: none; }

/* Une cible de focus visible partout, au clavier comme à la souris : c'est la
   seule façon de naviguer ce portail sans souris devant une baie. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--accent-soft); color: var(--accent-text); }

/* Barres de défilement discrètes, thème compris. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: var(--r-full);
  border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------- utilitaires */

.muted    { color: var(--text-2); }
.dim      { color: var(--text-3); }
.small    { font-size: 12.5px; }
.tiny     { font-size: 11.5px; }
.strong   { font-weight: 620; }
.nowrap   { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right    { text-align: right; }
.center   { text-align: center; }
.hidden   { display: none !important; }

.row   { display: flex; align-items: center; gap: var(--sp-2); }
.row-3 { display: flex; align-items: center; gap: var(--sp-3); }
.col   { display: flex; flex-direction: column; gap: var(--sp-2); }
.wrap  { flex-wrap: wrap; }
.grow  { flex: 1 1 auto; min-width: 0; }
.spacer{ flex: 1 1 auto; }

.stack   > * + * { margin-top: var(--sp-4); }
.stack-5 > * + * { margin-top: var(--sp-5); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
