/* Shared accessibility widget + preference modes. Visual design stays off until a mode is on. */

.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-link {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1400;
  padding: 8px 12px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: none;
  outline: 3px solid #a855f6;
  outline-offset: 2px;
}

[dir="ltr"] .skip-link {
  right: auto;
  left: 8px;
}

:focus-visible {
  outline: 2px solid #7e22ce;
  outline-offset: 2px;
}

:target,
:focus {
  scroll-margin-top: 88px;
}

.a11y-widget {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 1300;
  direction: rtl;
}

[dir="ltr"] .a11y-widget {
  left: auto;
  right: 14px;
  direction: ltr;
}

.a11y-widget__trigger {
  border: 0;
  border-radius: 999px;
  background: #252525;
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  min-height: 36px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.a11y-widget__trigger[data-active="true"] {
  background: #a855f6;
  box-shadow: 0 10px 20px -12px rgba(168, 85, 246, 0.55);
}

.a11y-widget__panel {
  margin-top: 8px;
  width: 180px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  border: 1px solid #e8e8e8;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a11y-widget__panel[hidden] {
  display: none;
}

.a11y-widget__panel button,
.a11y-widget__panel a {
  border: 0;
  border-radius: 8px;
  background: #f7f7f7;
  color: #252525;
  text-align: right;
  font-size: 13px;
  padding: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

[dir="ltr"] .a11y-widget__panel button,
[dir="ltr"] .a11y-widget__panel a {
  text-align: left;
}

.a11y-widget__panel button[aria-pressed="true"] {
  background: #f3e8ff;
  color: #7e22ce;
  font-weight: 700;
  box-shadow: inset -3px 0 0 #a855f6;
}

[dir="ltr"] .a11y-widget__panel button[aria-pressed="true"] {
  box-shadow: inset 3px 0 0 #a855f6;
}

.a11y-widget__panel a {
  display: block;
}

.form-legal-note {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #4b5563;
}

.form-legal-note a {
  color: #7e22ce;
  font-weight: 600;
  text-decoration: underline;
}

.form-legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #374151;
}

.form-legal-consent input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #a855f6;
}

.form-legal-consent a {
  color: #7e22ce;
  font-weight: 600;
  text-decoration: underline;
}

html.a11y-text-large,
html.a11y-text-large body {
  font-size: 18px;
}

html.a11y-text-large input,
html.a11y-text-large textarea,
html.a11y-text-large button,
html.a11y-text-large a,
html.a11y-text-large p,
html.a11y-text-large span,
html.a11y-text-large li,
html.a11y-text-large h1,
html.a11y-text-large h2,
html.a11y-text-large h3,
html.a11y-text-large label {
  font-size: 1.08em !important;
}

html.a11y-high-contrast,
html.a11y-high-contrast body {
  background: #fff !important;
  color: #111 !important;
}

html.a11y-high-contrast * {
  text-shadow: none !important;
}

html.a11y-high-contrast a {
  color: #004aad !important;
  text-decoration: underline !important;
}

html.a11y-high-contrast .bg-custom-purple,
html.a11y-high-contrast .a11y-widget__trigger[data-active="true"] {
  background: #111 !important;
  color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
