/* ==========================================================================
   כיפת ברזל דיגיטלית — בסיס משותף (איפוס, נגישות, טופס, באנר עוגיות)
   כל גרסה מגדירה את משתני הצבע והגופן שלה ב- :root משלה.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul[role=list], ol[role=list] { list-style: none; padding: 0; }
[hidden] { display: none !important; }

/* ---------- נגישות ---------- */
.skip-link {
  position: fixed; top: .75rem; right: .75rem; z-index: 1000;
  padding: .75rem 1.25rem; border-radius: .75rem;
  background: #fff; color: #0A1A3A; font-weight: 700; text-decoration: none;
  transform: translateY(-200%); transition: transform .2s ease-out;
}
.skip-link:focus { transform: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--focus, #2563EB); outline-offset: 3px; border-radius: 4px; }

/* ---------- חשיפה בגלילה ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
/* באזור הפתיחה התוכן נכנס מיד בטעינה (בלי לחכות לגלילה): טוב ל-LCP ולגוגל */
.hero [data-reveal], .night [data-reveal] {
  opacity: 1; transform: none; transition: none;
  animation: reveal-in .9s cubic-bezier(.2,.7,.2,1) var(--d, 0ms) both;
}
@keyframes reveal-in { from { opacity: 0; transform: translateY(20px); } }

.scrub-word { transition: color .35s ease, opacity .35s ease; }

/* ---------- טופס: מבנה משותף ---------- */
.field { display: grid; gap: .45rem; }
.field__label { font-weight: 600; font-size: .95rem; }
.field__req { color: var(--danger, #DC2626); margin-inline-start: .15rem; }
.field__error { min-height: 1.2em; font-size: .85rem; color: var(--danger, #DC2626); font-weight: 500; }
.field.has-error .input { border-color: var(--danger, #DC2626); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; line-height: 1.55; cursor: pointer; }
.check input { flex: none; width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--accent, #2563EB); }
.check a { text-underline-offset: 3px; }
.form-note { font-size: .82rem; line-height: 1.6; opacity: .75; }
.form-status { min-height: 1.4em; font-size: .9rem; font-weight: 500; }
/* מלכודת בוטים — מוסתרת בלי לדחוף את העמוד הצידה (left שלילי יוצר גלילה אופקית ב-RTL) */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); opacity: 0; pointer-events: none; }

/* כותרת עליונה בנייד: שם המותג והכפתור לא נשברים לשתי שורות */
.brand, .nav .btn { white-space: nowrap; }
@media (max-width: 420px) {
  .brand { font-size: .95rem !important; }
  .nav .btn { padding: .45rem .8rem; font-size: .82rem; }
}
form.is-sending [type=submit] { opacity: .7; cursor: progress; }

.success { text-align: center; opacity: 0; transform: scale(.96); transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.success.is-visible { opacity: 1; transform: none; }
.success:focus { outline: none; }

/* ---------- באנר עוגיות ---------- */
.consent {
  position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 900;
  max-width: 44rem; margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem; border-radius: 1.1rem;
  background: var(--consent-bg, rgba(15, 23, 42, .88)); color: var(--consent-fg, #F1F5F9);
  border: 1px solid var(--consent-border, rgba(255,255,255,.12));
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .3s ease, transform .45s cubic-bezier(.2,.8,.2,1);
  font-size: .9rem; line-height: 1.6;
}
.consent.is-visible { opacity: 1; transform: none; }
.consent__text { flex: 1 1 22rem; }
.consent__text a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.consent__actions { display: flex; gap: .6rem; flex: none; }
.consent__btn {
  border-radius: 999px; padding: .6rem 1.15rem; font-weight: 600; font-size: .9rem;
  border: 1px solid transparent; transition: transform .1s ease-out, background-color .2s ease;
}
.consent__btn:active { transform: scale(.97); }
.consent__btn--primary { background: var(--accent, #2563EB); color: #fff; }
.consent__btn--ghost { background: transparent; border-color: currentColor; color: inherit; }

/* ---------- העדפות מערכת ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .success { transform: none; transition: opacity .2s ease; }
}
@media (prefers-reduced-transparency: reduce) {
  .consent { background: var(--consent-solid, #0F172A); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print {
  .consent, .skip-link, header, [data-no-print] { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}
