/* ═══════════════════════════════════════════════════════════
   מדד העסק החכם — light editorial, teal + gold brand accents
   טורקיז = המערכת/ה-AI · זהב = כסף וערך בלבד
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ספר המותג הרשמי — עסק חכם:
     בסיס #0F172A · טורקיז #14B8A6 · כתום #F59E0B · רקע #F8FAFC */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFC;
  --ink: #0F172A;
  --muted: #475569;
  --dim: #566578; /* הוכהה מ-#7C8AA0 כדי לעמוד ב-4.5:1 מול הרקע הבהיר (ת"י 5568 / WCAG AA) */

  --teal: #0D9488;
  --teal-bright: #14B8A6;
  --teal-deep: #0F766E;
  --teal-ink: #115E59;

  --gold: #F59E0B;
  --gold-deep: #B45309;
  --gold-bright: #FBBF24;
  /* גרסאות "בטוחות לניגודיות" (AA) לשימוש בטקסט/רקעים עם טקסט לבן —
     --gold ו-var(--teal-bright) הבהירים מדי לא עוברים 4.5:1 מול טקסט לבן/כהה */
  --gold-mid: #C2660A;
  --gold-cta-deep: #9C4808;
  --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);
  --shadow-gold: 0 14px 30px -12px rgba(180, 83, 9, 0.50);

  --radius-card: 24px;
  --radius-bubble: 18px;
  --radius-small: 12px;
  --radius-pill: 9999px;

  --font-display: "Heebo", sans-serif;
  --font-body: "Assistant", "Heebo", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

::selection {
  background: rgba(20, 184, 166, 0.22);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ─── רקע: הילה בהירה בגווני המותג + גרעון ─── */

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(44% 36% at 86% 6%, rgba(20, 184, 166, 0.13) 0%, transparent 62%),
    radial-gradient(36% 30% at 6% 16%, rgba(245, 158, 11, 0.10) 0%, transparent 60%),
    radial-gradient(52% 42% at 48% 112%, rgba(13, 148, 136, 0.09) 0%, transparent 62%),
    var(--bg);
  animation: bg-drift 32s var(--ease-soft) infinite alternate;
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes bg-drift {
  to {
    transform: translate3d(-2%, 1.5%, 0) scale(1.06);
  }
}

.app-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

/* ─── סרגל עליון ─── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 66px;
  padding: 10px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.06rem;
}

.brand img {
  width: auto;
  height: 44px;
  object-fit: contain;
}

.brand span {
  white-space: nowrap;
}

.brand sup {
  font-size: 0.58em;
  color: var(--gold-deep);
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-inline-start: auto;
  min-height: 42px;
  padding: 0 18px;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-pill);
  box-shadow: 0 14px 30px -18px rgba(13, 148, 136, 0.8);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.topbar-link svg {
  flex: none;
}

.progress-meta b {
  min-width: 52px;
  padding: 6px 12px;
  color: #FFFFFF;
  text-align: center;
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 18px -8px rgba(13, 148, 136, 0.55);
}

/* ─── מסכים ─── */

.screen {
  position: relative;
  display: none;
  min-height: calc(100vh - 66px);
  padding: clamp(30px, 6vw, 72px) clamp(18px, 5vw, 64px);
}

.screen.is-active {
  display: grid;
  animation: screen-in 480ms var(--ease) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ─── טיפוגרפיה ─── */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 6.2vw, 5.2rem);
}

h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.6rem);
}

h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
}

.grad-word {
  background: linear-gradient(120deg, var(--gold-mid), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 0 0 18px;
  padding: 7px 16px;
  color: var(--teal-deep);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.24);
  border-radius: var(--radius-pill);
}

.eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.lead {
  max-width: 62ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.25rem);
  line-height: 1.75;
}

/* ─── כפתורים ─── */

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  transition:
    transform 200ms var(--ease),
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease),
    background 200ms var(--ease),
    opacity 200ms var(--ease);
}

.primary-button {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold-cta-deep));
  box-shadow: var(--shadow-gold);
}

.primary-button svg {
  flex: none;
}

.ghost-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.ghost-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.start-button {
  margin-top: 32px;
  min-height: 58px;
  padding-inline: 34px;
  font-size: 1.12rem;
}

