/* 2026-11-28 DESIGN FIXES (from docs/UXUI-AUDIT-CLOUD-2026-11-28.md, items 04, 05, 07, 12 and the dark-theme button text).
   Loaded LAST by Components/App.razor, so one file corrects every page without editing the 200+ pages (most colours and sizes are written inline in the pages).
   To undo: delete the <link> line in App.razor. Every colour ratio below was calculated (WCAG 2.2, 4.5 : 1 for normal text):
   - hint grey text   light: 3.1 -> 5.0 on white / 5.0 on the page grey      dark: 4.1 -> 5.1 on the card grey
   - blue text on its soft background 4.48 -> 5.1, red 4.12 -> 5.3, green 3.24 -> 4.9
   - white text on the dark-theme blue was 3.0 : 1; dark text on it is 6.2 : 1 */

/* ---------- 1. colour tokens ---------- */
:root {
  --text-3: #5f6980;
  --accent: #4255d9;
  --accent-hover: #3748c4;
  --success: oklch(50% 0.14 150);
  --danger: oklch(52% 0.19 25);
  --on-accent: #ffffff;                /* text that sits on an accent-coloured fill */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text-3: #8b93ab;
    --accent: #7c8cf5; --accent-hover: #93a0f8;
    --success: oklch(70% 0.15 150); --danger: oklch(68% 0.18 25);
    --on-accent: #0e1119;
  }
}
:root[data-theme="dark"] {
  --text-3: #8b93ab;
  --accent: #7c8cf5; --accent-hover: #93a0f8;
  --success: oklch(70% 0.15 150); --danger: oklch(68% 0.18 25);
  --on-accent: #0e1119;
}
.app-sidebar { --text-3: #8f97c2; }   /* the sidebar is always dark navy: 4.4 -> 5.5 : 1 */

/* ---------- 2. text on filled accent colour: white in light, dark in dark (works for inline styles and for the classes) ---------- */
[style*="background:var(--accent)"], [style*="background: var(--accent)"], [style*="background-color:var(--accent)"],
.dash-tab.active, .chip.on, .seg .on, html[lang="fr"] .lang-switch [data-lang-set="fr"], .lang-switch .on, button.primary, .btn-primary {
  color: var(--on-accent) !important;
}

/* ---------- 3. keyboard focus (a visible ring everywhere; the old browser default was a thin orange line) ---------- */
body :focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

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

/* ---------- 5. nothing smaller than 12 px (the pages write 9.5 - 11.5 px inline) ---------- */
[style*="font-size:9px"], [style*="font-size:9.5px"], [style*="font-size:10px"], [style*="font-size:10.5px"], [style*="font-size:11px"], [style*="font-size:11.5px"],
[style*="font-size: 9px"], [style*="font-size: 9.5px"], [style*="font-size: 10px"], [style*="font-size: 10.5px"], [style*="font-size: 11px"], [style*="font-size: 11.5px"],
.nav-heading, .hb-tt, .hb-lb, .hb-c, .topbar-search kbd { font-size: 12px !important; }

/* ---------- 6. touch ---------- */
button, a, select, summary, [role="button"], label[for] { touch-action: manipulation; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }
@media (max-width: 760px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]), select { min-height: 44px; }
  form a[href], .login-card a[href] { display: inline-block; padding: 12px 0; }   /* "Forgot password?" was 17 px high */
}
