/* ==========================================================================
   Chat2BizIL — שכבת יסוד עיצובית (Design Tokens + Base + Primitives)
   נטענת בכל דף באתר, לפני כל גיליון סגנונות ייעודי.
   כל צבע, מרווח, פונט וצל באתר נגזרים מכאן — שינוי כאן משנה את כל האתר.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. טוקנים — מצב בהיר (ברירת מחדל)
   -------------------------------------------------------------------------- */
:root {
  /* -- סולם המותג: כתום -- */
  --brand-50:  #fff7ed;
  --brand-100: #ffedd5;
  --brand-200: #fed7aa;
  --brand-300: #fdba74;
  --brand-400: #fb923c;
  --brand-500: #f97316;
  --brand-600: #ea580c;
  --brand-700: #c2410c;
  --brand-800: #9a3412;

  /* -- סולם המותג: כחול כהה -- */
  --navy-50:  #eef4fb;
  --navy-100: #d8e6f5;
  --navy-200: #b0c9e6;
  --navy-300: #7ca4d2;
  --navy-400: #4a7ab4;
  --navy-500: #2a5788;
  --navy-600: #1b4068;
  --navy-700: #123253;
  --navy-800: #0d2847;
  --navy-900: #08192e;
  --navy-950: #050f1d;

  /* -- ניטרלים חמימים -- */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e6ebf2;
  --gray-300: #cfd8e3;
  --gray-400: #97a6ba;
  --gray-500: #6b7c92;
  --gray-600: #4f6076;
  --gray-700: #3a4859;
  --gray-800: #263140;

  /* -- סמנטיקה -- */
  --success: #0f9d63;
  --success-soft: #e6f7f0;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --whatsapp: #25d366;

  /* -- תפקידי צבע (מה שהרכיבים באמת משתמשים בו) -- */
  --bg:            #ffffff;
  --bg-subtle:     #f7f9fc;
  --bg-sunken:     #eef2f8;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --surface-raised:#ffffff;
  --surface-inverse: var(--navy-800);

  --text:          var(--navy-800);
  --text-strong:   var(--navy-900);
  --text-muted:    var(--gray-600);
  --text-subtle:   var(--gray-500);
  --text-on-brand: #ffffff;
  --text-on-dark:  #eaf1fa;
  --text-on-dark-muted: #9fb3cc;

  --border:        #e3e9f2;
  --border-strong: #cdd7e5;
  --border-inverse: rgba(255, 255, 255, 0.14);

  --brand:         var(--brand-500);
  --brand-hover:   var(--brand-600);
  --brand-active:  var(--brand-700);
  --brand-soft:    var(--brand-50);
  --brand-soft-border: var(--brand-200);
  --on-brand:      #ffffff;

  --accent:        var(--navy-800);
  --accent-hover:  var(--navy-900);
  --accent-soft:   var(--navy-50);

  --ring: color-mix(in srgb, var(--brand-500) 55%, transparent);

  /* -- שכבות זכוכית לסרגל העליון -- */
  --glass-bg:      rgba(255, 255, 255, 0.72);
  --glass-bg-solid:rgba(255, 255, 255, 0.94);
  --glass-border:  rgba(13, 40, 71, 0.08);

  /* -- צללים -- */
  --shadow-xs: 0 1px 2px rgba(13, 40, 71, 0.05);
  --shadow-sm: 0 1px 3px rgba(13, 40, 71, 0.06), 0 1px 2px rgba(13, 40, 71, 0.04);
  --shadow-md: 0 4px 12px rgba(13, 40, 71, 0.07), 0 2px 4px rgba(13, 40, 71, 0.04);
  --shadow-lg: 0 12px 28px rgba(13, 40, 71, 0.09), 0 4px 10px rgba(13, 40, 71, 0.05);
  --shadow-xl: 0 24px 56px rgba(13, 40, 71, 0.13), 0 8px 18px rgba(13, 40, 71, 0.06);
  --shadow-brand: 0 8px 22px rgba(249, 115, 22, 0.26);
  --shadow-brand-lg: 0 14px 34px rgba(249, 115, 22, 0.32);

  /* -- טיפוגרפיה -- */
  --font-sans: 'Rubik', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

  --fs-xs:   0.8125rem;                              /* 13px */
  --fs-sm:   0.875rem;                               /* 14px */
  --fs-base: 1rem;                                   /* 16px */
  --fs-md:   clamp(1.0625rem, 0.25vw + 1rem, 1.125rem);
  --fs-lg:   clamp(1.125rem, 0.4vw + 1rem, 1.25rem);
  --fs-xl:   clamp(1.25rem, 0.6vw + 1.05rem, 1.5rem);
  --fs-2xl:  clamp(1.5rem, 1vw + 1.2rem, 1.875rem);
  --fs-3xl:  clamp(1.75rem, 1.8vw + 1.25rem, 2.375rem);
  --fs-4xl:  clamp(2.125rem, 3vw + 1.3rem, 3.25rem);
  --fs-5xl:  clamp(2.5rem, 4.4vw + 1.25rem, 4.25rem);

  --lh-tight:   1.15;
  --lh-snug:    1.3;
  --lh-normal:  1.6;
  --lh-relaxed: 1.75;

  --tracking-tight: -0.02em;
  --tracking-snug:  -0.01em;
  --tracking-wide:  0.08em;

  /* -- מרווחים -- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* קצב אנכי בין סקשנים — מתכווץ לבד במסכים קטנים */
  --section-y: clamp(3.5rem, 6vw, 6.5rem);
  --content-width: 1200px;
  --prose-width: 70ch;

  /* -- פינות -- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-full: 999px;

  /* -- תנועה -- */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 420ms;

  /* -- שכבות -- */
  --z-base: 1;
  --z-sticky: 900;
  --z-header: 1000;
  --z-nav-panel: 1001;
  --z-overlay: 1100;
  --z-toast: 1200;

  /* -- גובה הסרגל העליון (משמש לריווח עליון של תוכן) -- */
  --header-h: 76px;

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. טוקנים — מצב לילה
   מופעל ע"י data-theme="dark" על <html> (ידני), או ע"י העדפת המערכת
   כשהמשתמש עוד לא בחר ידנית.
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --bg:            #0a1422;
    --bg-subtle:     #0d1b2c;
    --bg-sunken:     #07101c;
    --surface:       #101e33;
    --surface-2:     #16273f;
    --surface-raised:#16273f;
    --surface-inverse: #060e19;

    --text:          #e8eff8;
    --text-strong:   #ffffff;
    --text-muted:    #a8bdd6;
    --text-subtle:   #8299b6;
    --text-on-dark:  #e8eff8;
    --text-on-dark-muted: #a8bdd6;

    --border:        rgba(168, 189, 214, 0.16);
    --border-strong: rgba(168, 189, 214, 0.28);
    --border-inverse: rgba(255, 255, 255, 0.12);

    --brand:         var(--brand-500);
    --brand-hover:   var(--brand-400);
    --brand-active:  var(--brand-300);
    --brand-soft:    rgba(249, 115, 22, 0.14);
    --brand-soft-border: rgba(249, 115, 22, 0.32);

    --accent:        var(--navy-100);
    --accent-hover:  #ffffff;
    --accent-soft:   rgba(176, 201, 230, 0.12);

    --glass-bg:      rgba(10, 20, 34, 0.72);
    --glass-bg-solid:rgba(10, 20, 34, 0.94);
    --glass-border:  rgba(168, 189, 214, 0.14);

    --success-soft:  rgba(15, 157, 99, 0.16);
    --danger-soft:   rgba(220, 38, 38, 0.18);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.55);
    --shadow-xl: 0 26px 60px rgba(0, 0, 0, 0.6);
    --shadow-brand: 0 8px 24px rgba(249, 115, 22, 0.32);
    --shadow-brand-lg: 0 14px 36px rgba(249, 115, 22, 0.38);
  }
}

