/* ===== LevelUp — מערכת אפיון חכמה ===== */
/* פלטה בהירה — נגזרת מצבעי הלוגו: נייבי + כחול על לבן נקי */
:root {
  --bg: #f7f9fd;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #edf2fa;
  --border: #dce4f0;
  --text: #14213c;
  --text-dim: #4d5e7a;
  --text-faint: #61708c; /* מאומת >=4.5:1 על לבן ועל הרקעים הבהירים */
  --accent-1: #2563eb;
  --accent-2: #0b6bcb; /* כחול קריא — >=4.5:1 כטקסט על לבן */
  /* --grad: גרדיאנט לכפתורים עם טקסט לבן — שני הקצוות בניגודיות 4.5:1 */
  --grad: linear-gradient(120deg, #2563eb, #143a8c);
  /* --grad-decor: גרדיאנט בוהק — לשימוש דקורטיבי בלבד (בלי טקסט לבן) */
  --grad-decor: linear-gradient(120deg, #2563eb, #0ea5e9);
  --user-bubble: linear-gradient(135deg, #2563eb, #1e40af);
  --success: #0f7a3d;
  --warning: #91620a;
  --danger: #d02752;
  --radius: 18px;
  --shadow: 0 14px 44px rgba(20, 33, 60, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== שלט "האתר בבנייה" — דביק מעל הכול ===== */
.construction-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--grad);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 12px rgba(20, 33, 60, 0.18);
}
.construction-banner .banner-more { font-weight: 400; opacity: 0.92; }
@media (max-width: 640px) {
  .construction-banner { font-size: 0.82rem; }
  .construction-banner .banner-more { display: none; }
}

html, body { height: 100%; }

body {
  font-family: "Heebo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== באנר עוגיות ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: #14213c;
  color: #eef1fa;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: 0 -4px 24px rgba(20, 33, 60, 0.25);
  animation: msgIn 0.35s ease both;
}
.cookie-banner p { max-width: 760px; margin: 0; }
.cookie-banner a { color: #8ab8ff; font-weight: 600; }
.cookie-banner .cookie-ok { padding: 10px 30px; font-size: 0.95rem; flex-shrink: 0; }
@media (max-width: 640px) {
  .cookie-banner { font-size: 0.82rem; text-align: center; }
  .cookie-banner .cookie-ok { width: 100%; }
}

/* רקע חי — קנבס רשת החלקיקים (bg3d.js) */
.bg3d {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* רקע הייטק עדין: רשת שרטוט + הילות כחולות רכות */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(37, 99, 235, 0.09), transparent 60%),
    radial-gradient(700px 500px at 8% 105%, rgba(14, 165, 233, 0.08), transparent 65%),
    linear-gradient(rgba(20, 33, 60, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 60, 0.03) 1px, transparent 1px);
  background-size: auto, auto, 36px 36px, 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,0.35) 55%, black 100%);
  mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,0.35) 55%, black 100%);
  z-index: 0;
}

/* ===== מסכים ===== */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}
.screen.active { display: flex; }
.hidden { display: none !important; }

/* ===== לוגו ===== */
.logo { height: 110px; width: auto; }
.logo-sm { height: 58px; }

/* ===== נחיתה ===== */
.landing-header { padding: 28px 0 0; display: flex; justify-content: center; }
.landing-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 30px 0;
}
.badge {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent-2);
  border: 1px solid rgba(37, 99, 235, 0.30);
  background: rgba(37, 99, 235, 0.06);
  padding: 6px 16px;
  border-radius: 100px;
}
h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
}
.grad {
  background: var(--grad-decor);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 520px;
  font-weight: 400;
}
.lead-sm { color: var(--text-dim); font-size: 1.02rem; }

.trust {
  list-style: none;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.landing-footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 18px 0 24px;
}

/* ===== כפתורים ===== */
.btn-primary {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  border: none;
  border-radius: 100px;
  padding: 14px 34px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(37, 99, 235, 0.30);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(37, 99, 235, 0.42); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; transform: none; }
