/* המעטפת של הכלי. הלוח עצמו חי ב-board.css */

:root {
  --teal: #005074;
  --teal-dark: #00394f;
  --lightblue: #D3E1E0;
  --yellow: #F0A61F;
  --cream: #F9E7CC;
  --coral: #E7745D;
  --coral-ink: #B8452E;
  --peach: #F9DED3;
  --ink: #1b2a33;
  --muted: #5d6f79;
  --paper: #FDF8F0;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

/*
 * הרקע יושב על html ולא על body, כדי שה-::before של body יוכל לשבת מעליו.
 * אם הרקע על body, הדפדפן מעביר אותו לקנבס ושום דבר לא נכנס מתחתיו.
 */
html { background: var(--paper); }

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: Assistant, system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------- רקעים ---------- */

/*
 * שתי שכבות, ושתיהן נשארות חלשות בכוונה.
 * הראשונה נייר אמיתי על כל הדף. השנייה תצלום רגוע שנמוג למעלה,
 * ורק במסכים שבהם מחכים: הפתיחה והבנייה. שם השקט עושה עבודה.
 * z-index שלילי, כדי שהן ישבו מעל צבע הרקע של html ומתחת לכל טקסט.
 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: url("../img/library/textures_04.webp") center / cover no-repeat;
  opacity: .045;
  filter: saturate(.25);
}

.screen.hero::after,
.screen.building::after {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  height: 42svh;
  z-index: -1;
  pointer-events: none;
  background: url("../img/library/sheket_01.webp") center 42% / cover no-repeat;
  opacity: .11;
  filter: saturate(.35);
  -webkit-mask-image: linear-gradient(to top, #000 6%, transparent 100%);
  mask-image: linear-gradient(to top, #000 6%, transparent 100%);
}

/* על הלוח עצמו אין רקע נוסף. הוא כבר מביא נייר ומרקם משלו. */

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

/* Heebo לכל הכותרות בממשק. הסריף נשאר רק על הלוח עצמו, שם הוא עושה את מראה המגזין. */
h1, h2, h3 { font-family: Heebo, system-ui, sans-serif; line-height: 1.15; margin: 0; }

.display {
  font-size: clamp(42px, 13vw, 78px);
  font-weight: 800;
  letter-spacing: -.035em;
  color: var(--teal);
}

.lede { font-size: clamp(18px, 4.6vw, 23px); color: var(--muted); margin: 14px 0 0; text-wrap: balance; }

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

/*
 * חלק מכפתורי ה-CTA הם <a> ולא <button>. בלי האיפוס הזה הם מקבלים
 * קו תחתון, נשארים inline ולכן ה-padding לא מייצר גובה, והכיתוב גולש מהגלולה.
 */
.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 15px 30px;
  cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  line-height: 1.25;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.btn[disabled] { opacity: .38; cursor: not-allowed; }

.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 5px 16px rgba(0, 80, 116, .26); }
.btn-primary:hover:not([disabled]) { background: var(--teal-dark); }

.btn-quiet { background: transparent; color: var(--muted); box-shadow: none; padding: 15px 18px; }
.btn-quiet:hover { color: var(--teal); }

.btn-soft {
  background: #fff; color: var(--teal); border: 1.5px solid var(--lightblue);
  border-radius: 999px; padding: 11px 19px; min-height: 46px; font-weight: 600; font-size: 15px;
}
.btn-soft:hover { border-color: var(--teal); }

/* ---------- מסכים ---------- */

/*
 * הסתרת מסך לא פעיל חייבת לנצח כל display אחר.
 * .hero הגדיר display:flex באותה ספציפיות ואחרי .screen, ולכן ניצח את
 * ה-display:none. מסך הפתיחה נשאר גלוי מעל הלוח, והמשתמשת שסיימה את
 * השאלון ראתה שוב את "מתחילה לבנות את שלי" וחשבה שלא נבנה לה כלום.
 * לכן ה-flex יושב רק על המצב הפעיל.
 */
.screen { display: none !important; padding: 40px 0 70px; }
.screen[data-on] { display: block !important; }
.screen.hero[data-on] { display: flex !important; }

.hero { min-height: 84svh; flex-direction: column; justify-content: center; text-align: center; }
.hero .btn-primary { margin: 34px auto 0; }
.hero-note { font-size: 14.5px; color: var(--muted); margin-top: 20px; }

/* ---------- השאלון ---------- */

.q-bar { height: 4px; background: var(--lightblue); border-radius: 99px; overflow: hidden; margin-bottom: 34px; }
.q-bar i { display: block; height: 100%; background: var(--yellow); width: 0; transition: width .35s ease; }

