/*
 * צבעי המותג מערכת המותג ב־Canva, ועוד שני גוונים כהים של הכחול־אפור
 * לטקסט ולכפתורים, כדי לעמוד בניגודיות נגישה (#66798A על שמנת קרוב מדי לסף).
 */
:root {
  --cream: #FFFFF0;
  --nude: #F2E0D4;
  --powder: #D8C1BB;
  --peach: #E7B698;
  --slate: #66798A;        /* כחול־אפור של המותג: קווים, עיטורים, התקדמות */
  --primary: #4E5F6E;      /* ערך עבודה: כפתורים ובחירה (ניגודיות 6.5:1 על שמנת) */
  --ink: #33404C;          /* ערך עבודה: טקסט */
  --ink-soft: #55636F;     /* ערך עבודה: טקסט משני */
  --error: #8A3B2E;
  --card: #FFFFF8;
  --radius: 14px;
  --font: "Rubik", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
}

.page {
  position: relative;
  min-height: 100vh;
  padding: 24px 16px 48px;
  overflow-x: hidden;
}

.leaf {
  position: absolute;
  width: 110px;
  height: 110px;
  fill: none;
  stroke: var(--powder);
  stroke-width: 1.6;
  pointer-events: none;
}
.leaf-top { bottom: 6px; left: 6px; transform: scaleX(-1); opacity: .8; }

.app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- טיפוגרפיה ---------- */
.overline {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
h1 {
  margin: 0 0 12px;
  font-size: 1.85rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
}
h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ink);
}
h2:focus { outline: none; }
h3 {
  margin: 20px 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}
p { margin: 0 0 12px; }
.subtitle { color: var(--ink-soft); font-size: 1.1rem; margin-bottom: 20px; }
.hint { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 16px; }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--powder);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--powder);
}

/* ---------- התקדמות ---------- */
.progress { margin-bottom: 24px; }
.progress-text { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 8px; }
.progress ol {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.progress li {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.progress li::before {
  content: "";
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--nude);
  margin-bottom: 6px;
}
.progress li.done::before { background: var(--slate); }
.progress li.current::before { background: var(--peach); }
.progress li.current { color: var(--ink); font-weight: 500; }

/* ---------- כרטיס ושאלות ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--powder);
  border-radius: var(--radius);
  padding: 22px 18px;
}

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 4px; width: 100%; }

.options { display: grid; gap: 10px; }

.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border: 1.5px solid var(--powder);
  border-radius: 12px;
  background: var(--cream);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--slate); }
.option input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.option.selected {
  border-color: var(--primary);
  background: var(--nude);
}
.option span { flex: 1; }

.option-extra { margin: 4px 0 0; }

/* ---------- שדות טקסט ---------- */
.field { margin-top: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="time"], input[type="number"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--powder);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 84px; resize: vertical; }
input[type="time"], input[type="number"] { max-width: 180px; }
input[type="email"] { direction: ltr; text-align: right; }
[aria-invalid="true"] { border-color: var(--error) !important; }
input::placeholder, textarea::placeholder { color: #66717C; } /* ניגודיות 4.9:1 על לבן */

/* ---------- ימים ---------- */
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.day {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--powder);
  border-radius: 999px;
  background: var(--cream);
  cursor: pointer;
}
.day input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.day.selected { border-color: var(--primary); background: var(--nude); }

/* ---------- סולם 0–10 ---------- */
.scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 4px;
}
.scale label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1.5px solid var(--powder);
  border-radius: 8px;
  background: var(--cream);
  cursor: pointer;
  font-weight: 500;
}
.scale input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.scale label.selected { background: var(--primary); border-color: var(--primary); color: var(--cream); }
.scale label:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------- תובנה ---------- */
.insight p { margin-bottom: 10px; }
.insight .reflect { font-weight: 500; }
.insight .note { color: var(--ink-soft); font-size: 0.95rem; }
.next-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--nude);
  border-inline-start: 4px solid var(--peach);
}
.next-box h3 { margin-top: 0; }

.panel {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1.5px dashed var(--slate);
  border-radius: 12px;
}

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 500;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  background: var(--primary);
  color: var(--cream);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn-secondary { background: transparent; color: var(--primary); }
.btn-secondary:hover { background: var(--nude); color: var(--ink); }
.btn-link {
  background: none;
  border: 0;
  padding: 4px 0;
  min-height: auto;
  color: var(--primary);
  text-decoration: underline;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.chip {
  font: inherit;
  font-size: 0.92rem;
  text-align: start;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--powder);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--slate); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.option:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
}
.nav .spacer { flex: 1; }

.error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #F8E7E2;
  color: var(--error);
  font-weight: 500;
}
.error:empty { display: none; }

.status { font-size: 0.95rem; color: var(--primary); min-height: 1.5em; margin-top: 8px; }

/* ---------- פתיחה ---------- */
.welcome .card { padding: 26px 20px; }
.disclaimer { font-size: 0.88rem; color: var(--ink-soft); margin-top: 18px; }
.signature { margin-top: 22px; font-size: 0.92rem; color: var(--ink-soft); text-align: center; }
.signature strong { display: block; color: var(--ink); font-weight: 500; }
.heart { color: var(--peach); }

/* ---------- סיכום ---------- */
.summary-list { margin: 0; }
.summary-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--nude);
}
.summary-row:last-child { border-bottom: 0; }
.summary-row dt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}
.summary-row dd { margin: 4px 0 0; }
.week-question {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--nude);
  border-radius: 12px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .page { padding-top: 48px; }
  h1 { font-size: 2.2rem; }
  .card { padding: 28px 30px; }
  .leaf { width: 150px; height: 150px; }
}

@media (max-width: 380px) {
  .scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- הדפסה ---------- */
@media print {
  body { background: #fff; font-size: 12pt; }
  .page { padding: 0; }
  .leaf, .progress, .nav, .actions, .no-print, .btn-link { display: none !important; }
  .card { border: 0; padding: 0; background: #fff; }
  .summary-row { break-inside: avoid; }
  .week-question, .next-box { background: #fff; border: 1px solid #ccc; }
}
