/* PrepTutorAI — Global Accessibility Stylesheet (WCAG 2.1 AA)
   Loaded by every HTML page under static/.
   Keep rules additive — never override design-critical colours here. */

/* ── Visually hidden — available to AT, invisible on screen ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Skip-to-content link (WCAG 2.4.1 — Bypass Blocks) ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #fff;
  color: #000;
  padding: 8px;
  z-index: 100;
  transition: top 0.2s;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* ── Main content landmark — skip-link focus target (#main-content) ── */
main {
  display: block;
}

#main-content {
  /* Offset programmatic focus/scroll past any fixed header */
  scroll-margin-top: 4rem;
}

/* ── Focus indicators (WCAG 2.4.7 / 2.4.11) ── */
:focus-visible {
  outline: 2px solid #4A90D9;
  outline-offset: 2px;
}

[role="button"]:focus-visible,
button:focus-visible {
  outline: 2px solid #4A90D9;
  outline-offset: 2px;
}

/* Suppress visible ring on non-interactive hash-nav targets that receive
   programmatic focus for screen-reader scroll placement only. Interactive
   controls (.btn, a, button) are unaffected — they never carry tabindex="-1". */
[tabindex="-1"]:focus {
  outline: none;
}

/* ── Contrast: placeholder text (WCAG 1.4.3 — non-text contrast 3:1) ── */
input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: #8a80a2;
}

/* ── Contrast: muted / secondary text on dark card surfaces ──
   #9F94C0 on #131029 (~3.8:1); bump to #b5aed0 (~5.0:1) for AA compliance. */
.auth-card__subtitle,
.loading-text,
.generating-message,
.ready-subtitle {
  color: #b5aed0;
}

/* ── Reduced motion (WCAG 2.3.3) ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
