/* ═══════════════════════════════════════════════════════════
   ווידג'ט נגישות + באנר הסכמת עוגיות — משותף לכל עמודי המדד
   (index, privacy, accessibility). הועבר מ-styles.css ב-01.12.2026.
   המשתנים זהים לערכים ב-styles.css, כדי שהעמודים המשניים יקבלו אותם.
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFC;
  --ink: #0F172A;
  --muted: #475569;
  --dim: #566578; /* הוכהה מ-#7C8AA0 כדי לעמוד ב-4.5:1 מול הרקע הבהיר (ת"י 5568 / WCAG AA) */
  --teal: #0D9488;
  --teal-deep: #0F766E;
  --gold-bright: #FBBF24;
  --teal-text-deep: #0B5A54;
  --line: rgba(15, 23, 42, 0.10);
  --line-soft: rgba(15, 23, 42, 0.07);
  --shadow-card: 0 24px 55px -32px rgba(15, 118, 110, 0.28), 0 2px 10px -5px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 32px 70px -34px rgba(15, 118, 110, 0.38), 0 4px 14px -6px rgba(15, 23, 42, 0.10);
  --radius-card: 24px;
  --radius-small: 12px;
  --radius-pill: 9999px;
  --font-display: "Heebo", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* כפתור נגישות צף */

.a11y-fab {
  position: fixed;
  inset-inline-end: 18px;
  inset-block-end: 84px;
  z-index: 200;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 14px 30px -12px rgba(15, 118, 110, 0.6);
}

.a11y-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(15, 23, 42, 0.35);
}

.a11y-panel {
  position: fixed;
  inset-inline-end: 18px;
  inset-block-end: 150px;
  z-index: 220;
  width: min(320px, calc(100vw - 36px));
  max-height: min(78vh, 560px);
  overflow-y: auto;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
}

.a11y-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.a11y-panel-head h2 {
  font-size: 1.05rem;
}

.a11y-close {
  padding: 4px 8px;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  background: none;
  border: 0;
}

.a11y-row {
  margin-bottom: 14px;
}

.a11y-row > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.a11y-btns {
  display: flex;
  gap: 6px;
}

.a11y-btns button {
  flex: 1;
  padding: 7px 4px;
  color: var(--ink);
  font-size: 0.82rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.a11y-btns button[aria-pressed="true"] {
  color: #FFFFFF;
  background: var(--teal-deep);
  border-color: transparent;
}

.a11y-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: background 160ms var(--ease);
}

.a11y-toggle:hover {
  background: var(--surface-soft);
}

/* מתג הפעלה/כיבוי במקום תיבת סימון */
.a11y-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: #CBD5E1;
  cursor: pointer;
  transition: background 200ms var(--ease);
}

.a11y-toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
  transition: transform 200ms var(--ease);
}

.a11y-toggle input[type="checkbox"]:checked {
  background: var(--teal-deep);
}

.a11y-toggle input[type="checkbox"]:checked::before {
  transform: translateX(-20px);
}