/* ─── מסך מבוא ─── */

.intro-screen {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
}

.intro-copy {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.track-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 700px;
  margin-top: 32px;
}

.track-button {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px 20px;
  overflow: hidden;
  color: var(--ink);
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.35);
  transition:
    transform 200ms var(--ease),
    border-color 200ms var(--ease),
    background 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.track-button::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--teal-bright), transparent);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.track-button span {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 900;
}

.track-button b {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
  line-height: 1.5;
}

.track-button.is-selected {
  background: linear-gradient(160deg, rgba(20, 184, 166, 0.09), var(--surface) 55%);
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 18px 40px -24px rgba(13, 148, 136, 0.5);
}

.track-button.is-selected::before {
  opacity: 1;
}

.track-button.is-selected span {
  color: var(--teal-ink);
}

.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-width: 640px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.proof-row li {
  display: grid;
  gap: 2px;
  padding-inline: 22px;
  border-inline-start: 1px solid var(--line);
}

.proof-row li:first-child {
  padding-inline-start: 0;
  border-inline-start: 0;
}

.proof-row b {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
}

.proof-row span {
  color: var(--dim);
  font-size: 0.9rem;
}

/* ─── חלון צ'אט (משותף לדמו ולשאלון) ─── */

.chat-window {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.chat-id {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.chat-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, rgba(20, 184, 166, 0.18), rgba(20, 184, 166, 0.05));
  border: 1px solid rgba(13, 148, 136, 0.25);
}

.chat-avatar img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.chat-names {
  display: grid;
  line-height: 1.25;
}

.chat-names strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
}

.chat-names .live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--teal-deep); /* var(--teal) לא עמד ב-4.5:1 על הרקע הבהיר (axe: color-contrast) */
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
}

.chat-names .live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-bright);
  animation: live-pulse 2.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(20, 184, 166, 0); }
}

.domain-tag {
  flex: none;
  padding: 5px 13px;
  color: var(--teal-deep);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(20, 184, 166, 0.09);
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: var(--radius-pill);
  transition: opacity 240ms var(--ease);
}

.progress-bar {
  height: 4px;
  background: rgba(15, 23, 42, 0.06);
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 420ms var(--ease);
}

.chat-log {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 280px;
  max-height: min(48vh, 520px);
  padding: 22px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* בועות */

.msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 88%;
  animation: msg-in 380ms var(--ease) both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg-bot {
  align-self: flex-start;
}

.msg-user {
  align-self: flex-end;
  justify-content: flex-end;
}

.msg-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.10);
  border: 1px solid rgba(13, 148, 136, 0.20);
}

.msg-avatar img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.msg-bubble {
  display: grid;
  gap: 3px;
  padding: 12px 16px;
  border-radius: var(--radius-bubble);
  font-size: 1rem;
  line-height: 1.55;
}

.msg-bot .msg-bubble {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-end-start-radius: 6px;
  box-shadow: 0 6px 18px -14px rgba(15, 23, 42, 0.35);
}

.msg-bot .msg-bubble strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.06rem;
  line-height: 1.4;
}

.msg-bot .msg-bubble span {
  color: var(--muted);
  font-size: 0.92rem;
}

.msg-user .msg-bubble {
  color: #FFFFFF;
  font-weight: 600;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
  border-end-end-radius: 6px;
  box-shadow: 0 10px 22px -14px rgba(13, 148, 136, 0.7);
}

/* אינדיקטור הקלדה */

.msg-typing .msg-bubble {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 58px;
  min-height: 40px;
}

.msg-typing .msg-bubble i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.4;
  animation: typing-dot 1.1s ease-in-out infinite;
}

.msg-typing .msg-bubble i:nth-child(2) { animation-delay: 0.15s; }
.msg-typing .msg-bubble i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* אפשרויות תשובה (quick replies) */

.chat-options {
  display: grid;
  gap: 9px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.chat-options:empty {
  display: none;
}

.answer-button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  padding: 12px 15px;
  color: var(--ink);
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  animation: msg-in 340ms var(--ease) both;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.answer-button:nth-child(2) { animation-delay: 60ms; }
.answer-button:nth-child(3) { animation-delay: 120ms; }
.answer-button:nth-child(4) { animation-delay: 180ms; }

.answer-button b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--teal-deep);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.07);
  transition: inherit;
}