/* בחירה ידנית — גוברת על העדפת המערכת בשני הכיוונים */
:root[data-theme='dark'] {
  color-scheme: dark;

  --bg:            #0a1422;
  --bg-subtle:     #0d1b2c;
  --bg-sunken:     #07101c;
  --surface:       #101e33;
  --surface-2:     #16273f;
  --surface-raised:#16273f;
  --surface-inverse: #060e19;

  --text:          #e8eff8;
  --text-strong:   #ffffff;
  --text-muted:    #a8bdd6;
  --text-subtle:   #8299b6;
  --text-on-dark:  #e8eff8;
  --text-on-dark-muted: #a8bdd6;

  --border:        rgba(168, 189, 214, 0.16);
  --border-strong: rgba(168, 189, 214, 0.28);
  --border-inverse: rgba(255, 255, 255, 0.12);

  --brand:         var(--brand-500);
  --brand-hover:   var(--brand-400);
  --brand-active:  var(--brand-300);
  --brand-soft:    rgba(249, 115, 22, 0.14);
  --brand-soft-border: rgba(249, 115, 22, 0.32);

  --accent:        var(--navy-100);
  --accent-hover:  #ffffff;
  --accent-soft:   rgba(176, 201, 230, 0.12);

  --glass-bg:      rgba(10, 20, 34, 0.72);
  --glass-bg-solid:rgba(10, 20, 34, 0.94);
  --glass-border:  rgba(168, 189, 214, 0.14);

  --success-soft:  rgba(15, 157, 99, 0.16);
  --danger-soft:   rgba(220, 38, 38, 0.18);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 26px 60px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 8px 24px rgba(249, 115, 22, 0.32);
  --shadow-brand-lg: 0 14px 36px rgba(249, 115, 22, 0.38);
}

