/* ================================================================
   Gal Cohen — שאלון אפיון
   ================================================================

   A standalone page: one question at a time, a progress bar, and the
   site's own palette. Loaded after style.css and leans on its :root
   variables and font. The option markup mirrors what Contact Form 7
   emits (wpcf7-list-item and friends), so the same rules dress the
   static preview and the live plugin form.
   ================================================================ */

body.quiz-page {
  background: #2f2c29;
  min-height: 100vh;
}

/* The photograph sits on its own fixed layer — a position:fixed element scrolls
   correctly on iOS where background-attachment does not — with a slight blur
   that both settles it behind the card and masks the 1100px source stretched
   across a wide screen. */
body.quiz-page::before {
  content: "";
  position: fixed;
  inset: -24px;
  z-index: -2;
  /* The image arrives from the page (a <style> in its head): a url() inside a
     custom property resolves against the stylesheet that uses it, which is the
     css/ directory — the same trap that once broke the hero background. */
  background: #2f2c29 center / cover no-repeat;
  transform: scale(1.04);
  filter: blur(2px);
}

body.quiz-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(22, 20, 18, 0.38), rgba(22, 20, 18, 0.62));
}

.quiz-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.quiz-logo-link { display: block; width: fit-content; margin: 0 auto 26px; }
.quiz-logo { height: 58px; width: auto; display: block; }

.quiz-card {
  background: var(--white);
  border-radius: 18px;
  /* Deeper than the site's usual shadow, so the card stands off the photo. */
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  padding: 42px 46px 38px;
}

/* ---------- Step zero: the greeting ---------- */
.quiz-intro { text-align: center; padding: 14px 6px 6px; }

.quiz-intro-photo {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-med);
}

.quiz-intro-text {
  max-width: 480px;
  margin: 0 auto;
  font-size: 16.5px;
  line-height: 1.85;
}

.quiz-intro-text p + p { margin-top: 10px; color: var(--ink-soft); }

.quiz-start {
  margin-top: 26px;
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 15px 44px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
}

.quiz-start:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-med);
}

/* ---------- Progress ---------- */
.quiz-head { margin-bottom: 30px; }

.quiz-count {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.quiz-bar {
  height: 4px;
  background: #e9e6e1;
  border-radius: 999px;
  overflow: hidden;
}

/* Width-based, so it fills from the inline start in either direction. */
.quiz-bar span {
  display: block;
  height: 100%;
  width: 20%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ---------- Steps ---------- */
.quiz-step { display: none; border: none; }

.quiz-step.active { display: block; animation: quiz-in 0.3s ease; }

@keyframes quiz-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.quiz-step legend {
  font-size: 25px;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 6px;
  outline: none;
}

.quiz-note {
  color: var(--ink-soft);
  font-weight: 300;
  font-size: 14.5px;
  margin-bottom: 4px;
}

.quiz-step legend + .quiz-options,
.quiz-note + .quiz-options { margin-top: 18px; }

/* ---------- Options ---------- */
.quiz-options .wpcf7-form-control { display: block; }

.quiz-options .wpcf7-list-item {
  display: block;
  margin: 0 0 12px;
}

.quiz-options label {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 15px 18px;
  cursor: pointer;
  font-size: 16px;
  background: var(--white);
  transition: border-color var(--transition), background-color var(--transition),
              box-shadow var(--transition);
}

.quiz-options label:hover { border-color: #b9b3aa; }

.quiz-options label:has(input:checked) {
  border-color: var(--ink);
  background: #faf9f7;
  box-shadow: var(--shadow-soft);
}

/* The control itself, drawn by hand so both states read at a glance. */
.quiz-options input[type="radio"],
.quiz-options input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  border: 1.5px solid #c9c4bc;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition);
}

.quiz-options input[type="checkbox"] { border-radius: 7px; }

.quiz-options input::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: inherit;
  background: var(--ink);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.quiz-options input:checked { border-color: var(--ink); }
.quiz-options input:checked::before { transform: scale(1); }

.quiz-options input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- The open question and contact fields ---------- */
.quiz-field { margin: 14px 0; }
.quiz-field .wpcf7-form-control-wrap { display: block; }

.quiz-field input[type="text"],
.quiz-field input[type="tel"],
.quiz-field input[type="email"],
.quiz-field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
}

.quiz-field textarea {
  height: 130px;
  min-height: 130px;
  resize: vertical;
  line-height: 1.7;
}

.quiz-field input:focus,
.quiz-field textarea:focus { border-color: var(--ink); }

.quiz-field ::placeholder { color: #9b968e; }

.quiz-contact { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.quiz-contact-title { font-size: 16.5px; font-weight: 500; margin-bottom: 4px; }

/* ---------- Navigation ---------- */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

/* The back button leads, so with only "next" present it still sits at the end. */
.quiz-nav .quiz-next,
.quiz-nav .quiz-submit-wrap { margin-inline-start: auto; }

.quiz-next,
.quiz-submit-wrap .wpcf7-submit {
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 13px 38px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
}

.quiz-next:hover,
.quiz-submit-wrap .wpcf7-submit:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-med);
}

.quiz-prev {
  background: none;
  border: none;
  padding: 8px 4px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color var(--transition);
}

.quiz-prev:hover { color: var(--ink); }

.quiz-hint {
  color: #b3261e;
  font-size: 13.5px;
  margin-top: 14px;
}

/* ---------- Contact Form 7 chrome on this page ---------- */
.quiz-card .wpcf7-not-valid-tip { color: #b3261e; font-size: 13px; margin-top: 6px; }

.quiz-card .wpcf7-response-output {
  margin: 18px 0 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
}

.quiz-card .wpcf7-response-output:empty { display: none; }
.quiz-card .wpcf7-spinner { display: block; margin: 10px auto 0; }

/* CF7 formats its form content with autop unless told otherwise; any stray
   breaks it slips between the blocks would open visible gaps. */
.quiz br { display: none; }

/* ---------- Thank-you ---------- */
.quiz-done { text-align: center; padding: 46px 10px 30px; }

.quiz-done-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  display: grid;
  place-items: center;
}

.quiz-done-mark svg { width: 30px; height: 30px; }

.quiz-done h1 { font-size: 26px; font-weight: 400; margin-bottom: 10px; }
.quiz-done p { color: var(--ink-soft); font-weight: 300; margin-bottom: 26px; }

.quiz-done .quiz-done-back {
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 11px 30px;
  color: var(--ink);
  font-size: 15px;
  transition: background-color var(--transition), color var(--transition);
}

.quiz-done .quiz-done-back:hover { background: var(--ink); color: var(--white); }

.quiz-back { text-align: center; margin-top: 28px; }

.quiz-back a {
  display: inline-block;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 12px 36px;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  background: rgba(22, 20, 18, 0.25);
  transition: background-color var(--transition), color var(--transition),
              border-color var(--transition);
}

.quiz-back a:hover { background: var(--white); border-color: var(--white); color: var(--ink); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .quiz-shell { padding: 24px 14px 48px; }
  .quiz-logo { height: 48px; }
  .quiz-card { padding: 28px 20px 26px; border-radius: 16px; }
  .quiz-step legend { font-size: 21px; }
  .quiz-options label { padding: 14px 15px; font-size: 15px; }
  .quiz-next, .quiz-submit-wrap .wpcf7-submit { padding: 13px 30px; }
}