.answer-button strong {
  display: block;
  font-weight: 700;
  line-height: 1.35;
}

.answer-button > span > span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 0.88rem;
  line-height: 1.4;
}

.answer-button.is-selected {
  border-color: rgba(13, 148, 136, 0.55);
  background: linear-gradient(160deg, rgba(20, 184, 166, 0.1), var(--surface) 60%);
}

.answer-button.is-selected b {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
  border-color: transparent;
}

/* קלט טקסט חופשי */

.free-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  animation: msg-in 340ms var(--ease) both;
}

.free-input input {
  min-height: 50px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  outline: 0;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.free-input input:focus {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.free-input .send-button {
  min-height: 50px;
  padding: 0 22px;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 22px -12px rgba(13, 148, 136, 0.65);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.free-input .skip-button {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 6px 14px;
  color: var(--dim);
  font-size: 0.9rem;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.free-input .skip-button:hover {
  color: var(--muted);
}

.chat-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 14px;
  background: var(--surface-soft);
}

.chat-foot .ghost-button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
}

.foot-hint {
  color: var(--dim);
  font-size: 0.86rem;
}

/* ─── מסך שאלון: פריסה ─── */

.quiz-screen {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  align-content: start;
}

.quiz-screen .chat-window {
  max-width: 860px;
  justify-self: stretch;
  height: min(80vh, 800px);
  height: min(80dvh, 800px);
}

.quiz-screen .chat-log {
  flex: 1;
  min-height: 0;
  max-height: none;
}

/* ─── מצב צ'אט מסך-מלא ─── */

body.quiz-active {
  overflow: hidden;
}

body.quiz-active .quiz-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  min-height: 0;
  padding: 0;
  margin: 0;
  background: var(--bg);
  animation: none;
}

body.quiz-active .quiz-screen .chat-window {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.quiz-active .context-card {
  display: none;
}

.context-card {
  position: sticky;
  top: 90px;
  padding: clamp(20px, 3vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 30px -26px rgba(15, 23, 42, 0.4);
}

.context-card > span {
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}

.context-card ol {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: domains;
}

.context-card li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--dim);
  font-size: 0.95rem;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface-soft);
  counter-increment: domains;
  transition: border-color 240ms var(--ease), background 240ms var(--ease), color 240ms var(--ease);
}

.context-card li::before {
  content: counter(domains);
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  transition: inherit;
}

.context-card li.is-done {
  color: var(--muted);
}

.context-card li.is-done::before {
  content: "✓";
  color: var(--teal-deep);
  border-color: rgba(13, 148, 136, 0.35);
  background: rgba(20, 184, 166, 0.08);
}

.context-card li.is-current {
  color: var(--teal-ink);
  font-weight: 700;
  border-color: rgba(13, 148, 136, 0.4);
  background: rgba(20, 184, 166, 0.07);
}

.context-card li.is-current::before {
  color: #FFFFFF;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
}

/* ─── מבוא: דמו + מסקוט ─── */

.intro-demo {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0;
}

.demo-window {
  width: min(100%, 440px);
  transform: rotate(-1.2deg);
}