/* --------------------------------------------------------------------------
   3. איפוס ובסיס
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-normal);
  color: var(--text);
  background-color: var(--bg);
  direction: rtl;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}

img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* תכונת hidden מגיעה מגיליון ברירת המחדל של הדפדפן בספציפיות נמוכה, וכל
   הצהרת display בגיליון שלנו גוברת עליה. בלי הכלל הזה אלמנט עם hidden
   שמוגדר display:flex פשוט נשאר גלוי. */
[hidden] { display: none !important; }

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { background: none; border: none; cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
  font-weight: 700;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: var(--brand-hover); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

ul, ol { padding-inline-start: 1.25rem; }

hr {
  border: 0;
  height: 1px;
  background: var(--border);
}

::selection {
  background: var(--brand-200);
  color: var(--navy-900);
}
:root[data-theme='dark'] ::selection { background: rgba(249, 115, 22, 0.4); color: #fff; }

/* טבעת פוקוס אחידה ונגישה בכל האתר */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* --------------------------------------------------------------------------
   4. פריסה
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.container-narrow { max-width: 860px; }

/* --------------------------------------------------------------------------
   5. עזרי נגישות
   -------------------------------------------------------------------------- */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: var(--z-toast);
  padding: 0.75rem 1.25rem;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   6. כפתורים
   -------------------------------------------------------------------------- */
.btn {
  --_bg: transparent;
  --_fg: var(--text);
  --_bd: transparent;
  --_shadow: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.82rem 1.6rem;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--tracking-snug);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--r-full);
  border: 1.5px solid var(--_bd);
  background: var(--_bg);
  color: var(--_fg);
  box-shadow: var(--_shadow);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); transition-duration: 60ms; }

.btn-primary {
  --_bg: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-500) 55%, var(--brand-600) 100%);
  --_fg: var(--on-brand);
  --_bd: transparent;
  --_shadow: var(--shadow-brand);
}
.btn-primary:hover { --_shadow: var(--shadow-brand-lg); filter: saturate(1.08); }