.a11y-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.a11y-reset {
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  color: var(--ink);
  font-weight: 700;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.a11y-link {
  display: block;
  margin-top: 8px;
  color: var(--teal-deep);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 480px) {
  .a11y-fab {
    inset-block-end: 76px;
  }

  .a11y-panel {
    inset-block-end: 138px;
  }
}

/* מצבי נגישות מופעלים (class על html, נשמר ב-localStorage) */

html.a11y-text-125 { font-size: 112.5%; }
html.a11y-text-150 { font-size: 125%; }

/* מצב ניגודיות גבוהה — עוקף את משתני העיצוב עצמם (--ink/--muted/--dim/--bg/--surface...)
   כדי שכל רכיב שכבר משתמש בהם (וזה כמעט כל האתר) יתעדכן אוטומטית לרקע שחור/טקסט בהיר,
   בלי צורך לפרט כל סלקטור בנפרד. תוקן אחרי סריקת axe-core שמצאה טקסט כהה על רקע שחור
   ברכיבי בסיס (H1, פסקאות, badge-ים) שנשארו בצבעי ברירת המחדל. */
html.a11y-high-contrast {
  --bg: #000000;
  --surface: #0A0A0A;
  --surface-soft: #151515;
  --ink: #FFFFFF;
  --muted: #E5E7EB;
  --dim: #D6DBE3;
  --line: rgba(255, 255, 255, 0.5);
  --line-soft: rgba(255, 255, 255, 0.3);
  --teal-ink: #99F6E4;
  --teal-deep: #5EEAD4;
  --teal-text-deep: #2DD4BF;
  --gold-deep: #FFD447;
  --gold-mid: #FFD447;
}

html.a11y-high-contrast body { background: var(--bg) !important; color: var(--ink) !important; }
html.a11y-high-contrast .bg-aurora,
html.a11y-high-contrast .bg-grain { display: none !important; }
html.a11y-high-contrast .topbar,
html.a11y-high-contrast .site-footer { background: rgba(0, 0, 0, 0.94) !important; }
html.a11y-high-contrast a { color: #FFD447 !important; }

/* גרדיאנטים על טקסט (המילה המודגשת בכותרת, מספרי שווי) — צבע אחיד קריא במקום גרדיאנט */
html.a11y-high-contrast .grad-word,
html.a11y-high-contrast .money-lines strong b {
  background: none !important;
  -webkit-text-fill-color: #FFD447 !important;
  color: #FFD447 !important;
}

/* badge-ים/תגיות עם רקע rgba(...) עדין שנשען על רקע בהיר — לא נסמכים על שקיפות ב-Mode הזה */
html.a11y-high-contrast .eyebrow,
html.a11y-high-contrast .domain-tag,
html.a11y-high-contrast .form-privacy-note {
  background: #0A2E2A !important;
  color: #99F6E4 !important;
  border-color: #5EEAD4 !important;
}

/* רכיבים עם רקע גרדיאנט + טקסט לבן קבוע (לא דרך משתנה) — נצבעים מחדש לזוג ברור */
html.a11y-high-contrast .primary-button,
html.a11y-high-contrast .topbar-link,
html.a11y-high-contrast .a11y-fab {
  background: #FFD447 !important;
  color: #000000 !important;
  box-shadow: none !important;
}
html.a11y-high-contrast .progress-meta b,
html.a11y-high-contrast .msg-user .msg-bubble,
html.a11y-high-contrast .answer-button.is-selected b,
html.a11y-high-contrast .focus-card li::before,
html.a11y-high-contrast .free-input .send-button,
html.a11y-high-contrast .a11y-btns button[aria-pressed="true"] {
  background: #0A6E62 !important;
  color: #FFFFFF !important;
}

/* גבול ברור לכל כרטיס/מיכל עיקרי (הרקע כבר כהה דרך המשתנים למעלה) */
html.a11y-high-contrast .chat-window,
html.a11y-high-contrast .score-card,
html.a11y-high-contrast .money-card,
html.a11y-high-contrast .focus-card,
html.a11y-high-contrast .domain-card,
html.a11y-high-contrast .track-button,
html.a11y-high-contrast .quiet-next-step,
html.a11y-high-contrast .result-hero,
html.a11y-high-contrast .context-card,
html.a11y-high-contrast .lead-form,
html.a11y-high-contrast .a11y-panel,
html.a11y-high-contrast .money-input,
html.a11y-high-contrast .answer-button,
html.a11y-high-contrast .lead-form input,
html.a11y-high-contrast .money-input input,
html.a11y-high-contrast .msg-bot .msg-bubble {
  border-color: var(--line) !important;
}

html.a11y-high-contrast .gift-bonus-box,
html.a11y-high-contrast .gift-card {
  color: #FFFFFF !important;
  background: #000000 !important;
  border-color: #FFD447 !important;
}

html.a11y-high-contrast .gift-card h3,
html.a11y-high-contrast .gift-card p,
html.a11y-high-contrast .gift-bonus-box p {
  color: #FFFFFF !important;
}

html.a11y-high-contrast .gift-btn {
  color: #000000 !important;
  background: #FFD447 !important;
  border-color: #FFD447 !important;
  box-shadow: none !important;
}

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

html.a11y-readable-font,
html.a11y-readable-font * {
  font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-grayscale { filter: grayscale(100%); }

html.a11y-spacing body { line-height: 1.9 !important; letter-spacing: 0.03em !important; }
html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing span { word-spacing: 0.08em; }

html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
  animation: none !important;
  transition: none !important;
}

/* ═══════════ הסכמת עוגיות ═══════════ */

.ck-footlink {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ck-banner {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 240;
  max-width: 560px;
  /* מיושר לצד ההתחלה (ימין ב-RTL) כדי לא להתנגש בכפתור הנגישות שבפינה הנגדית */
  margin-inline-end: auto;
  color: #F2F4F8;
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  display: none;
}

.ck-banner.show {
  display: block;
}

/* באנר ההסכמה נפרש על כל רוחב המסך מתחת ל-646px ומכסה את כפתור הנגישות
   (z-index 240 מול 200), כך שאי אפשר ללחוץ עליו לפני מתן ההסכמה.
   כל עוד הבאנר פתוח מרימים את הכפתור והתפריט מעליו לפי גובהו האמיתי
   (--ck-h, נמדד ב-cookie-consent.js). ברוחב גדול יותר הבאנר מיושר לצד ההתחלה
   והכפתור יושב בפינה הנגדית, ולכן אין התנגשות ולא נדרש שינוי. */
@media (max-width: 660px) {
  body.ck-visible .a11y-fab {
    inset-block-end: calc(var(--ck-h, 220px) + 26px);
    z-index: 260;
  }
}

/* התפריט עצמו הוא דיאלוג מודאלי: לא מרימים אותו לפי גובה הבאנר (הוא היה נדחף
   מחוץ למסך כשחלונית "התאמה אישית" פתוחה), אלא מניחים אותו ואת שכבת הכיסוי
   שלו מעל הבאנר. כך הוא תמיד נשאר במקומו ובתוך המסך. */
body.ck-visible .a11y-overlay {
  z-index: 250;
}

body.ck-visible .a11y-panel {
  z-index: 255;
}

.ck-banner h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #FFFFFF;
}

.ck-banner p {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(242, 244, 248, 0.82);
}

.ck-banner p a {
  color: var(--gold-bright);
}

.ck-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ck-btns button {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  min-height: 44px;
}

.ck-accept {
  color: #0F172A;
  background: var(--gold-bright);
  border: 1px solid var(--gold-bright);
}

.ck-reject {
  color: #F2F4F8;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.ck-custom {
  color: #F2F4F8;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: underline;
}

.ck-btns button:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.ck-panel {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

.ck-panel.show {
  display: block;
}

.ck-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
}

.ck-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--gold-bright);
}

.ck-row b {
  display: block;
}

.ck-row span {
  color: rgba(242, 244, 248, 0.72);
  font-size: 0.82rem;
}


