/* סגולה — גרסה 3 (שאלון). מינימלי, אוורירי, שקט. */
:root {
  --bg: #fbfaf8;
  --ink: #1c1b19;
  --muted: #6f6a60;
  --accent: #b08d4f;
}

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

/* תכונת hidden של HTML חייבת תמיד לגבור על display מותאם */
[hidden] { display: none !important; }

/* לשון זכר/נקבה — מוצג רק הנוסח של המגדר שנבחר בשאלה הראשונה
   (ברירת-מחדל: זכר, עד שנבחרה נקבה) */
body:not(.gender-w) .g-w { display: none !important; }
body.gender-w .g-m { display: none !important; }
/* במצב-אדמין שני הנוסחים גלויים לעריכה (הזכרי ראשון, הנקבי אחריו) */
body.editing .g-m, body.editing .g-w { display: revert !important; }
body.editing .g-w::before { content: " ⇐נקבה: "; color: var(--accent); font-size: 0.65em; }
body.editing .g-m::before { content: "זכר: "; color: var(--accent); font-size: 0.65em; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== מבוא ===== */
.intro {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 1.6rem;
}
.intro__name {
  font-size: clamp(3.2rem, 9vw, 6.2rem);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.intro__rule {
  width: 46px;
  height: 1px;
  background: var(--accent);
  opacity: 0.85;
}
.intro__purpose {
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
  max-width: 30ch;
  line-height: 1.7;
}
.intro__cta {
  margin-top: 0.8rem;
  display: inline-block;
  padding: 0.85em 2.2em;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: transparent;
  transition: background 0.25s ease, color 0.25s ease;
}
.intro__cta:hover,
.intro__cta:focus-visible {
  background: var(--accent);
  color: #fff;
}

/* ===== השאלון ===== */
.quiz {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  gap: 1.4rem;
}
.quiz__progress {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.q {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  width: 100%;
}
.q__title {
  font-size: clamp(1.7rem, 5.4vw, 3rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  max-width: 24ch;
}
.q__opts {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: 560px;
  margin-top: 0.4rem;
}
.q__opt {
  width: 100%;
  padding: 1em 1.4em;
  font-family: inherit;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid #e2ddd0;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.q__opt:hover,
.q__opt:focus-visible {
  border-color: var(--accent);
  background: #fdf8ec;
}
.q__opt.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.quiz__back {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.quiz__back:hover { color: var(--accent); }

/* ===== שאלת סרגל-הגיל ===== */
.age {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  width: 100%;
  max-width: 480px;
  margin-top: 0.4rem;
}
.age__value {
  font-size: clamp(3rem, 8vw, 4.6rem);
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.age__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.age__range {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 2rem;
}
.age__step {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  font-family: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid #e2ddd0;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.age__step:hover { border-color: var(--accent); background: #fdf8ec; }
.age__continue { margin-top: 0.2rem; cursor: pointer; }

/* ===== מסך הסיום ===== */
.page__rule {
  width: 46px;
  height: 1px;
  background: var(--accent);
  opacity: 0.85;
}
.page__body {
  max-width: 46ch;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.9;
  color: #45423d;
}
.page__body p { margin-bottom: 1.1rem; }

.reg {
  width: 100%;
  max-width: 480px;
  margin: 0.6rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  text-align: start;
}
.reg__field { display: flex; flex-direction: column; gap: 0.4rem; }
.reg__field > span { font-size: 1rem; font-weight: 500; color: var(--ink); }
.reg input {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid #e2ddd0;
  border-radius: 4px;
  padding: 0.7rem 0.95rem;
}
.reg input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 141, 79, 0.14);
}
.reg__submit {
  align-self: center;
  margin-top: 0.3rem;
  padding: 0.85em 2.6em;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.reg__submit:hover { opacity: 0.9; }
.reg__msg { text-align: center; color: #6d5121; font-size: 1rem; line-height: 1.6; margin: 0.1rem 0 0; }
/* מלכודת-בוטים — מוסתרת מבני-אדם, גלויה לבוטים */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ===== מצב אדמין ===== */
[contenteditable="true"].is-editing {
  outline: 1px dashed var(--accent);
  outline-offset: 6px;
  border-radius: 2px;
  cursor: text;
}
#edit-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #23211d;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  z-index: 9999;
  font-family: system-ui, sans-serif;
}
#edit-bar .edit-bar__tag {
  color: #d8b877;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding-inline-end: 4px;
}
#edit-bar button {
  font-family: inherit;
  font-size: 0.85rem;
  color: #f4f1ea;
  background: #3a372f;
  border: 0;
  border-radius: 5px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}
#edit-bar button:hover { background: var(--accent); color: #fff; }
#edit-flash {
  position: fixed;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #23211d;
  color: #f4f1ea;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}
#edit-flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }
