/* ═══════════════════════════════════════════════
   Accessibility toolbar + page adjustments
   Israeli IS 5568 / WCAG-oriented enhancements
   ═══════════════════════════════════════════════ */

/* Floating control — accessibility (start / left) */
.a11y-fab {
  position: fixed;
  z-index: 9600;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 52px;
  min-height: 52px;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(0, 229, 168, 0.35);
  border-radius: 999px;
  background: #0d141c;
  color: var(--accent, #00e5a8);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

body.has-dock .a11y-fab {
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

/* Floating WhatsApp (end / right) — clear of a11y FAB + sticky dock */
.wa-fab {
  position: fixed;
  z-index: 9600;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 52px;
  min-height: 52px;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: #25d366;
  color: #04140f;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

body.has-dock .wa-fab {
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.wa-fab:hover {
  background: #2fe074;
  color: #04140f;
  filter: brightness(1.03);
}

.wa-fab:focus-visible {
  outline: 2px solid #25d366;
  outline-offset: 3px;
}

.wa-fab__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
}

.wa-fab__label {
  max-width: 7em;
  line-height: 1.15;
}

@media (max-width: 420px) {
  .wa-fab__label { display: none; }
  .wa-fab {
    width: 52px;
    padding: 0;
  }
}

html.a11y-contrast .wa-fab {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
}

.a11y-fab:hover {
  background: #121a24;
  border-color: rgba(0, 229, 168, 0.55);
}

.a11y-fab:focus-visible {
  outline: 2px solid var(--accent, #00e5a8);
  outline-offset: 3px;
}

.a11y-fab__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.a11y-fab__label {
  max-width: 7.5em;
  line-height: 1.15;
  text-align: start;
}

@media (max-width: 420px) {
  .a11y-fab__label { display: none; }
  .a11y-fab {
    width: 52px;
    padding: 0;
  }
}

/* Panel */
.a11y-panel[hidden] { display: none !important; }

.a11y-panel {
  position: fixed;
  z-index: 9700;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(72px, calc(12px + env(safe-area-inset-bottom) + 52px));
  width: min(360px, calc(100vw - 24px));
  max-height: min(78vh, 560px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #0b1016;
  color: #f3f1ea;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

body.has-dock .a11y-panel {
  bottom: calc(132px + env(safe-area-inset-bottom, 0px));
}

.a11y-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: #0b1016;
  z-index: 1;
}

.a11y-panel__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.a11y-panel__close {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: transparent;
  color: #f3f1ea;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.a11y-panel__close:focus-visible,
.a11y-panel__btn:focus-visible,
.a11y-panel__link:focus-visible {
  outline: 2px solid #00e5a8;
  outline-offset: 2px;
}

.a11y-panel__body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.a11y-panel__group {
  display: grid;
  gap: 0.45rem;
}

.a11y-panel__label {
  margin: 0;
  color: #a8b0bc;
  font-size: 0.78rem;
  font-weight: 700;
}

.a11y-panel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.a11y-panel__btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #12171f;
  color: #f3f1ea;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.a11y-panel__btn[aria-pressed="true"] {
  border-color: rgba(0, 229, 168, 0.5);
  background: rgba(0, 229, 168, 0.12);
  color: #00e5a8;
}

.a11y-panel__btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.a11y-panel__footer {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.a11y-panel__link {
  color: #00e5a8;
  font-weight: 700;
  font-size: 0.9rem;
  text-underline-offset: 3px;
}

.a11y-panel__hint {
  margin: 0;
  color: #9aa3b0;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ── Page-level adjustments (applied on <html>) ─────────────── */

html.a11y-text-lg {
  font-size: 118%;
}

html.a11y-text-xl {
  font-size: 132%;
}

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

html.a11y-contrast a {
  color: #7dffa8 !important;
}

html.a11y-contrast .btn--primary,
html.a11y-contrast .a11y-fab {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}

html.a11y-contrast .topbar,
html.a11y-contrast .footer,
html.a11y-contrast .form-card,
html.a11y-contrast .a11y-panel,
html.a11y-contrast .drawer__panel {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

html.a11y-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
}

html.a11y-spacing body,
html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing label,
html.a11y-spacing summary {
  line-height: 1.85 !important;
  letter-spacing: 0.02em !important;
}

html.a11y-spacing p,
html.a11y-spacing li {
  margin-bottom: 0.65em !important;
}

html.a11y-readable body,
html.a11y-readable button,
html.a11y-readable input,
html.a11y-readable select,
html.a11y-readable textarea {
  font-family: Arial, Helvetica, "Heebo", sans-serif !important;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.a11y-cursor,
html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%2300E5A8' stroke-width='3'/%3E%3C/svg%3E") 8 8, auto !important;
}