.demo-log {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.demo-chips i {
  padding: 7px 14px;
  color: var(--teal-deep);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px dashed rgba(13, 148, 136, 0.4);
  border-radius: var(--radius-pill);
  background: var(--surface);
  animation: chip-float 5.5s ease-in-out infinite;
}

.demo-chips i:nth-child(2) { animation-delay: 0.8s; }
.demo-chips i:nth-child(3) { animation-delay: 1.6s; }

@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.index-mascot {
  position: absolute;
  inset-inline-start: -18px;
  bottom: 34px;
  z-index: 2;
  width: clamp(90px, 10vw, 130px);
  pointer-events: none;
  filter: drop-shadow(0 18px 26px rgba(15, 23, 42, 0.22));
  animation: mascot-float 5s var(--ease-soft) infinite alternate;
}

.index-mascot img {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes mascot-float {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.demo-caption {
  margin: 16px 0 0;
  color: var(--dim);
  font-size: 0.92rem;
}

/* ─── מסך תוצאה ─── */

.result-screen {
  align-content: start;
  gap: 22px;
}

.result-hero {
  position: relative;
  overflow: hidden;
  max-width: 1120px;
  padding: clamp(24px, 4vw, 44px);
  background:
    radial-gradient(60% 110% at 85% 0%, rgba(20, 184, 166, 0.08), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.result-hero::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.result-hero h2 b {
  color: var(--gold-deep);
}

.result-hero h2 small {
  font-size: 0.5em;
  font-weight: 800;
  color: var(--dim);
}

.result-hero > p {
  max-width: 72ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.6vw, 1.2rem);
  line-height: 1.75;
}

.personal-quote {
  max-width: 720px;
  margin: 20px 0 0;
  padding: 16px 20px;
  border-inline-start: 3px solid var(--gold);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.06);
}

.personal-quote span {
  display: block;
  color: var(--gold-deep);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
}

.personal-quote p {
  margin: 6px 0 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.6;
}

.personal-insight {
  font-weight: 500;
}

.personal-insight:empty {
  display: none;
}

/* גריד תוצאות */

.result-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(340px, 1.25fr);
  grid-template-areas:
    "score money"
    "focus money"
    "domain domain";
  gap: 18px;
  align-items: stretch;
  max-width: 1120px;
}

.score-card { grid-area: score; }
.money-card { grid-area: money; }
.focus-card { grid-area: focus; }
.domain-card { grid-area: domain; }

.score-card,
.money-card,
.focus-card,
.domain-card {
  padding: clamp(20px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 14px 34px -28px rgba(15, 23, 42, 0.4);
}

.focus-card > span,
.domain-card > span {
  display: block;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 800;
}

.score-ring {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  align-items: center;
}

.score-ring svg {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
}

.score-ring circle:first-of-type {
  stroke: rgba(15, 23, 42, 0.07);
}

#scoreArc {
  stroke: url("#scoreGradient");
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 900ms var(--ease);
}

.score-ring span {
  display: block;
  color: var(--muted);
  font-weight: 600;
}

.score-ring strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 900;
  line-height: 1.1;
}

.score-card p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

/* כרטיס כסף — זהב */

.money-card label,
.lead-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
}

.money-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 240px);
  margin-top: 12px;
  padding: 9px 15px;
  border: 1px solid rgba(180, 83, 9, 0.3);
  border-radius: 15px;
  background: rgba(245, 158, 11, 0.05);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

/* היה חסר אינדיקטור פוקוס נראה על שדה השעה (outline:0 בלי חלופה) */
.money-input:focus-within {
  border-color: rgba(180, 83, 9, 0.65);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.money-input input,
.lead-form input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}

.money-input input {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
}

.money-input span {
  color: var(--gold-deep);
  font-weight: 700;
}

.money-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.money-lines div {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: var(--surface-soft);
}

.money-lines span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.money-lines strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  font-weight: 900;
  line-height: 1.15;
}

.money-lines strong b {
  background: linear-gradient(120deg, var(--gold-mid), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.money-lines div:last-child {
  border-color: rgba(180, 83, 9, 0.32);
  background: rgba(245, 158, 11, 0.07);
}

.formula {
  margin: 16px 0 0;
  padding: 11px 14px;
  color: var(--teal-ink);
  font-weight: 700;
  text-align: center;
  border-radius: 13px;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
}

/* מוקדי שיפור */

.focus-card ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: focus;
}

.focus-card li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  color: var(--ink);
  font-weight: 700;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface-soft);
  counter-increment: focus;
}

.focus-card li::before {
  content: counter(focus);
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 800;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-text-deep));
}

/* פירוק תחומים */

#domainScores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.domain-score {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface-soft);
}

.domain-score b {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.96rem;
}

.domain-score i {
  display: block;
  height: 7px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.07);
  border-radius: var(--radius-pill);
}

.domain-score i span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: inherit;
  transition: width 800ms var(--ease);
}

.domain-score strong {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--teal-ink);
}

/* ליד ─ הצעד הבא */

.quiet-next-step {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 22px;
  align-items: start;
  max-width: 1120px;
  padding: clamp(22px, 3.4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.quiet-next-step p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.lead-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
}

.lead-form input {
  min-height: 48px;
  padding: 0 14px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.lead-form input:focus {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.13);
}

.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
}

