/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a1d29;
  background: #f7f6f2;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --accent: #3b4cca;
  --accent-dark: #2d3aa3;
  --accent-soft: #eef0fb;
  --accent-ring: rgba(59, 76, 202, 0.18);
  --ink: #1a1d29;
  --ink-soft: #4a4f5e;
  --ink-mute: #767c8a;
  --line: #e6e3dc;
  --line-strong: #d1cdc4;
  --bg: #f7f6f2;
  --card: #ffffff;
  --danger: #c0392b;
  --radius: 14px;
  --radius-sm: 10px;
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 56px 20px 48px;
  overflow: hidden;
  background: #fdfcf8;
  border-bottom: 1px solid var(--line);
}
.hero-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  filter: saturate(0.9);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(253,252,248,0.4) 0%, rgba(253,252,248,0.92) 70%, #fdfcf8 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 5px 12px;
  background: var(--accent-soft);
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  color: var(--ink);
}
.lede {
  font-size: 1.02rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
  max-width: 600px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--ink-mute);
}
.hero-meta strong {
  color: var(--ink);
  font-weight: 600;
}
.meta-divider {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--line-strong);
}

/* ---------- Main shell ---------- */
.survey-shell {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: -24px auto 0;
  padding: 0 16px 48px;
  position: relative;
  z-index: 2;
}

.survey-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  box-shadow: 0 1px 2px rgba(20, 22, 35, 0.04), 0 8px 24px rgba(20, 22, 35, 0.05);
}

@media (min-width: 640px) {
  .survey-card { padding: 32px 36px 28px; }
  .hero { padding: 80px 20px 72px; }
  .survey-shell { margin-top: -36px; }
}

/* ---------- Progress ---------- */
.progress-wrap {
  margin-bottom: 28px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}
#progress-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.progress-title {
  font-size: 0.9rem;
  color: var(--ink-mute);
  font-weight: 500;
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--accent-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

/* ---------- Pages & questions ---------- */
.survey-page {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.survey-page-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--ink);
}

.question {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.question:first-of-type { border-top: 0; padding-top: 4px; }

.q-label {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.4;
}
.q-required {
  color: var(--accent);
  margin-left: 2px;
}
.q-desc {
  font-size: 0.88rem;
  color: var(--ink-mute);
  margin: 0 0 14px;
}

/* ---------- Inputs: radio & checkbox ---------- */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.97rem;
  color: var(--ink);
}
.option:hover {
  border-color: var(--line-strong);
  background: #fdfcf8;
}
.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.option .indicator {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  transition: all 0.15s ease;
  display: grid;
  place-items: center;
}
.option .indicator.radio { border-radius: 50%; }
.option .indicator.checkbox { border-radius: 5px; }
.option .indicator::after {
  content: "";
  opacity: 0;
  transition: opacity 0.15s ease;
}
.option .indicator.radio::after {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff;
}
.option .indicator.checkbox::after {
  width: 11px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.option input:checked ~ .indicator {
  background: var(--accent);
  border-color: var(--accent);
}
.option input:checked ~ .indicator::after { opacity: 1; }
.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.option input:focus-visible ~ .indicator {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---------- Matrix ---------- */
.matrix-wrap {
  margin-top: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.matrix {
  display: grid;
  gap: 8px;
  min-width: 100%;
}
.matrix-row {
  background: #fdfcf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.matrix-row-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}
.matrix-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.matrix-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.15s ease;
  min-height: 42px;
}
.matrix-cell:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.matrix-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.matrix-cell:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.matrix-cell input:focus-visible {
  outline: none;
}
.matrix-cell:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.matrix-scale-hint {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: 6px;
  padding: 0 2px;
}

/* ---------- Textarea & text ---------- */
.text-input, .textarea-input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  margin-top: 12px;
}
.textarea-input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}
.text-input:focus, .textarea-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---------- Email block ---------- */
.email-block {
  margin-top: 10px;
  padding: 20px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.email-block h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: var(--ink);
}
.email-block p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.email-block .text-input {
  margin-top: 8px;
  background: #fff;
}
.email-block .field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 12px;
}
.email-block .field-label:first-child { margin-top: 0; }

/* ---------- Navigation buttons ---------- */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.btn {
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.005em;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
  min-width: 130px;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 76, 202, 0.25);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: #fdfcf8;
  color: var(--ink);
  border-color: var(--line-strong);
}

/* ---------- Form error ---------- */
.form-error {
  margin-top: 18px;
  padding: 12px 14px;
  background: #fdecea;
  border: 1px solid #f5b7b1;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.92rem;
}

/* ---------- Thank you ---------- */
.thank-you {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(20, 22, 35, 0.04), 0 8px 24px rgba(20, 22, 35, 0.05);
  animation: fadeIn 0.4s ease;
}
.check-mark {
  display: inline-flex;
  color: var(--accent);
  margin-bottom: 18px;
}
.thank-you h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.8rem;
  margin: 0 0 10px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.thank-you p {
  color: var(--ink-soft);
  margin: 0 auto;
  max-width: 420px;
}

/* ---------- Status cards ---------- */
.status-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(20, 22, 35, 0.04), 0 8px 24px rgba(20, 22, 35, 0.05);
}
.status-card h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--ink);
}
.status-card p {
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Footer ---------- */
.footer {
  padding: 32px 20px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-mute);
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.footer p { margin: 0 0 8px; }
#wbx-powered-by-slot { display: flex; justify-content: center; }