.btn-big { padding: 18px 44px; font-size: 1.15rem; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.btn-sub { font-size: 0.85rem; font-weight: 400; }

.btn-ghost {
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 28px;
  min-height: 44px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

/* ===== כותרת שיחה + התקדמות ===== */
.chat-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
}
.progress-wrap { flex: 1; }
.progress-steps {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pstep { transition: color 0.3s; }
.pstep.active { color: var(--accent-2); font-weight: 700; }
.pstep.done { color: var(--text); }
.progress-bar {
  height: 5px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 5%;
  background: var(--grad-decor);
  border-radius: 100px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.spec-header-title { font-weight: 700; font-size: 1.05rem; }

/* ===== הודעות ===== */
#screen-chat.active { height: 100dvh; }
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.msg {
  max-width: 82%;
  padding: 13px 18px;
  border-radius: var(--radius);
  font-size: 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: msgIn 0.3s ease both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 10px rgba(20, 33, 60, 0.06);
}
.msg.user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: #fff;
  border-bottom-left-radius: 6px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
}
.msg.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 16px 20px;
}
.msg.typing .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: bounce 1.2s infinite;
}
.msg.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.msg.typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ===== תשובות מהירות ===== */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px 10px;
  min-height: 54px;
}
.chip {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.30);
  border-radius: 100px;
  padding: 10px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
  animation: msgIn 0.3s ease both;
}
.chip:hover { background: rgba(37, 99, 235, 0.12); transform: translateY(-1px); }

/* ===== שורת קלט ===== */
.chat-input-bar-wrap {
  padding: 12px 0 14px;
  border-top: 1px solid var(--border);
}
.chat-input-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.enter-hint {
  color: var(--text-faint);
  font-size: 0.78rem;
  padding-top: 6px;
  text-align: center;
}
@media (max-width: 720px), (pointer: coarse) {
  .enter-hint { display: none; }
}
.ic-accent { color: var(--accent-2); }
#chat-input {
  flex: 1;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 18px;
  resize: none;
  max-height: 140px;
  outline: none;
  transition: border-color 0.15s;
}
#chat-input:focus { border-color: var(--accent-1); }
#chat-input::placeholder { color: var(--text-faint); }
.btn-send {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
}
.btn-send:hover { transform: scale(1.06); }
.btn-send:disabled { opacity: 0.45; cursor: wait; transform: none; }

/* ===== מסמך אפיון ===== */
.spec-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.spec-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
  animation: msgIn 0.4s ease both;
}
.spec-doc h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.spec-doc .spec-biz { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 20px; }
.spec-doc h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 20px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.spec-doc p, .spec-doc li { font-size: 0.98rem; color: var(--text); }
.spec-doc ul { padding-right: 20px; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.spec-feature strong { color: var(--text); }
.spec-feature span { color: var(--text-dim); }
.spec-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.complexity-badge {
  padding: 3px 14px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid var(--border);
}
.complexity-small { color: var(--success); border-color: rgba(15, 122, 61, 0.35); }
.complexity-medium { color: var(--warning); border-color: rgba(145, 98, 10, 0.35); }
.complexity-large { color: var(--danger); border-color: rgba(208, 39, 82, 0.35); }

.spec-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ===== תיבת תיקונים ===== */
.revise-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: msgIn 0.3s ease both;
}
.revise-box label { font-weight: 600; font-size: 0.98rem; }
.revise-box textarea {
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  resize: vertical;
  outline: none;
}
.revise-box textarea:focus { border-color: var(--accent-1); }
.revise-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== טופס יצירת קשר ===== */
.contact-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 30px 0 50px;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.contact-wrap h2 { font-size: 1.7rem; font-weight: 800; }
.contact-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.contact-form label { font-weight: 600; font-size: 0.95rem; margin-top: 8px; }
.contact-form input {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 18px;
  outline: none;
  transition: border-color 0.15s;
}
.contact-form input:focus { border-color: var(--accent-1); }
.method-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.method-chip.selected {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
.contact-form .btn-primary { margin-top: 18px; }

/* ===== מסך סיום ===== */
.done-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 40px 0;
}
.done-check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 2.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 34px rgba(37, 99, 235, 0.35);
  animation: pop 0.35s cubic-bezier(0.22, 1.6, 0.36, 1) both;
}
@keyframes pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.done-wrap h2 { font-size: 1.8rem; font-weight: 800; }
.done-steps {
  text-align: right;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 24px;
  color: var(--text-dim);
}
.done-steps strong { color: var(--text); }
.done-logo { margin-top: 26px; opacity: 0.8; }

/* ===== מובייל ===== */
@media (max-width: 560px) {
  .screen { padding: 0 14px; }
  .msg { max-width: 90%; }
  .progress-steps { font-size: 0.75rem; }
  .trust { flex-direction: column; gap: 8px; }
  h1 { font-size: 1.9rem; }
}

/* ===== נגישות גלובלית ===== */

/* פוקוס נראה לניווט מקלדת — על כל אלמנט אינטראקטיבי */
:is(a, button, summary, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

button:not(:disabled) { cursor: pointer; }

/* אייקוני SVG (icons.js) */
.i { width: 1.2em; height: 1.2em; flex-shrink: 0; vertical-align: -0.22em; }

/* טקסט לקוראי מסך בלבד */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* שגיאות טופס מוצגות ליד השדה (לא alert) */
.field-error {
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 2px;
}
input.invalid, textarea.invalid { border-color: var(--danger) !important; }

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