/* ===== Accessibility Widget — Pro ===== */

.a11y-skip-link {
  position: fixed;
  top: -100px;
  right: 16px;
  z-index: 100001;
  padding: 12px 20px;
  background: #171d34;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: top 0.2s ease;
}

.a11y-skip-link:focus {
  top: 0;
  outline: 3px solid #ffb930;
  outline-offset: 2px;
}

.a11y-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 29, 52, 0.45);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
  backdrop-filter: blur(2px);
}

.a11y-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.a11y-widget {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9999;
  font-family: Arial, Helvetica, sans-serif;
  direction: rtl;
}

.a11y-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.a11y-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.a11y-toggle:focus-visible {
  outline: 3px solid #ffb930;
  outline-offset: 3px;
}

.a11y-toggle.is-open {
  transform: scale(1.02);
}

.a11y-icon {
  display: block;
  flex-shrink: 0;
}

.a11y-brand-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  border-radius: 50%;
}

.a11y-toggle .a11y-brand-icon {
  width: 58px;
  height: 58px;
}

.a11y-panel__title-icon.a11y-brand-icon {
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 50%;
  padding: 1px;
}

.a11y-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  width: 340px;
  max-height: min(78vh, 620px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.a11y-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.a11y-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, #345486 0%, #171d34 100%);
  color: #fff;
  flex-shrink: 0;
}

.a11y-panel__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.a11y-panel__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.a11y-panel__subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  opacity: 0.75;
  font-weight: 400;
}

.a11y-panel__close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.a11y-panel__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.a11y-panel__close:focus-visible {
  outline: 2px solid #ffb930;
  outline-offset: 2px;
}

.a11y-panel__body {
  overflow-y: auto;
  padding: 14px 16px;
  flex: 1;
}

.a11y-section {
  margin-bottom: 16px;
}

.a11y-section:last-child {
  margin-bottom: 0;
}

.a11y-section__title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #345486;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e9ebee;
  padding-bottom: 6px;
}

.a11y-profiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.a11y-profile-btn {
  padding: 8px 4px;
  border: 1px solid #e9ebee;
  border-radius: 8px;
  background: #f8f9fd;
  color: #171d34;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: all 0.15s ease;
}

.a11y-profile-btn:hover {
  border-color: #345486;
  background: #f0f3fa;
}

.a11y-profile-btn:focus-visible {
  outline: 2px solid #345486;
  outline-offset: 2px;
}

.a11y-profile-btn.is-active {
  background: #345486;
  border-color: #345486;
  color: #fff;
}

.a11y-font-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f8f9fd;
  border-radius: 10px;
  border: 1px solid #e9ebee;
}

.a11y-font-row__info {
  flex: 1;
}

.a11y-font-row__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #171d34;
}

.a11y-font-row__value {
  display: block;
  font-size: 11px;
  color: #667594;
  margin-top: 2px;
}

.a11y-font-dots {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.a11y-font-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d5e0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.a11y-font-dot.is-filled {
  background: #345486;
  transform: scale(1.15);
}

.a11y-font-btn {
  width: 38px;
  height: 38px;
  border: 2px solid #345486;
  border-radius: 8px;
  background: #fff;
  color: #345486;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.a11y-font-btn:hover:not(:disabled) {
  background: #345486;
  color: #fff;
}

.a11y-font-btn:focus-visible {
  outline: 2px solid #ffb930;
  outline-offset: 2px;
}

.a11y-font-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #bcbcbc;
  color: #bcbcbc;
}

.a11y-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #e9ebee;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.a11y-toggle-row:hover {
  background: #f8f9fd;
  border-color: #c8d0e0;
}

.a11y-toggle-row:focus-visible {
  outline: 2px solid #345486;
  outline-offset: 2px;
}

.a11y-toggle-row__info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.a11y-toggle-row__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f0f3fa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #345486;
}

.a11y-toggle-row__icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.a11y-toggle-row__text {
  flex: 1;
}

.a11y-toggle-row__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #171d34;
}

.a11y-toggle-row__desc {
  display: block;
  font-size: 11px;
  color: #667594;
  margin-top: 1px;
}

.a11y-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  pointer-events: none;
}

.a11y-switch__track {
  display: block;
  width: 100%;
  height: 100%;
  background: #d0d5e0;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.a11y-switch__thumb {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.a11y-toggle-row.is-active .a11y-switch__track {
  background: #345486;
}

.a11y-toggle-row.is-active .a11y-switch__thumb {
  transform: translateX(-20px);
}

.a11y-panel__footer {
  padding: 12px 16px;
  border-top: 1px solid #e9ebee;
  background: #f8f9fd;
  flex-shrink: 0;
}

.a11y-reset {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #171d34;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 8px;
}

.a11y-reset:hover {
  background: #345486;
}

.a11y-reset:focus-visible {
  outline: 2px solid #ffb930;
  outline-offset: 2px;
}

.a11y-footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.a11y-footer-link {
  font-size: 11px;
  color: #345486;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.a11y-footer-link:hover {
  color: #171d34;
}

.a11y-footer-link:focus-visible {
  outline: 2px solid #345486;
  outline-offset: 2px;
}

.a11y-kbd-hint {
  font-size: 10px;
  color: #8c919c;
}

.a11y-kbd-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  background: #e9ebee;
  border-radius: 3px;
  font-size: 10px;
  font-family: inherit;
  border: 1px solid #d0d5e0;
}

.a11y-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.a11y-reading-guide {
  position: fixed;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(255, 185, 48, 0.18);
  border-top: 2px solid rgba(255, 185, 48, 0.6);
  border-bottom: 2px solid rgba(255, 185, 48, 0.6);
  pointer-events: none;
  z-index: 9996;
  display: none;
  transform: translateY(-50%);
}

