/* ── CSAT / NPS Pulse Survey — friendly clinical vitals ─────────────
   Off-white with dotted pulse-grid, animated coral ECG line, 0-10
   spectrum buttons warming slate→amber→coral, heart-fill ratings,
   slim pulse progress bar, airy rounded sans. */

:root {
  --bg: #faf8f5;
  --dot: rgba(60, 64, 78, 0.07);
  --card: #ffffff;
  --coral: #f2604d;
  --coral-soft: #fde5e1;
  --amber: #f2a33c;
  --slate: #3c404e;
  --slate-soft: #8b8f9c;
  --line: #e8e4dd;
  --ok: #2f9e6e;
  --err: #d24632;
  --head: 'Quicksand', sans-serif;
  --body: 'Nunito Sans', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--body);
  color: var(--slate);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(var(--dot) 1.5px, transparent 1.5px),
    var(--bg);
  background-size: 22px 22px;
  min-height: 100vh;
}

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

.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 24px; flex: 1 0 auto; }

/* ── Header ───────────────────────────────────────────────────────── */
.head { text-align: center; padding: 64px 24px 6px; }

.head h1 {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(2rem, 7.5vw, 3rem);
  line-height: 1.14;
  color: var(--slate);
}

.head .sub { margin: 14px auto 0; max-width: 420px; color: var(--slate-soft); font-size: 1.02rem; }

.ecg {
  display: block;
  width: 100%;
  max-width: 520px;
  height: 54px;
  margin: 22px auto 0;
  color: var(--coral);
}

.ecg-path {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: trace 4s linear infinite;
}

@keyframes trace {
  0% { stroke-dashoffset: 1400; }
  70%, 100% { stroke-dashoffset: 0; }
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 30px 28px;
  margin-top: 28px;
  box-shadow: 0 18px 40px rgba(60, 64, 78, 0.08);
}

.pulse-progress {
  height: 6px;
  background: var(--coral-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.pulse-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--coral), var(--amber));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-text {
  font-family: var(--head);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate-soft);
  margin-bottom: 22px;
}

.progress-text:empty { display: none; }

/* ── Questions ────────────────────────────────────────────────────── */
.q-block { margin-bottom: 28px; }

.q-text {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.35;
  margin-bottom: 6px;
}

.q-desc { color: var(--slate-soft); font-size: 0.9rem; margin-bottom: 12px; }

/* NPS spectrum */
.nps-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.nps-btn {
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.95rem;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.14s ease;
}

.nps-btn:hover { transform: translateY(-2px); border-color: var(--slate-soft); }

.nps-btn.is-selected { color: #fff; transform: translateY(-2px) scale(1.06); }

.nps-btn.tone-low.is-selected { background: var(--slate); border-color: var(--slate); }
.nps-btn.tone-mid.is-selected { background: var(--amber); border-color: var(--amber); }
.nps-btn.tone-high.is-selected { background: var(--coral); border-color: var(--coral); }

.nps-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--slate-soft);
  margin-top: 8px;
}

/* Heart rating */
.rating-row { display: flex; gap: 10px; margin-top: 12px; }

.heart-btn {
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--line);
  transition: transform 0.14s ease, color 0.14s ease;
  line-height: 1;
  padding: 4px;
}

.heart-btn:hover { transform: scale(1.15); }
.heart-btn.is-filled { color: var(--coral); }

.rating-caption {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--coral);
  margin-top: 8px;
  min-height: 1.3em;
}

/* Text inputs */
textarea, input[type="text"], input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--slate);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s ease;
  margin-top: 10px;
}

textarea { resize: vertical; min-height: 100px; }

textarea:focus, input:focus { outline: none; border-color: var(--coral); }
input.error, textarea.error { border-color: var(--err); }
textarea::placeholder, input::placeholder { color: #b8bcc5; }

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav-row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 4px; }

.btn {
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
  background: var(--coral);
  border: none;
  border-radius: 999px;
  padding: 14px 36px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(242, 96, 77, 0.32);
}

.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(242, 96, 77, 0.42); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

.btn-ghost {
  background: transparent;
  color: var(--slate-soft);
  box-shadow: none;
  border: 2px solid var(--line);
}

.btn-ghost:hover:not(:disabled) { box-shadow: none; color: var(--slate); border-color: var(--slate-soft); }

.form-error { color: var(--err); font-weight: 700; text-align: center; margin-top: 14px; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Email step */
.email-step label {
  display: block;
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.email-note { color: var(--slate-soft); font-size: 0.9rem; }

/* ── Thanks ───────────────────────────────────────────────────────── */
.thanks { text-align: center; padding: 44px 30px; }

.thanks-heart {
  display: inline-block;
  font-size: 2.6rem;
  color: var(--coral);
  animation: beat 1.4s ease-in-out infinite;
  margin-bottom: 12px;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.2); }
  24% { transform: scale(1); }
  36% { transform: scale(1.15); }
  48% { transform: scale(1); }
}

.thanks h2 { font-family: var(--head); font-weight: 700; font-size: 1.8rem; }

.thanks p { color: var(--slate-soft); margin-top: 10px; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ── Footer ───────────────────────────────────────────────────────── */
.foot {
  text-align: center;
  padding: 34px 20px 28px;
  color: var(--slate-soft);
  font-size: 0.8rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .nps-row { gap: 4px; }
  .nps-btn { font-size: 0.8rem; border-radius: 8px; }
  .card { padding: 24px 20px; }
}
