/* ============================================================================
   Petz Social — Beta discovery survey (/survey)
   Builds on tokens.css + site.css (header/footer/buttons/chips reused 1:1).
   Only the wizard-specific UI lives here so site.css stays untouched.
   ============================================================================ */

/* `hidden` must always win, even over components that set their own `display`
   (e.g. .btn → inline-flex, .survey-controls → flex). */
[hidden] { display: none !important; }

.survey { background: linear-gradient(180deg, var(--brand-cream) 0%, var(--bg) 22%); min-height: 80vh; }
.survey-wrap { max-width: 680px; padding-top: 40px; padding-bottom: 80px; }

/* ---------- Intro header ---------- */
.survey-head { text-align: center; margin-bottom: 26px; }
.survey-head .chip { margin-bottom: 16px; }
.survey-head h1 {
  font-size: 38px; font-weight: var(--w-extrabold); letter-spacing: -0.025em;
  color: var(--brand-brown); margin: 0 0 12px; line-height: 1.08;
}
.survey-lead { font-size: 16.5px; color: var(--fg2); margin: 0 auto; max-width: 52ch; line-height: 1.6; }
.survey-lead em { font-style: italic; color: var(--fg1); }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--accent-tint); border-radius: var(--r-pill); overflow: hidden; }
.progress-bar { height: 100%; width: 16.6%; background: var(--primary); border-radius: var(--r-pill); transition: width .35s cubic-bezier(.4,0,.2,1); }
.progress-meta { font-size: 13px; font-weight: var(--w-semibold); color: var(--fg3); margin: 10px 0 26px; text-align: center; }
.progress-meta span { color: var(--primary); }

/* ---------- Step card ---------- */
.wz-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card-lg);
  box-shadow: var(--shadow-card); padding: 28px 26px;
  animation: stepIn .35s ease both;
}
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wz-step { animation: none; } }
.wz-title { font-size: 22px; font-weight: var(--w-extrabold); letter-spacing: -0.01em; color: var(--fg1); margin: 0 0 4px; }
.wz-sub { font-size: 14.5px; color: var(--fg2); margin: 0 0 22px; }

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label, .q h3 { display: block; font-size: 14.5px; font-weight: var(--w-bold); color: var(--fg1); margin-bottom: 8px; }
.field .req { color: var(--error); font-weight: var(--w-bold); }
.field .opt, .q .opt { color: var(--fg3); font-weight: var(--w-medium); font-size: 12.5px; }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--fg1);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-input);
  padding: 12px 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--fg3); }
input:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,115,200,.16);
}
input.invalid, textarea.invalid { border-color: var(--error); box-shadow: 0 0 0 3px rgba(214,43,43,.12); }
.hint { font-size: 12.5px; color: var(--fg3); margin: 6px 0 0; line-height: 1.45; }

/* ---------- Question block ---------- */
.q { padding: 18px 0; border-top: 1px solid var(--border); }
.q:first-of-type { border-top: none; padding-top: 0; }
.q .hint { margin: -2px 0 12px; }
.q .reveal-on-yes { margin-top: 12px; }

/* ---------- Pill single-select ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pills button {
  font-family: var(--font-sans); font-size: 14px; font-weight: var(--w-semibold);
  color: var(--fg1); background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-pill); padding: 10px 18px; cursor: pointer;
  transition: all .12s ease;
}
.pills button:hover { border-color: var(--primary); transform: translateY(-1px); }
.pills button[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: var(--shadow-btn);
}

/* ---------- Chip multi-select ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }
.chips button {
  font-family: var(--font-sans); font-size: 13.5px; font-weight: var(--w-semibold);
  color: var(--fg2); background: var(--subtle); border: 1.5px solid var(--border);
  border-radius: var(--r-pill); padding: 8px 15px; cursor: pointer; transition: all .12s ease;
}
.chips button:hover { border-color: var(--accent); color: var(--accent); }
.chips button[aria-pressed="true"] {
  background: var(--accent-50); border-color: var(--accent); color: var(--accent);
}
.chips button[aria-pressed="true"]::before { content: "✓ "; font-weight: var(--w-bold); }

/* ---------- Controls ---------- */
.survey-controls { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.survey-controls .spacer { flex: 1; }
.btn-link {
  background: none; border: none; color: var(--primary); font-weight: var(--w-bold);
  font-size: 14.5px; cursor: pointer; padding: 10px 6px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { color: var(--fg3); cursor: default; text-decoration: none; }

/* ---------- Review ---------- */
.review { display: flex; flex-direction: column; gap: 2px; }
.review .r-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.review .r-row:last-child { border-bottom: none; }
.review .r-q { flex: 0 0 42%; color: var(--fg3); font-weight: var(--w-semibold); }
.review .r-a { flex: 1; color: var(--fg1); font-weight: var(--w-medium); white-space: pre-wrap; }
.review .r-a.empty { color: var(--fg3); font-style: italic; font-weight: var(--w-regular); }

.turnstile-wrap { margin: 22px 0 8px; }
.turnstile-wrap .hint { margin-bottom: 10px; }
.cf-turnstile { min-height: 65px; }
.consent { font-size: 12.5px; color: var(--fg3); line-height: 1.5; margin: 14px 0 0; }

/* ---------- Honeypot (off-screen, never shown to humans) ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Success ---------- */
.success { text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card-lg); box-shadow: var(--shadow-card); padding: 56px 30px; }
.success-emoji { font-size: 52px; line-height: 1; margin-bottom: 16px; }
.success h2 { font-size: 28px; font-weight: var(--w-extrabold); color: var(--brand-brown); margin: 0 0 12px; }
.success p { font-size: 16px; color: var(--fg2); max-width: 44ch; margin: 0 auto 26px; line-height: 1.6; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--fg1); color: #fff; font-size: 14px; font-weight: var(--w-semibold);
  padding: 13px 20px; border-radius: var(--r-button); box-shadow: var(--shadow-float);
  max-width: min(92vw, 460px); opacity: 0; transition: opacity .25s ease, transform .25s ease;
  z-index: 100; display: flex; align-items: center; gap: 12px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--error); }
.toast a { color: #fff; text-decoration: underline; font-weight: var(--w-bold); white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .survey-head h1 { font-size: 30px; }
  .wz-step { padding: 22px 18px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .review .r-q { flex-basis: 46%; }
}
