/* Mai.Physio — accessibility toolbar styles + the modes it toggles.
   Built on the design tokens so the widget matches the brand. */

/* ── toggle button + panel ─────────────────────────────── */

.a11y-widget {
  position: fixed;
  inset-block-end: var(--space-5);
  inset-inline-start: var(--space-5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.a11y-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--teal-700);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--dur-fast) var(--ease-soft), transform var(--dur-fast) var(--ease-soft);
}
.a11y-toggle:hover { background: var(--teal-800); transform: translateY(-2px); }

.a11y-panel {
  width: 260px;
  max-width: calc(100vw - var(--space-6));
  padding: var(--space-5);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.a11y-title { margin: 0 0 var(--space-1); font-size: var(--fs-h4); }
.a11y-label { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--text-body); }
.a11y-group { display: flex; flex-direction: column; gap: var(--space-2); }
.a11y-row { display: flex; gap: var(--space-2); }

.a11y-btn,
.a11y-opt {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--teal-800);
  background: var(--teal-50);
  border: 1.5px solid var(--teal-600);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft);
}
.a11y-btn { flex: 1; text-align: center; }
.a11y-opt { text-align: start; }
.a11y-btn:hover,
.a11y-opt:hover { background: var(--teal-100); }

.a11y-opt[aria-pressed="true"] {
  background: var(--teal-700);
  color: #fff;
  border-color: var(--teal-700);
}

.a11y-reset { color: var(--status-error-text); border-color: var(--status-error-text); background: var(--surface-card); }
.a11y-reset:hover { background: var(--red-50); }

.a11y-statement {
  margin-top: var(--space-1);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--text-link);
  text-align: center;
}

/* ── high-contrast mode ────────────────────────────────── */
/* Pushes text to maximum contrast and forces link underlines. Only ever
   increases contrast, so it cannot break AA. */

.a11y-contrast {
  --text-strong: #000000;
  --text-body: #1a1a1a;
  --text-muted: #333333;
  --text-link: #0a3d33;
  --border-default: #333333;
  --border-strong: #000000;
}
.a11y-contrast a { text-decoration: underline; text-underline-offset: 2px; }
.a11y-contrast .btn { border-color: #000 !important; }

/* ── highlight-links mode ──────────────────────────────── */

.a11y-links a:not(.btn) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  outline: 1px dashed currentColor;
  outline-offset: 2px;
}

/* ── responsive ────────────────────────────────────────── */

@media (max-width: 620px) {
  .a11y-widget { inset-block-end: var(--space-4); inset-inline-start: var(--space-4); }
}

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