.btn-outline {
  --_bg: transparent;
  --_fg: var(--brand-hover);
  --_bd: var(--brand);
}
.btn-outline:hover {
  --_bg: var(--brand-soft);
  --_shadow: 0 8px 20px rgba(249, 115, 22, 0.14);
}

.btn-ghost {
  --_bg: var(--surface-2);
  --_fg: var(--text);
  --_bd: var(--border);
}
.btn-ghost:hover { --_bd: var(--border-strong); --_shadow: var(--shadow-sm); }

.btn-dark {
  --_bg: var(--accent);
  --_fg: var(--bg);
  --_bd: transparent;
  --_shadow: var(--shadow-md);
}
.btn-dark:hover { --_bg: var(--accent-hover); --_shadow: var(--shadow-lg); }

.btn-lg { padding: 1.02rem 2.1rem; font-size: var(--fs-md); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: var(--fs-sm); }
.btn-block { display: flex; width: 100%; }

.btn[disabled], .btn[aria-disabled='true'] {
  opacity: 0.55;
  pointer-events: none;
  transform: none;
}

/* --------------------------------------------------------------------------
   7. שדות טופס
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 0.45rem; }

.field-label,
.form-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.82rem 1rem;
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.input::placeholder,
.textarea::placeholder { color: var(--text-subtle); }

.input:hover,
.textarea:hover,
.select:hover { border-color: var(--border-strong); }

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.textarea { resize: vertical; min-height: 7.5rem; line-height: var(--lh-normal); }

.field-error { font-size: var(--fs-sm); color: var(--danger); font-weight: 500; }

/* --------------------------------------------------------------------------
   8. כרטיסים ומשטחים
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card-pad { padding: clamp(1.5rem, 3vw, 2.25rem); }
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-soft-border);
}

/* אריח אייקון — ריבוע מעוגל בגוון המותג */
.icon-tile {
  display: inline-grid;
  place-items: center;
  inline-size: 3.25rem;
  block-size: 3.25rem;
  font-size: 1.4rem;
  color: var(--brand-hover);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: var(--r-md);
  transition: transform var(--dur-base) var(--ease-spring),
              background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}

/* --------------------------------------------------------------------------
   9. תגיות וכותרות משנה
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--brand-hover);
}
.eyebrow::before {
  content: '';
  inline-size: 1.75rem;
  block-size: 2px;
  border-radius: var(--r-full);
  background: linear-gradient(to left, var(--brand-500), transparent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand-hover);
  border: 1px solid var(--brand-soft-border);
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }

/* --------------------------------------------------------------------------
   10. מתג מצב לילה
   -------------------------------------------------------------------------- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  inline-size: 2.6rem;
  block-size: 2.6rem;
  flex-shrink: 0;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover {
  color: var(--brand-hover);
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.theme-toggle i { font-size: 1.1rem; line-height: 1; }

/* בדפים ללא סרגל עליון theme.js מזריק מתג צף — ההגדרה חייבת לשבת כאן,
   בשכבה שכל דף טוען, ולא בגיליון של האתר הראשי בלבד. */
.theme-toggle-floating {
  position: fixed;
  inset-block-end: 1.25rem;
  inset-inline-start: 1.25rem;
  z-index: var(--z-sticky);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

/* האייקון מראה את המצב שאליו לוחצים, לא את המצב הנוכחי:
   במצב יום מוצג ירח ("עבור ללילה") ובמצב לילה מוצגת שמש.
   שמש מלאה בגודל קטן נקראת כמו גלגל שיניים, ולכן היא לא ברירת המחדל. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .icon-moon { display: none; }
}

/* --------------------------------------------------------------------------
   11. חשיפה בגלילה (מופעל ע"י theme.js)
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* בלי JS — התוכן חייב להיראות ממילא */
.no-js [data-reveal] { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   12. כיבוד העדפת תנועה מופחתת
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   13. הדפסה
   -------------------------------------------------------------------------- */
@media print {
  .navbar, .main-footer, .cookie-banner, .theme-toggle, .mobile-menu-btn { display: none !important; }
  body { background: #fff; color: #000; }
}
