/* LiveMentorHub v109 — shell corrections and the theme control.

   styles_v109_dark.css is generated and covers colour literals mechanically.
   This sheet holds the small number of judgements a generator should not make:
   the page ground itself, form controls, the login illustration, and the new
   topbar theme button. */


/* ---- page ground -------------------------------------------------------- */
:root[data-theme="dark"] body {
  background: var(--lmh-bg) !important;
  color: var(--lmh-text);
}

/* Native widgets (scrollbars, date pickers, spinners) follow color-scheme,
   which is declared with the tokens. Form controls still need explicit
   surfaces because the frozen sheets paint them white. */
:root[data-theme="dark"] :is(input, textarea, select) {
  background: var(--lmh-surface-2) !important;
  border-color: var(--lmh-line) !important;
  color: var(--lmh-text) !important;
}
:root[data-theme="dark"] :is(input, textarea, select):focus {
  border-color: var(--lmh-primary) !important;
  box-shadow: 0 0 0 3px var(--lmh-primary-ring) !important;
}
:root[data-theme="dark"] ::placeholder { color: var(--lmh-text-3) !important; }

/* The login illustration is artwork and is deliberately excluded from the
   generated sheet; it needs its own dark ground so the panel halves match. */
:root[data-theme="dark"] .lm-login-visual {
  background: var(--lmh-surface-2) !important;
}
:root[data-theme="dark"] .lm-login-page { background: var(--lmh-bg) !important; }

/* The brand marks are drawn for a white ground — the shipped asset is named
   "LMH Logo for White background.png" — so they keep a white plate under dark
   rather than rendering navy-on-navy. These selectors are also excluded from
   the generated sheet so a regeneration cannot undo it. */
:root[data-theme="dark"] :is(.sidebar-logo, .lm-login-logo, .lm-login-wordmark) {
  background: #fff !important;
  border-radius: var(--lmh-r-sm);
}
:root[data-theme="dark"] .lm-login-wordmark {
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}


/* ---- topbar theme control ----------------------------------------------- */
.lmh-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--lmh-line);
  border-radius: var(--lmh-r-sm);
  background: var(--lmh-surface);
  color: var(--lmh-text-2);
  font: 600 13px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background var(--lmh-fast) var(--lmh-ease),
              border-color var(--lmh-fast) var(--lmh-ease),
              color var(--lmh-fast) var(--lmh-ease);
}
.lmh-theme-toggle:hover {
  background: var(--lmh-surface-2);
  border-color: var(--lmh-line-strong);
  color: var(--lmh-text);
}
.lmh-theme-toggle:focus-visible {
  outline: 2px solid var(--lmh-primary);
  outline-offset: 2px;
}
.lmh-theme-toggle svg { flex: 0 0 16px; }

@media (max-width: 900px) {
  .lmh-theme-toggle span { display: none; }
  .lmh-theme-toggle { padding: 0 9px; }
}


/* ---- focus visibility ---------------------------------------------------
   A single, consistent focus ring. The frozen sheets set focus styling in
   several unrelated ways; this makes keyboard position legible everywhere
   without removing any of them. */
:is(a, button, [role="button"], input, select, textarea, summary,
    [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--lmh-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .lmh-theme-toggle { transition: none; }
}