.q-card { animation: rise .32s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.q-count { font-size: 13.5px; color: var(--muted); letter-spacing: .04em; margin-bottom: 10px; }
.q-text { font-size: clamp(26px, 6.6vw, 36px); font-weight: 700; color: var(--teal); text-wrap: balance; }
.q-hint { font-size: 15px; color: var(--muted); margin: 10px 0 0; }

.q-input {
  width: 100%; margin-top: 22px; padding: 16px 18px;
  font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--lightblue); border-radius: var(--radius);
  resize: vertical; min-height: 110px;
}
.q-input:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 80, 116, .12); }

.q-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.q-opt {
  font: inherit; font-size: 16px; cursor: pointer;
  background: #fff; color: var(--ink);
  border: 1.5px solid var(--lightblue); border-radius: 999px; padding: 11px 20px; min-height: 46px;
  transition: .14s;
}
.q-opt:hover { border-color: var(--teal); }
.q-opt[data-on] { background: var(--teal); border-color: var(--teal); color: #fff; }
.q-opt:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.q-actions { display: flex; align-items: center; gap: 8px; margin-top: 30px; }
.q-actions .btn-primary { margin-right: auto; }

/* ---------- הבנייה ---------- */

.building { text-align: center; padding-top: 16svh; }
.building p { font-size: clamp(19px, 5vw, 25px); color: var(--teal); font-family: Heebo, sans-serif; min-height: 2.4em; }
.scissors { font-size: 40px; display: inline-block; animation: snip 1.1s ease-in-out infinite; }
@keyframes snip { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* ---------- הלוח בתצוגה ---------- */

.board-stage { position: relative; max-width: 560px; margin: 0 auto; }
.board-hint { text-align: center; font-size: 14px; color: var(--muted); margin: 14px 0 0; }

.el-bar {
  position: absolute; z-index: 80; display: flex; gap: 4px;
  background: var(--teal); border-radius: 999px; padding: 4px;
  box-shadow: 0 5px 16px rgba(27, 42, 51, .3);
}
.el-bar button {
  width: 38px; height: 38px; border: 0; border-radius: 999px;
  background: transparent; color: #fff; font-size: 17px; cursor: pointer; line-height: 1;
}
.el-bar button:hover { background: rgba(255, 255, 255, .18); }
.el-bar button:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }

.tools { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 26px 0 0; }

/* בורר צורה. שלושה כפתורים רגילים בשורה היו נראים כמו עוד שלוש פעולות. */
.seg {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin: 14px auto 0;
  padding: 3px;
  background: var(--lightblue);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.seg button {
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  padding: 9px 15px;
  min-height: 42px;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(27, 42, 51, .16); }
.seg button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* הרקע לנייד גבוה וצר, ובלי הצמצום הזה הוא נמתח מעבר למסך */
.board-stage.phone { max-width: 290px; }

.done { text-align: center; margin-top: 44px; padding-top: 34px; border-top: 1px solid var(--lightblue); }
.done h2 { font-size: clamp(28px, 7vw, 40px); color: var(--teal); }
.done p { color: var(--muted); text-wrap: balance; }

/* ---------- טפסים ---------- */

.card {
  background: #fff; border: 1px solid var(--lightblue); border-radius: 18px;
  padding: 26px 24px; margin-top: 26px; text-align: right;
}
.card.warm { background: var(--cream); border-color: #eedcbd; }

.field { margin-top: 15px; }
.field label { display: block; font-size: 14.5px; font-weight: 600; color: var(--teal); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 13px 15px; font: inherit;
  background: #fff; border: 1.5px solid var(--lightblue); border-radius: 11px; min-height: 48px;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 80, 116, .12); }
.field .err { color: var(--coral-ink); font-size: 13.5px; margin-top: 5px; display: none; }
.field[data-invalid] .err { display: block; }
.field[data-invalid] input, .field[data-invalid] textarea { border-color: var(--coral-ink); }

.fine { font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.55; }
.fine a { color: var(--teal); }

/* מי מזמינה לשיחה, מיד מתחת לכפתור. שקט יותר מהטקסט שמעליו. */
.who {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 80, 116, .14);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}
.who p { margin: 0 0 9px; }
.who p:first-child { font-weight: 600; color: var(--teal); }
.who p:last-child { margin-bottom: 0; }

.note-ok { background: var(--peach); border-radius: 14px; padding: 20px 22px; margin-top: 20px; }
.note-ok strong { color: var(--teal); }

/* ---------- הודעות ---------- */

.msg { background: var(--peach); border-right: 4px solid var(--coral); border-radius: 11px; padding: 14px 16px; margin-top: 18px; font-size: 15.5px; }

@media (max-width: 560px) {
  .q-actions { flex-wrap: wrap; }
  .q-actions .btn-primary { width: 100%; margin-right: 0; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
