/* ========================================
   KEYMASTER — Accessibility Widget & Modes
   WCAG 2.1 AA / Israeli Standard IS 5568
   ======================================== */

/* ===== SKIP TO MAIN CONTENT ===== */
.skip-to-main {
  position: absolute;
  top: -100px;
  right: 0;
  left: 0;
  z-index: 99999;
  text-align: center;
  background: #1a56db;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 24px;
  text-decoration: none;
  transition: top 0.1s;
  font-family: 'Heebo', Arial, sans-serif;
}
.skip-to-main:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: -3px;
}

/* ===== GLOBAL FOCUS INDICATOR ===== */
:focus-visible {
  outline: 3px solid #1a56db !important;
  outline-offset: 2px !important;
}

/* ===== ACCESSIBILITY WIDGET ===== */
#a11y-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 10000;
  font-family: 'Heebo', Arial, sans-serif;
  direction: rtl;
}

/* Toggle button */
#a11y-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1a56db;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(26,86,219,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}
#a11y-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(26,86,219,0.65);
}
#a11y-toggle-btn:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px !important;
}

/* Panel */
#a11y-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 300px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
}
#a11y-panel[hidden] { display: none; }

.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1a56db;
  color: #fff;
}
.a11y-panel-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
}
.a11y-panel-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.a11y-panel-close:hover { background: rgba(255,255,255,0.35); }
.a11y-panel-close:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
}

.a11y-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 72vh;
  overflow-y: auto;
}

.a11y-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #777;
  margin: 0 0 8px;
}