.lead-consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin-top: 1px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  display: grid;
  place-content: center;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.lead-consent input[type="checkbox"]::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  transform: scale(0);
  transition: transform 140ms var(--ease);
  background: var(--surface);
}

.lead-consent input[type="checkbox"]:checked {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
}

.lead-consent input[type="checkbox"]:checked::before {
  transform: scale(1);
}

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

.form-privacy-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-soft);
}

.form-privacy-note a {
  color: var(--teal-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.required-mark {
  color: var(--gold-deep);
}

.optional-mark {
  color: var(--dim);
  font-weight: 500;
  font-size: 0.85em;
}

.form-note {
  margin: 0;
  color: var(--teal-deep);
  font-weight: 700;
}

.whatsapp-result-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  color: var(--teal-deep);
  font-weight: 800;
  text-decoration: none;
  border: 1px solid rgba(13, 148, 136, 0.32);
  border-radius: var(--radius-pill);
  background: rgba(20, 184, 166, 0.07);
  transition: background 180ms var(--ease), border-color 180ms var(--ease);
}

.whatsapp-result-link:hover {
  background: rgba(20, 184, 166, 0.13);
  border-color: rgba(13, 148, 136, 0.5);
}

.restart-button {
  justify-self: start;
}

/* ─── hover (מכשירים עם עכבר בלבד) ─── */

@media (hover: hover) {
  .topbar-link:hover {
    transform: translateY(-1px);
    filter: saturate(1.06);
    box-shadow: 0 18px 34px -18px rgba(13, 148, 136, 0.95);
  }

  .primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -12px rgba(180, 83, 9, 0.6);
  }

  .ghost-button:hover:not(:disabled) {
    color: var(--ink);
    border-color: rgba(13, 148, 136, 0.4);
  }

  .track-button:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 148, 136, 0.4);
    box-shadow: 0 18px 40px -26px rgba(13, 148, 136, 0.5);
  }

  .answer-button:hover {
    transform: translateY(-1px);
    border-color: rgba(13, 148, 136, 0.45);
    box-shadow: 0 12px 26px -18px rgba(13, 148, 136, 0.55);
  }

  .free-input .send-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -12px rgba(13, 148, 136, 0.75);
  }
}

/* ─── רספונסיביות ─── */