html.a11y-reading-guide .a11y-reading-guide {
  display: block;
}

.a11y-big-cursor {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 3px solid #345486;
  border-radius: 50%;
  background: rgba(52, 84, 134, 0.15);
  pointer-events: none;
  z-index: 9995;
  display: none;
  transform: translate(-50%, -50%);
  transition: width 0.1s ease, height 0.1s ease;
}

html.a11y-big-cursor .a11y-big-cursor {
  display: block;
}

@media (max-width: 480px) {
  .a11y-widget {
    left: 12px;
    bottom: 12px;
  }

  .a11y-toggle {
    width: 54px;
    height: 54px;
  }

  .a11y-toggle .a11y-brand-icon {
    width: 54px;
    height: 54px;
  }

  .a11y-panel {
    width: calc(100vw - 24px);
    max-width: 340px;
  }

  .a11y-profiles {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-panel,
  .a11y-overlay,
  .a11y-toggle,
  .a11y-skip-link {
    transition: none;
  }
}

/* ===== Accessibility Modes ===== */

html.a11y-font-1 { font-size: 112.5%; }
html.a11y-font-2 { font-size: 125%; }
html.a11y-font-3 { font-size: 137.5%; }
html.a11y-font-4 { font-size: 150%; }
html.a11y-font-5 { font-size: 162.5%; }
html.a11y-font-6 { font-size: 175%; }

html.a11y-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-high-contrast .main-area,
html.a11y-high-contrast section,
html.a11y-high-contrast header,
html.a11y-high-contrast footer,
html.a11y-high-contrast .container,
html.a11y-high-contrast [class*="__area"],
html.a11y-high-contrast [class*="__wrap"] {
  background-color: #000 !important;
  color: #fff !important;
}

html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4,
html.a11y-high-contrast h5,
html.a11y-high-contrast h6,
html.a11y-high-contrast p,
html.a11y-high-contrast li,
html.a11y-high-contrast span,
html.a11y-high-contrast label,
html.a11y-high-contrast td,
html.a11y-high-contrast th {
  color: #fff !important;
}

html.a11y-high-contrast a:not(.a11y-widget a):not(.a11y-skip-link) {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

html.a11y-high-contrast button:not(.a11y-widget button),
html.a11y-high-contrast .tg-btn {
  border: 2px solid #fff !important;
  color: #fff !important;
}

html.a11y-dark-mode body {
  background: #1a1a2e !important;
  color: #e0e0e0 !important;
}

html.a11y-dark-mode .main-area,
html.a11y-dark-mode section,
html.a11y-dark-mode header,
html.a11y-dark-mode footer,
html.a11y-dark-mode [class*="__area"]:not(.a11y-widget):not(.a11y-overlay) {
  background-color: #1a1a2e !important;
  color: #e0e0e0 !important;
}

html.a11y-dark-mode h1,
html.a11y-dark-mode h2,
html.a11y-dark-mode h3,
html.a11y-dark-mode h4,
html.a11y-dark-mode p,
html.a11y-dark-mode li,
html.a11y-dark-mode span,
html.a11y-dark-mode label {
  color: #e0e0e0 !important;
}

html.a11y-dark-mode a:not(.a11y-widget a) {
  color: #7eb8ff !important;
}

html.a11y-grayscale body {
  filter: grayscale(100%);
}

html.a11y-grayscale .a11y-widget,
html.a11y-grayscale .a11y-overlay,
html.a11y-grayscale .a11y-reading-guide,
html.a11y-grayscale .a11y-big-cursor {
  filter: none;
}

html.a11y-low-saturation body {
  filter: saturate(0.4);
}

html.a11y-low-saturation .a11y-widget,
html.a11y-low-saturation .a11y-overlay {
  filter: none;
}

html.a11y-highlight-links a:not(.a11y-widget a):not(.a11y-skip-link) {
  outline: 3px solid #ffb930 !important;
  outline-offset: 2px;
  background: rgba(255, 185, 48, 0.12) !important;
  text-decoration: underline !important;
}

html.a11y-underline-links a:not(.a11y-widget a):not(.a11y-skip-link) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

html.a11y-readable-font body,
html.a11y-readable-font body *:not(.a11y-widget):not(.a11y-widget *) {
  font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-line-spacing body p,
html.a11y-line-spacing body li,
html.a11y-line-spacing body td,
html.a11y-line-spacing body th,
html.a11y-line-spacing body span:not([class*="icon"]),
html.a11y-line-spacing body a,
html.a11y-line-spacing body label,
html.a11y-line-spacing body h1,
html.a11y-line-spacing body h2,
html.a11y-line-spacing body h3,
html.a11y-line-spacing body h4 {
  line-height: 2 !important;
}

html.a11y-letter-spacing body,
html.a11y-letter-spacing body *:not(.a11y-widget):not(.a11y-widget *) {
  letter-spacing: 0.08em !important;
  word-spacing: 0.12em !important;
}

html.a11y-no-animations *,
html.a11y-no-animations *::before,
html.a11y-no-animations *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

html.a11y-focus-highlight *:focus-visible:not(.a11y-widget *) {
  outline: 4px solid #ffb930 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(255, 185, 48, 0.3) !important;
}

html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: none !important;
}

html.a11y-text-center body p,
html.a11y-text-center body li,
html.a11y-text-center body h1,
html.a11y-text-center body h2,
html.a11y-text-center body h3,
html.a11y-text-center body h4 {
  text-align: center !important;
}
