/* Mode sombre des pages de l'application qui utilisent tokens.css + pagelab.css (connexion, pages publiques, Espace cabinet).
   Charte du site : fond #151515, texte blanc, filets gris foncés, le point rouge inchangé. Actif quand <html> porte la classe « sombre »
   (posée par static/theme.js : réglage du système par défaut, ou choix retenu par le navigateur). Contrastes AA : tests/test_pages_publiques.py. */
html.sombre {
  color-scheme: dark;
  --papier: #151515; --surface: #151515; --creux: #222222; --inverse: #FFFFFF; --sur-inverse: #151515;
  --encre: #FFFFFF; --encre-2: #BDBDBD; --encre-3: #9A9A9A; --filet: #333333; --filet-fort: #FFFFFF;
  --vert: #5CC48E; --orange: #E8A64E; --rouge: #FF7B80;
  --marine: #FFFFFF; --marine-fonce: #E6E6E6; --marine-clair: #E6E6E6; --marine-pale: #222222;
  --creme: #151515; --creme-2: #222222;
  --accent: #FFFFFF; --accent-fonce: #FFFFFF;
  --laiton: #FFFFFF; --laiton-texte: #BDBDBD; --laiton-pale: #222222;
  --fond: #151515; --carte: #151515; --bord: #333333; --bord-fort: #FFFFFF; --bord-champ: #8A8A8A;
  --nuit: #151515; --nuit-2: #222222; --nuit-3: #151515;
  --texte-nuit: #FFFFFF; --texte-nuit-2: #BDBDBD; --lien-nuit: #FFFFFF; --repere-nuit: #FFFFFF; --bord-nuit: #333333; --verre: #151515;
  --degrade-nuit: #FFFFFF; --degrade-clair: #FFFFFF; --degrade-icone: #FFFFFF; --degrade-pastille: #222222; --degrade-interrupteur: #FFFFFF;
  --succes: #5CC48E; --succes-fond: #151515; --alerte: #FF7B80; --alerte-fond: #151515; --attention: #E8A64E; --attention-fond: #151515;
  --info-fond: #151515; --neutre-fond: #222222; --surlignage: #5C4B00;
  --focus: #FFFFFF; --halo: rgba(255, 255, 255, .25); --survol-ligne: #1E1E1E;
  --drapeau-bleu: #FFFFFF;
}
html.sombre body { background: var(--fond); color: var(--encre); }
/* Boutons et pastilles pleins : le plein devient blanc, le texte devient le noir de la page */
html.sombre .bouton:not(.secondaire):not(.discret):not(.danger):not(.lien), html.sombre .v-btn:not(.v-btn-ghost), html.sombre .badge.actif, html.sombre .bulle.moi, html.sombre .bulle.moi a,
html.sombre .onglets a[aria-current="page"], html.sombre .icone-ronde.degrade, html.sombre .evenement.ia .pastille-frise,
html.sombre .v-navlinks a.v-btn, html.sombre .parcours-btn.principal, html.sombre .toast { color: #151515; }
html.sombre .bouton:not(.secondaire):not(.discret):not(.danger):not(.lien):hover, html.sombre .v-btn:not(.v-btn-ghost):hover { background: #E6E6E6; border-color: #E6E6E6; color: #151515; }
html.sombre .bouton.discret { color: #FFFFFF; border-color: #444444; }
html.sombre .bouton.discret:hover { color: #FFFFFF; border-color: #FFFFFF; }
html.sombre .bouton.danger { background: transparent; color: var(--rouge); border-color: var(--rouge); }
html.sombre .bouton.secondaire, html.sombre .v-btn-ghost { background: transparent; color: #FFFFFF; border-color: #FFFFFF; }
html.sombre .bouton.secondaire:hover, html.sombre .v-btn-ghost:hover { background: #FFFFFF; color: #151515; }
html.sombre .nav a:hover, html.sombre .nav a[aria-current="page"], html.sombre .pied a:hover { color: #FFFFFF; }
html.sombre input, html.sombre select, html.sombre textarea { background: #1C1C1C; color: #FFFFFF; border-color: var(--bord-champ); }
html.sombre .drapeau i:nth-child(2) { background: #FFFFFF; }
/* Logos noirs (fichiers SVG) : en blanc sur fond sombre ; le QR code de double authentification garde son fond blanc */
html.sombre img[src$="/brand/logo.svg"] { content: url("/static/brand/logo-sombre.svg"); }
html.sombre .qr-2fa img { background: #FFFFFF; }

/* Bouton clair / sombre (toutes les pages) */
.bascule-theme { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 .6rem; border: 1px solid var(--bord, var(--filet));
  background: transparent; color: inherit; font: 500 .8125rem/1 var(--police, var(--texte)); cursor: pointer; }
.bascule-theme:hover { border-color: currentColor; }
.bascule-theme:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.barre-outils { display: flex; justify-content: flex-end; padding: var(--e3, 12px) var(--gouttiere, 32px) 0; }
@media (max-width: 900px) { .barre-outils { display: none; } }
@media (min-width: 901px) { .bascule-mobile { display: none; } }
.v-auth-outils { position: absolute; top: 12px; right: 12px; z-index: 5; }
@media (max-width: 480px) { .tete .bascule-texte, .v-navlinks .bascule-texte { display: none; } .tete .compte a, .v-navlinks a { white-space: nowrap; } }