@media (max-width: 1180px) {
  .money-lines {
    grid-template-columns: 1fr;
  }

  #domainScores {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .topbar {
    position: relative;
  }

  .intro-screen,
  .quiz-screen,
  .quiet-next-step {
    grid-template-columns: 1fr;
  }

  /* מובייל: קודם הדמיית הצ'אט, אחר כך כפתורי הכניסה למדד */
  .intro-screen {
    gap: 0;
  }

  .intro-copy {
    display: contents;
  }

  .eyebrow,
  #introTitle,
  .lead {
    order: 1;
  }

  .intro-demo {
    order: 2;
    max-width: 560px;
    justify-self: center;
    margin-top: 32px;
  }

  .track-picker,
  .start-button,
  .proof-row {
    order: 3;
  }

  .context-card {
    position: static;
    order: 2;
  }

  .context-card ol {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .context-card li {
    padding: 7px 11px;
    font-size: 0.86rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "score"
      "money"
      "focus"
      "domain";
  }

  .money-lines {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand img {
    height: 36px;
  }

  .brand {
    font-size: 0.98rem;
  }

  .progress-meta {
    font-size: 0.86rem;
  }

  .topbar-link {
    order: 3;
    margin-inline-start: 0;
    min-height: 38px;
    padding-inline: 14px;
    font-size: 0.86rem;
  }

  .screen {
    min-height: auto;
    padding: 26px 14px 44px;
  }

  h1 {
    font-size: clamp(2.2rem, 10.5vw, 3.4rem);
  }

  h2 {
    font-size: clamp(1.7rem, 8.5vw, 2.6rem);
  }

  .track-picker {
    grid-template-columns: 1fr;
  }

  .track-button {
    min-height: 0;
  }

  .proof-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .proof-row li {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 10px;
    padding-inline: 0;
    padding-block-start: 12px;
    border-inline-start: 0;
    border-block-start: 1px solid var(--line);
  }

  .proof-row li:first-child {
    padding-block-start: 0;
    border-block-start: 0;
  }

  .chat-log {
    /* מובייל: השאלה (ההודעה האחרונה) חייבת להישאר גלויה מעל התשובות */
    flex: 1 1 auto;
    min-height: 150px;
    max-height: none;
    padding: 16px 13px;
  }

  .quiz-screen .chat-window {
    height: min(90vh, 760px);
    height: min(90dvh, 760px);
  }

  .msg {
    max-width: 94%;
  }

  /* התשובות מוגבלות בגובה וגוללות פנימית כדי לא לדחוס את השאלה */
  .chat-options {
    flex: 0 1 auto;
    max-height: 42dvh;
    overflow-y: auto;
    padding: 12px 13px 13px;
  }

  .answer-button {
    padding: 11px 13px;
  }

  .chat-foot {
    padding-inline: 13px;
  }

  .foot-hint {
    display: none;
  }

  .money-lines {
    grid-template-columns: 1fr;
  }

  .domain-score {
    grid-template-columns: 1fr auto;
  }

  .domain-score i {
    grid-column: 1 / -1;
  }

  .score-ring {
    grid-template-columns: auto 1fr;
    gap: 16px;
  }

  .score-ring svg {
    width: 108px;
    height: 108px;
  }

  .index-mascot {
    position: static;
    margin-top: 12px;
    width: 92px;
  }
}

@media (max-width: 430px) {
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .chat-foot .ghost-button {
    width: auto;
  }

  .quiet-next-step .primary-button {
    white-space: normal;
    min-height: 56px;
  }

  .free-input {
    grid-template-columns: 1fr;
  }

  .free-input .send-button {
    width: 100%;
  }
}

/* ─── reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   Accessibility overrides — דלג לתוכן, פוטר, ווידג'ט נגישות
   ═══════════════════════════════════════════════════════════ */

.skip-link {
  position: fixed;
  top: -100px;
  inset-inline-start: 16px;
  z-index: 300;
  padding: 10px 18px;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.95rem;
  background: var(--teal-deep);
  border-radius: 10px;
  transition: top 200ms var(--ease);
}

.skip-link:focus {
  top: 16px;
}

.site-footer {
  padding: 22px clamp(18px, 5vw, 64px) 34px;
  color: var(--dim);
  font-size: 0.86rem;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}

.site-footer a {
  color: var(--teal-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.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-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;
}

.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;
}


/* ═══════════════════════════════════════════════════════════
   מדד העסק החכם — Paywall & Coupon Gate
   ═══════════════════════════════════════════════════════════ */
.gate-box {
  margin-block: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1.5px solid rgba(13, 148, 136, 0.25);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.gate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.gate-price-tag {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--teal-deep);
  background: rgba(20, 184, 166, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(20, 184, 166, 0.3);
}
.gate-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}
.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pay-button {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
  color: #0F172A !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.9rem 1.6rem !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: 0 10px 25px -8px rgba(245, 158, 11, 0.5) !important;
  transition: transform .25s, box-shadow .25s !important;
}
.pay-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(245, 158, 11, 0.6) !important;
}
.coupon-toggle-btn {
  background: transparent;
  border: 1.5px dashed var(--line);
  color: var(--muted);
  font-weight: 700;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-pill);
  transition: border-color .25s, color .25s, background-color .25s;
}
.coupon-toggle-btn:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: rgba(20, 184, 166, 0.05);
}
.coupon-form {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface-soft);
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
}
.coupon-input-wrap {
  display: flex;
  gap: 0.5rem;
}
.coupon-input-wrap input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--line);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fff;
}
.coupon-input-wrap input:focus {
  border-color: var(--teal);
  outline: none;
}
.coupon-submit-btn {
  padding: 0.7rem 1.3rem;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-small);
  transition: background-color .25s;
}
.coupon-submit-btn:hover {
  background: var(--teal-deep);
}
.coupon-msg {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0;
}
.coupon-msg.error {
  color: #DC2626;
}
.coupon-msg.success {
  color: #059669;
}
.unlocked-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #059669;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  padding: 0.4rem 0.9rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-pill);
}
