@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --terracotta: #be5103;
  --terracotta-dark: #984102;
  --terracotta-light: #d0824a;
  --teal: #20402e;
  --teal-light: #306045;
  --cream: #fef2d6;
  --cream-soft: #fffaef;
  --white: #ffffff;
  --ink: #1c2b2a;
  --muted: #6b7d7b;
  --danger: #c14a3a;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 12px 40px rgba(16, 68, 66, 0.12);
  --shadow-card: 0 4px 16px rgba(16, 68, 66, 0.08);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-soft) 40%, var(--white) 100%);
  color: var(--ink);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, .serif {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

button { font-family: inherit; }

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  background: var(--terracotta);
  border-radius: var(--radius-md);
  padding: 16px 26px;
}
.brand-mark img {
  height: 40px;
  width: auto;
  display: block;
}

/* ---------------- App shell ---------------- */

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 24px;
}

.progress-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(254, 242, 214, 0.9);
  backdrop-filter: blur(6px);
  padding: 14px 20px 10px;
  display: none;
}
.progress-shell.visible { display: block; }
.progress-track {
  height: 8px;
  background: rgba(16, 68, 66, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--terracotta), var(--terracotta-light));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.progress-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.step {
  display: none;
  padding: 28px 22px 40px;
  min-height: calc(100vh - 40px);
  flex-direction: column;
  animation: stepIn 0.45s cubic-bezier(.4,0,.2,1);
}
.step.active { display: flex; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Breathing animation ---------------- */

.breathe-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 28px 0;
}
.breathe-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--terracotta-light), var(--terracotta));
  box-shadow: 0 0 0 14px rgba(200, 104, 54, 0.12), 0 0 0 28px rgba(200, 104, 54, 0.06);
  animation: breathe 4.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.82); }
  50% { transform: scale(1); }
}

/* ---------------- Welcome ---------------- */

.welcome-step { text-align: center; justify-content: space-between; }
.welcome-top { padding-top: 8px; }
.welcome-title {
  font-size: 2.1rem;
  margin: 18px 0 6px;
  color: var(--teal);
}
.welcome-sub {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}
.pill-badge {
  display: inline-block;
  background: var(--teal);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.welcome-features {
  display: grid;
  gap: 10px;
  text-align: left;
  margin: 26px 0;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.welcome-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--ink);
}
.welcome-feature svg { flex-shrink: 0; color: var(--terracotta); width: 20px; height: 20px; }
.free-note {
  font-size: 0.76rem;
  color: var(--teal);
  font-weight: 500;
  margin-top: 4px;
}
.note-light {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 16px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(200, 104, 54, 0.35);
}
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 2px solid rgba(16, 68, 66, 0.15);
}
.btn-row { display: flex; gap: 10px; margin-top: auto; padding-top: 24px; }
.btn-row .btn-ghost { flex: 0 0 76px; }
.btn-row .btn-primary { flex: 1; }

.nav-back {
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 6px;
  align-self: flex-start;
}

/* ---------------- Form fields ---------------- */

.field { margin-bottom: 18px; }
.field-hint { font-size: 0.76rem; color: var(--muted); margin: 6px 0 0; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--teal);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(16, 68, 66, 0.14);
  font-size: 1rem;
  background: var(--white);
  font-family: inherit;
  color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--terracotta); }
.toggle-row { display: flex; gap: 10px; }
.toggle-opt {
  flex: 1;
  text-align: center;
  padding: 13px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(16, 68, 66, 0.14);
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  transition: all 0.15s ease;
}
.toggle-opt.selected {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--cream);
}
.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  margin-top: 8px;
}
.consent-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--terracotta); flex-shrink: 0; }
.consent-row span { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.policy-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--terracotta-dark);
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  display: inline;
}
.policy-details {
  display: none;
  background: var(--white);
  border: 1px solid rgba(32, 64, 46, 0.12);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-top: 10px;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
}
.policy-details.open { display: block; }
.policy-details p { font-size: 0.85rem; color: var(--ink); line-height: 1.6; margin: 0 0 14px; }
.policy-details p:last-child { margin-bottom: 0; }
.policy-details strong { color: var(--teal); }

/* ---------------- Question steps (MDAS + Fear Mapping) ---------------- */

