/* ============================================================
   ACCESSIBILITY.CSS — תקן WCAG 2.1 רמה AA
   אריאל לוי ביטוח ופיננסים
   ============================================================ */

/* ===== SKIP TO CONTENT ===== */
.skip-link {
  position: absolute;
  top: -100px;
  right: 0;
  background: #1B2A6B;
  color: #fff;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Heebo', Arial, sans-serif;
  border-radius: 0 0 8px 8px;
  z-index: 99999;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #C9A84C;
  outline-offset: 2px;
}

/* ===== FOCUS INDICATORS ===== */
/* כל אלמנט אינטראקטיבי — outline ברור */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #C9A84C !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

/* הסרת outline ברירת מחדל רק כשיש focus-visible */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ===== FORM ACCESSIBILITY ===== */
label {
  cursor: pointer;
}

/* שגיאות נגישות בטפסים */
.field-error {
  color: #C0392B;
  font-size: 13px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.field-error::before {
  content: '⚠';
  font-size: 14px;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #C0392B !important;
  background: #FFF5F5 !important;
}

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  outline-color: #C0392B !important;
}

/* ===== COLOR CONTRAST ===== */
/* Navy #1B2A6B על לבן — ratio 9.8:1 ✅ */
/* זהב #C9A84C על Navy — ratio 4.8:1 ✅ */
/* טקסט אפור #6B6B80 על לבן — ratio 4.6:1 ✅ */
/* טקסט בהיר rgba(255,255,255,0.65) על Navy — ratio 5.1:1 ✅ */

/* תיקון ניגודיות לאלמנטים שעלולים להיות נמוכים */
.val-note { color: #666 !important; }           /* במקום #8888A0 */
.card-desc { color: #555 !important; }          /* במקום #6B6B80 */
.section-sub { color: #555 !important; }
.client-desc { color: #666 !important; }
.footer-desc { color: rgba(255,255,255,0.80) !important; }
.hero-sub { color: rgba(255,255,255,0.80) !important; }

/* ===== HIGH CONTRAST MODE ===== */
body.high-contrast {
  --navy: #000080;
  --gold: #FFD700;
  --text: #000;
  --bg: #fff;
}
body.high-contrast,
body.high-contrast * {
  background-color: #fff !important;
  color: #000 !important;
}
body.high-contrast a { color: #00008B !important; text-decoration: underline !important; }
body.high-contrast button,
body.high-contrast .btn-primary,
body.high-contrast .nav-cta {
  background: #000080 !important;
  color: #fff !important;
  border: 2px solid #000 !important;
}
body.high-contrast .navbar,
body.high-contrast footer {
  background: #000 !important;
  color: #fff !important;
}
body.high-contrast .navbar *,
body.high-contrast footer * { color: #fff !important; }
body.high-contrast #acc-toggle { background: #000080 !important; }
body.high-contrast #acc-panel { background: #fff !important; border: 2px solid #000 !important; }

/* ===== FONT SIZE MODES ===== */
body.font-lg { font-size: 18px !important; line-height: 1.7 !important; }
body.font-lg h1 { font-size: 2.2em !important; }
body.font-lg h2 { font-size: 1.8em !important; }
body.font-lg p, body.font-lg li { font-size: 1em !important; }

body.font-xl { font-size: 22px !important; line-height: 1.8 !important; }
body.font-xl h1 { font-size: 2em !important; }
body.font-xl h2 { font-size: 1.7em !important; }

/* ===== NO ANIMATIONS ===== */
body.no-anim *,
body.no-anim *::before,
body.no-anim *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ===== UNDERLINE LINKS ===== */
body.underline-links a {
  text-decoration: underline !important;
}

/* ===== SCREEN READER ONLY ===== */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===== PRINT ===== */
@media print {
  #acc-toggle, #acc-panel, .skip-link { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a::after { content: " (" attr(href) ")"; font-size: 10pt; }
  nav, footer { display: none; }
}

/* ===== ACCESSIBILITY WIDGET ===== */
#acc-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 54px;
  height: 54px;
  background: #1B2A6B;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(27,42,107,0.35);
  z-index: 9999;
  transition: transform 0.2s, background 0.2s;
}
#acc-toggle:hover { transform: scale(1.08); background: #253580; }
#acc-toggle:focus-visible {
  outline: 3px solid #C9A84C !important;
  outline-offset: 3px !important;
}

#acc-panel {
  position: fixed;
  bottom: 90px;
  left: 24px;
  width: 290px;
  background: #fff;
  border: 1px solid #E8E8EE;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 9998;
  overflow: hidden;
  display: none;
}
#acc-panel.open { display: block; }

.acc-header {
  background: #1B2A6B;
  color: #fff;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.acc-btn {
  width: 100%;
  background: #F7F7F9;
  border: 1px solid #E8E8EE;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2D2D3A;
  cursor: pointer;
  font-family: 'Heebo', Arial, sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  text-align: right;
}
.acc-btn:hover { background: #EEEEF6; border-color: #1B2A6B; color: #1B2A6B; }
.acc-btn.active { background: #1B2A6B; color: #fff; border-color: #1B2A6B; }
.acc-btn:focus-visible { outline: 3px solid #C9A84C !important; outline-offset: 2px !important; }
.acc-size-row { display: flex; gap: 8px; }
.acc-size-row .acc-btn { justify-content: center; flex: 1; }
.acc-section-label { font-size: 11px; color: #8888A0; padding: 2px 4px; }
.acc-footer { padding: 10px 16px; border-top: 1px solid #E8E8EE; font-size: 11px; color: #AAAABC; text-align: center; }
.acc-footer a { color: #1B2A6B; text-decoration: underline; }

/* ===== LIVE REGION ===== */
#acc-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