/* Button groups (font & contrast) */
.a11y-btn-group {
  display: flex;
  gap: 6px;
}
.a11y-font-btn,
.a11y-contrast-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px 8px;
  background: #f4f5f8;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
  color: #1a2340;
  min-width: 0;
}
.a11y-font-btn:hover,
.a11y-contrast-btn:hover { background: #e4e7f0; }
.a11y-font-btn.active,
.a11y-contrast-btn.active {
  background: #dbeafe;
  border-color: #1a56db;
  color: #1a56db;
}
.a11y-font-btn:focus-visible,
.a11y-contrast-btn:focus-visible {
  outline: 2px solid #1a56db !important;
  outline-offset: 2px !important;
}
.a11y-btn-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* Contrast color swatches */
.a11y-contrast-swatch {
  width: 28px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.12);
  display: block;
}
.a11y-swatch-normal { background: linear-gradient(135deg, #fff 50%, #0d1b3e 50%); }
.a11y-swatch-high   { background: #000; border-color: #333; }
.a11y-swatch-dark   { background: #1a1a2e; border-color: #555; }

/* Toggle switches */
.a11y-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.a11y-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}
.a11y-toggle-row:hover { background: #f4f5f8; }
.a11y-toggle-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.a11y-switch {
  width: 40px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.a11y-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.a11y-toggle-row input:checked + .a11y-switch { background: #1a56db; }
.a11y-toggle-row input:checked + .a11y-switch::after { transform: translateX(-18px); }
.a11y-toggle-row input:focus-visible + .a11y-switch {
  outline: 2px solid #1a56db !important;
  outline-offset: 2px !important;
}
.a11y-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a2340;
}

/* Reset button */
.a11y-reset-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #fff5f5;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.a11y-reset-btn:hover { background: #fee2e2; }
.a11y-reset-btn:focus-visible {
  outline: 2px solid #dc2626 !important;
  outline-offset: 2px !important;
}

/* Panel footer */
.a11y-panel-footer {
  padding: 10px 16px;
  border-top: 1px solid #eee;
  text-align: center;
}
.a11y-statement-link {
  font-size: 0.78rem;
  color: #1a56db;
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 600px) {
  #a11y-widget { bottom: 16px; right: 16px; }
  #a11y-panel {
    position: fixed;
    bottom: 80px;
    right: 8px;
    left: 8px;
    width: auto;
  }
}


/* ========================================
   ACCESSIBILITY MODE OVERRIDES
   ======================================== */

/* ----- Font size ----- */
html.a11y-font-1 { font-size: 112%; }
html.a11y-font-2 { font-size: 125%; }
html.a11y-font-3 { font-size: 140%; }

/* ----- High contrast ----- */
html.a11y-contrast-high body {
  background: #ffffff !important;
  color: #000000 !important;
}
html.a11y-contrast-high #navbar,
html.a11y-contrast-high .mobile-menu {
  background: #000000 !important;
  border-bottom: 2px solid #ffffff !important;
}
html.a11y-contrast-high .nav-links a,
html.a11y-contrast-high .nav-phone,
html.a11y-contrast-high .mobile-menu a {
  color: #ffffff !important;
}
html.a11y-contrast-high #hero,
html.a11y-contrast-high #why-us {
  background: #000000 !important;
}
html.a11y-contrast-high #services,
html.a11y-contrast-high #testimonials,
html.a11y-contrast-high #coverage {
  background: #ffffff !important;
}
html.a11y-contrast-high #contact {
  background: #f0f0f0 !important;
}
html.a11y-contrast-high .service-card,
html.a11y-contrast-high .testimonial-card,
html.a11y-contrast-high .contact-form {
  background: #ffffff !important;
  border: 2px solid #000000 !important;
  color: #000000 !important;
}
html.a11y-contrast-high .service-card h3 { color: #000000 !important; }
html.a11y-contrast-high .service-card p  { color: #000000 !important; }
html.a11y-contrast-high .section-header h2 { color: #ffffff !important; }
html.a11y-contrast-high #services .section-header h2,
html.a11y-contrast-high #testimonials .section-header h2,
html.a11y-contrast-high #coverage .section-header h2 { color: #000000 !important; }
html.a11y-contrast-high .section-header p,
html.a11y-contrast-high #services .section-header p,
html.a11y-contrast-high #testimonials .section-header p { color: #111111 !important; }
html.a11y-contrast-high .testimonial-text { color: #000000 !important; font-style: normal !important; }
html.a11y-contrast-high .why-item h4 { color: #ffffff !important; }
html.a11y-contrast-high .why-item p   { color: #dddddd !important; }
html.a11y-contrast-high .form-group label { color: #000000 !important; }
html.a11y-contrast-high input,
html.a11y-contrast-high textarea {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
}
html.a11y-contrast-high #footer { background: #000000 !important; }
html.a11y-contrast-high .footer-contact a,
html.a11y-contrast-high .footer-logo-block p { color: #ffffff !important; }
html.a11y-contrast-high a { color: #0000cc !important; text-decoration: underline !important; }
html.a11y-contrast-high a:visited { color: #551a8b !important; }
html.a11y-contrast-high .btn-primary,
html.a11y-contrast-high .submit-btn {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}
html.a11y-contrast-high .ca-circle-icon {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
}

/* ----- Dark mode ----- */
html.a11y-contrast-dark body {
  background: #121212 !important;
  color: #e0e0e0 !important;
}
html.a11y-contrast-dark #navbar { background: #0e0e1a !important; }
html.a11y-contrast-dark .mobile-menu { background: #1a1a2e !important; }
html.a11y-contrast-dark #hero,
html.a11y-contrast-dark #why-us   { background: #1a1a2e !important; }
html.a11y-contrast-dark #services,
html.a11y-contrast-dark #coverage,
html.a11y-contrast-dark #testimonials { background: #1e1e1e !important; }
html.a11y-contrast-dark #contact { background: #191919 !important; }
html.a11y-contrast-dark #footer  { background: #0a0a0a !important; }
html.a11y-contrast-dark .service-card,
html.a11y-contrast-dark .testimonial-card,
html.a11y-contrast-dark .contact-form {
  background: #2a2a2a !important;
  color: #e0e0e0 !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}
html.a11y-contrast-dark .service-card h3  { color: #f0f0f0 !important; }
html.a11y-contrast-dark .service-card p   { color: #bbbbbb !important; }
html.a11y-contrast-dark .section-header h2 { color: #f0f0f0 !important; }
html.a11y-contrast-dark .section-header p  { color: #aaaaaa !important; }
html.a11y-contrast-dark .testimonial-text  { color: #cccccc !important; }
html.a11y-contrast-dark .testimonial-author strong { color: #e0e0e0 !important; }
html.a11y-contrast-dark .form-group label  { color: #c0c0c0 !important; }
html.a11y-contrast-dark input,
html.a11y-contrast-dark textarea {
  background: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
}
html.a11y-contrast-dark .footer-contact a  { color: #aaaaaa !important; }
html.a11y-contrast-dark .footer-logo-block p { color: #888 !important; }
html.a11y-contrast-dark .nav-links a       { color: #c0c0c0 !important; }

/* Coverage area cards in dark mode */
html.a11y-contrast-dark #coverage a[href] {
  background: #2a2a2a !important;
  color: #e0e0e0 !important;
}

/* ----- Underline links ----- */
html.a11y-underline-links a:not(.btn):not(.ca-circle):not(.social-btn):not(.nav-logo-link):not(.a11y-reset-btn) {
  text-decoration: underline !important;
}

/* ----- Stop animations ----- */
html.a11y-no-anim *,
html.a11y-no-anim *::before,
html.a11y-no-anim *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ----- Dyslexia-friendly font ----- */
html.a11y-dyslexia body,
html.a11y-dyslexia input,
html.a11y-dyslexia textarea,
html.a11y-dyslexia button,
html.a11y-dyslexia select {
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif !important;
  letter-spacing: 0.06em !important;
  word-spacing: 0.16em !important;
  line-height: 1.9 !important;
}