.q-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
}
.q-icon svg { width: 30px; height: 30px; color: var(--terracotta); }
.q-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 6px;
}
.q-text {
  font-size: 1.35rem;
  color: var(--teal);
  margin: 0 0 26px;
  line-height: 1.35;
}
.opt-list { display: grid; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(16, 68, 66, 0.12);
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s ease;
}
.opt:active { transform: scale(0.98); }
.opt.selected {
  border-color: var(--terracotta);
  background: rgba(200, 104, 54, 0.08);
}
.opt-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(16, 68, 66, 0.25);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.opt.selected .opt-dot { border-color: var(--terracotta); background: var(--terracotta); }
.opt.selected .opt-dot::after {
  content: "";
  width: 10px; height: 10px; border-radius: 50%; background: var(--white);
}
.opt-label { font-weight: 600; font-size: 0.98rem; }
.opt-num {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

/* ---------------- Loading ---------------- */

.loading-step { align-items: center; justify-content: center; text-align: center; }
.loading-text {
  font-size: 1.05rem;
  color: var(--teal);
  font-weight: 700;
  margin-top: 10px;
  min-height: 1.4em;
}

/* ---------------- Results ---------------- */

.zfp-badge {
  text-align: center;
  background: var(--teal);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 30px 22px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
}
.zfp-badge .zfp-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 700;
}
.zfp-badge .zfp-mode {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.9rem;
  margin: 8px 0 4px;
}
.zfp-badge .zfp-desc { font-size: 0.9rem; opacity: 0.85; }

.section-title {
  font-size: 1.05rem;
  color: var(--teal);
  margin: 6px 0 14px;
}
.rec-card {
  display: flex;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  border-left: 4px solid var(--terracotta-light);
}
.rec-card.priority { border-left-color: var(--terracotta); background: rgba(200, 104, 54, 0.06); }
.rec-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rec-icon svg { width: 22px; height: 22px; color: var(--terracotta-dark); }
.rec-body .rec-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.rec-body .rec-reason { font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.rec-flag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
  margin-top: 4px;
  display: inline-block;
}
.priority-note {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--teal);
  margin-bottom: 20px;
  line-height: 1.4;
}
.empty-rec { color: var(--muted); font-size: 0.9rem; font-style: italic; margin-bottom: 16px; }

/* ---------------- Extras / menu grid ---------------- */

.menu-grid { display: grid; gap: 10px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  border: 2px solid transparent;
}
.menu-item.checked { border-color: var(--terracotta); }
.menu-item.locked { opacity: 0.75; cursor: default; }
.menu-item .chk {
  width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid rgba(16,68,66,0.25);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.menu-item.checked .chk { background: var(--terracotta); border-color: var(--terracotta); }
.menu-item.locked .chk { background: var(--teal); border-color: var(--teal); }
.menu-item .chk svg { width: 13px; height: 13px; color: var(--white); }
.menu-item .mi-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--cream); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.menu-item .mi-icon svg { width: 17px; height: 17px; color: var(--terracotta-dark); }
.menu-item .mi-text .mi-title { font-weight: 700; font-size: 0.88rem; }
.menu-item .mi-text .mi-desc { font-size: 0.75rem; color: var(--muted); }
.menu-item .mi-locked-tag { margin-left: auto; font-size: 0.65rem; font-weight: 800; color: var(--teal); text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }

/* ---------------- Thanks ---------------- */

.thanks-step { align-items: center; justify-content: center; text-align: center; }
.check-pop {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--terracotta);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  animation: popIn 0.5s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 14px 30px rgba(200,104,54,0.35);
}
.check-pop svg { width: 46px; height: 46px; color: var(--white); }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.thanks-title { color: var(--teal); font-size: 1.7rem; margin-bottom: 8px; }
.thanks-sub { color: var(--muted); max-width: 380px; line-height: 1.5; }
.thanks-goodie {
  margin-top: 26px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  font-size: 0.85rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.thanks-goodie svg { width: 26px; height: 26px; color: var(--terracotta); flex-shrink: 0; }

.booking-cta {
  width: 100%;
  margin-top: 22px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.error-banner {
  background: rgba(193, 74, 58, 0.1);
  border: 1px solid rgba(193, 74, 58, 0.35);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}
.error-banner.visible { display: block; }

.spinner-btn { display: inline-flex; align-items: center; gap: 8px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
  .step { padding: 40px 40px 48px; }
  .welcome-title { font-size: 2.4rem; }
}
