/* FW-A11Y-006: stronger classic-shell contrast and redundant state cues. */

:root {
  --line: rgba(203, 213, 225, 0.42);
  --text: #f1f5f9;
  --dim: #cbd5e1;
  --cyan: #a5f3fc;
  --purple: #ddd6fe;
  --lime: #bef264;
  --a11y-ok: #bbf7d0;
  --a11y-warn: #fef08a;
  --a11y-error: #fecaca;
  --a11y-info: #bae6fd;
}

/* Keep the same contrast contract when the preference attribute is present. */
html[data-theme="light"] {
  --line: rgba(15, 23, 42, 0.50);
  --text: #0f172a;
  --dim: #334155;
  --cyan: #075985;
  --purple: #6d28d9;
  --lime: #3f6212;
  --a11y-ok: #166534;
  --a11y-warn: #854d0e;
  --a11y-error: #991b1b;
  --a11y-info: #075985;
}

html[data-theme="high_contrast"] {
  --line: #ffffff;
  --text: #ffffff;
  --dim: #ffffff;
  --cyan: #00ffff;
  --purple: #ffff00;
  --lime: #00ff00;
  --a11y-ok: #00ff00;
  --a11y-warn: #ffff00;
  --a11y-error: #ff8080;
  --a11y-info: #00ffff;
}

html[data-theme="low_stimulation"] {
  --line: rgba(230, 234, 239, 0.42);
  --text: #e6eaef;
  --dim: #d5dbe3;
  --cyan: #b8e7f7;
  --purple: #d8cbe6;
  --lime: #d8f3a8;
  --a11y-ok: #c8f1d5;
  --a11y-warn: #f5e7a6;
  --a11y-error: #f4b8be;
  --a11y-info: #c6e7f7;
}

/* Text state remains readable even when color vision is limited. */
.health.ok,
.fleet-metric b.ok,
.fleet-action-status.ok,
.fleet-node-online {
  color: var(--a11y-ok);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}

.health.warn,
.fleet-metric b.warn,
.fleet-action-status.warn {
  color: var(--a11y-warn);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.16em;
}

.health.bad,
.fleet-metric b.bad,
.fleet-action-status.bad,
.fleet-node-stale {
  color: var(--a11y-error);
  font-weight: 700;
  text-decoration: underline double;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.16em;
}

.fleet-node-master {
  color: var(--a11y-info);
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 0.16em;
}

/* Status chips retain their text and gain distinct border patterns. */
.fw-ds-status--ok,
.fw-accessible-toast--success {
  border-style: solid;
  border-width: 2px;
}

.fw-ds-status--warning,
.fw-accessible-toast--warning {
  border-style: dashed;
  border-width: 2px;
}

.fw-ds-status--danger,
.fw-accessible-toast--error,
.fw-accessible-toast--critical {
  border-style: double;
  border-width: 3px;
}

.fw-ds-status--info {
  border-style: dotted;
  border-width: 2px;
}

/* Selected/active controls have a shape cue in addition to accent color. */
.chip.accent,
.orch-task-selected,
.fleet-node-disc.fleet-node-selected circle,
.fleet-node-disc.fleet-node-connect-source circle {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* FW-A11Y-007: honor the OS preference and the local user override for all
   classic-shell decorative motion. Content and state remain available. */
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) *,
  html:not([data-motion="full"]) *::before,
  html:not([data-motion="full"]) *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #dbeafe;
    --text: #ffffff;
    --dim: #e2e8f0;
  }

  body {
    background: #000000;
  }

  .chip,
  .fleet-panel,
  .fleet-metric,
  .fleet-viz-wrap,
  .orch-task-row {
    border-width: 2px;
  }

  .chip:focus-visible,
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
  }
}
