/* ===========================================================================
 * Accessibility — effects applied by <AccessibilityWidget> to #a11y-content
 * (the page wrapper). The widget itself sits outside the wrapper so it stays
 * usable in every mode. Standard: ת"י 5568 / WCAG 2.0 AA.
 * ======================================================================== */

/* Text resize */
html.a11y-zoom #a11y-content { zoom: var(--a11y-zoom, 1); }

/* Visual filters (grayscale / contrast / negative) — composed in JS */
html.a11y-filter #a11y-content { filter: var(--a11y-filter, none); }

/* Highlight all links */
html.a11y-links #a11y-content a {
  text-decoration: underline !important;
  text-underline-offset: 2px;
  outline: 1px dashed currentColor;
  outline-offset: 2px;
}

/* Readable font */
html.a11y-readable #a11y-content,
html.a11y-readable #a11y-content * {
  font-family: Arial, "Segoe UI", system-ui, sans-serif !important;
  letter-spacing: 0.01em !important;
}

/* Stop animations */
html.a11y-no-motion #a11y-content *,
html.a11y-no-motion #a11y-content *::before,
html.a11y-no-motion #a11y-content *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Large cursor */
html.a11y-cursor,
html.a11y-cursor * {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 2l14 11-6 1 4 7-3 1-4-7-5 4z' fill='white' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E")
      4 2,
    auto !important;
}

/* Skip-to-content link — hidden until focused (keyboard). */
.a11y-skip {
  position: fixed;
  top: -60px;
  inset-inline-start: 16px;
  z-index: 2147483001;
  padding: 10px 16px;
  border-radius: 8px;
  background: #4f46e5;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: top 0.15s ease;
}
.a11y-skip:focus { top: 16px; outline: 3px solid #ffd400; outline-offset: 2px; }

#a11y-content:focus { outline: none; }

/* ── Widget chrome ──────────────────────────────────────────────────────── */
.a11y-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #ffffff;
  cursor: pointer;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(139, 92, 246, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.a11y-trigger:hover {
  transform: scale(1.06);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 34px rgba(139, 92, 246, 0.65);
}
.a11y-trigger:focus-visible { outline: 3px solid #ffd400; outline-offset: 3px; }

/* Mobile: keep the control, shrink it so it doesn't cover primary actions
   (onboarding submit sits in the same corner). */
@media (max-width: 640px) {
  .a11y-trigger {
    width: 34px;
    height: 34px;
    bottom: 10px;
    left: 10px;
    box-shadow:
      0 3px 10px rgba(0, 0, 0, 0.28),
      0 0 10px rgba(139, 92, 246, 0.28);
  }
  .a11y-trigger > span {
    transform: scale(0.7);
  }
  .a11y-panel {
    bottom: 52px;
    left: 10px;
  }
}

.a11y-panel {
  position: fixed;
  bottom: 84px;
  left: 20px;
  z-index: 2147483000;
  width: 312px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: linear-gradient(180deg, #191822 0%, #121218 100%);
  color: #ffffff;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(109, 40, 217, 0.12);
  animation: a11y-panel-in 0.18s ease-out;
}
@keyframes a11y-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.a11y-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.a11y-head-text { display: flex; flex-direction: column; gap: 2px; }
.a11y-title { font-size: 17px; font-weight: 800; }
.a11y-subtitle { font-size: 11.5px; font-weight: 500; color: #9d9dab; }
.a11y-x {
  width: 30px; height: 30px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #c7c7d4;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.12s, color 0.12s;
}
.a11y-x:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.a11y-x:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }

.a11y-row-font {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 12px; margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px; font-weight: 600;
}
.a11y-font-controls { display: flex; align-items: center; gap: 8px; }
.a11y-font-controls button {
  width: 36px; height: 32px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}
.a11y-font-controls button:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
}
.a11y-font-controls button:disabled { opacity: 0.35; cursor: default; }
.a11y-font-controls button:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }
.a11y-font-dots { display: flex; align-items: center; gap: 4px; }
.a11y-font-dots span {
  width: 6px; height: 6px; border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background-color 0.12s;
}
.a11y-font-dots span.on { background: #a78bfa; }

.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-toggle {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 10px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.045); color: #ffffff;
  font-size: 12px; font-weight: 600; text-align: start; cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s, transform 0.12s;
}
.a11y-toggle:hover {
  border-color: rgba(139, 92, 246, 0.55);
  transform: translateY(-1px);
}
.a11y-toggle.is-active {
  background: rgba(139, 92, 246, 0.16);
  border-color: #8b5cf6;
  color: #fff;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.18);
}
.a11y-toggle:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }
.a11y-toggle-icon {
  flex-shrink: 0; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  transition: background 0.12s;
}
.a11y-toggle.is-active .a11y-toggle-icon {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}
.a11y-toggle-check {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 15px; height: 15px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #8b5cf6; color: #fff;
  font-size: 9px; font-weight: 800; line-height: 1;
  opacity: 0; transform: scale(0.5);
  transition: opacity 0.12s, transform 0.12s;
}
.a11y-toggle.is-active .a11y-toggle-check { opacity: 1; transform: scale(1); }
.a11y-reset {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 10px; border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: transparent; color: #b9b9c7;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background-color 0.12s;
}
.a11y-reset:hover {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.06);
}
.a11y-reset:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }

.a11y-statement {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding: 10px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.22);
  font-size: 12px; font-weight: 700; color: #c4b5fd; text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}
.a11y-statement:hover { background: rgba(139, 92, 246, 0.2); color: #fff; }
.a11y-statement:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }

/* ── Cookie / consent banner (IL Privacy Protection Law + GDPR) ── */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2147482990;
  width: min(420px, calc(100vw - 40px));
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: linear-gradient(180deg, #191822 0%, #121218 100%);
  color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  font-family: Heebo, sans-serif;
}
.cookie-banner-title { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.cookie-banner-text { margin: 0; font-size: 13px; line-height: 1.6; color: #c3c3d5; }
.cookie-banner-text a { color: #c4b5fd; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.cookie-btn-primary, .cookie-btn-ghost {
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.cookie-btn-primary {
  border: 0; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}
.cookie-btn-ghost {
  border: 1px solid rgba(255,255,255,.14);
  background: transparent; color: #e7e7ef;
}
@media (max-width: 640px) {
  .cookie-banner {
    right: 10px; left: 10px; bottom: 56px; width: auto;
  }
}
