/* Forced Colors fallbacks (Windows High Contrast Mode).
 *
 * In Forced Colors mode, the OS replaces all colors with system colors,
 * ignoring CSS values for backgrounds and tinted borders. State-bearing UI
 * (active nav, badges, alerts, focus rings, error toasts) collapses to
 * indistinguishable surface unless we add explicit border / outline
 * fallbacks.
 *
 * Drape ships into customer environments via BYOC; enterprise-managed
 * Windows machines often have Forced Colors enabled by IT for compliance.
 *
 * Note: this file is unverified visually in this PR — a Mac-only dev team
 * cannot exercise these rules. The first BYOC enterprise customer with HCM
 * enabled is the de facto QA. Track first bug report and prioritize a
 * Windows VM in QA rotation.
 */

@media (forced-colors: active) {
  /* State-bearing surfaces — the soft/tinted backgrounds collapse to Canvas;
     borders carry the state instead. */
  .sidebar__item--active,
  .nav-item--active {
    border: 2px solid CanvasText;
  }

  .alert {
    border: 1px solid CanvasText;
  }

  .badge {
    border: 1px solid CanvasText;
  }

  .stat-card,
  .score-card {
    border: 1px solid CanvasText;
  }

  /* Toasts — error and success collapse to the same surface; a Mark-colored
     border distinguishes danger toasts from neutral. */
  .toast {
    border: 1px solid CanvasText;
  }

  .toast--danger,
  .toast--error {
    border-color: Mark;
  }

  /* Form error states — :invalid and explicit error class need a Mark-colored
     border so validation failures stay perceptible. */
  .input--error,
  .input:invalid,
  .select--error,
  .select:invalid,
  .textarea--error,
  .textarea:invalid {
    border: 2px solid Mark;
  }

  /* Keyboard focus ring uses the system Highlight color so it's always
     distinguishable from the state-bearing borders above. */
  *:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}
