:root {
  --primary: #2e2340;
  --primary-dark: #1d1629;
  --accent: #f28d2c;
}

.wellbeing-intro,
.wellbeing-review,
.wellbeing-summary,
.email-panel {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.wellbeing-intro h2,
.wellbeing-review h2,
.wellbeing-summary h2,
.email-panel h2 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
}

.wellbeing-intro p,
.wellbeing-review p,
.wellbeing-summary p,
.email-panel p {
  margin: 0;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 10px 16px;
}

.answer-scale {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scale-item {
  --tone: #7a8494;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: stretch;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 7px solid var(--tone);
  border-radius: 8px;
}

.scale-item > span {
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fff;
  background: var(--tone);
  font-weight: 800;
}

.scale-item strong {
  padding: 8px 12px;
}

.tone-1,
.answer-option.tone-1 { --tone: #d92d20; --tone-bg: #fff1f0; }
.tone-2,
.answer-option.tone-2 { --tone: #f59c76; --tone-bg: #fff4ee; }
.tone-3,
.answer-option.tone-3 { --tone: #7a8494; --tone-bg: #f1f3f5; }
.tone-4,
.answer-option.tone-4 { --tone: #8bcf3f; --tone-bg: #f0fbe7; }
.tone-5,
.answer-option.tone-5 { --tone: #2f9e44; --tone-bg: #eaf8ed; }

.scale-item.tone-2 > span,
.scale-item.tone-4 > span {
  color: #18202b;
}

.privacy-note {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  background: #fff8f1;
  border-left: 6px solid var(--accent);
  border-radius: 6px;
}

.privacy-note span,
.saved-progress,
.review-note {
  color: var(--muted);
}

.intro-actions,
.email-actions,
.summary-buttons {
  display: grid;
  gap: 10px;
}

.wellbeing-review .summary-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.summary-filter {
  padding-top: 2px;
}

.wellbeing-answer-list {
  display: grid;
  gap: 10px;
}

.wellbeing-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wellbeing-review-row.missing {
  background: #fff8f1;
  border-color: #f3c99f;
}

.wellbeing-review-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.summary-question-meta {
  color: var(--muted);
  font-size: .86rem;
}

.all-complete {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  background: #f8fafc;
  border-radius: 8px;
}

.email-panel {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
}

.email-form {
  display: grid;
  gap: 10px;
}

.email-form label {
  font-weight: 700;
}

.email-form input {
  width: 100%;
  min-height: 50px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.email-form input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(46, 35, 64, .18);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  color: #8f1d18;
  background: #fff1f0;
  border: 1px solid #f3aaa5;
  border-radius: 6px;
}

.sending-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 33, .72);
}

.sending-overlay[hidden] {
  display: none;
}

.sending-dialog {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 390px);
  padding: 28px;
  text-align: center;
  background: #fff;
  border-top: 7px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .25);
}

.sending-dialog span:last-child {
  color: var(--muted);
}

.sending-spinner {
  width: 42px;
  height: 42px;
  border: 5px solid #e4e7ec;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: wellbeing-spin .85s linear infinite;
}

.is-sending {
  overflow: hidden;
}

.delivery-success {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: #165c36;
  background: #edf9f1;
  border: 1px solid #b7e0c5;
  border-radius: 8px;
}

.delivery-success > span {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: #2f9e44;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 800;
}

.delivery-success p {
  color: #3d6f51;
}

@keyframes wellbeing-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 720px) {
  .wellbeing-intro,
  .wellbeing-review,
  .wellbeing-summary,
  .email-panel {
    padding: 30px;
  }

  .intro-actions,
  .email-actions {
    grid-template-columns: 1fr 1fr;
  }

  .summary-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .wellbeing-intro,
  .wellbeing-review,
  .wellbeing-summary,
  .email-panel {
    gap: 16px;
    padding: 17px;
  }

  .wellbeing-intro h2,
  .wellbeing-review h2,
  .wellbeing-summary h2,
  .email-panel h2 {
    font-size: 1.4rem;
  }

  .wellbeing-review-row {
    grid-template-columns: 1fr;
  }

  .wellbeing-review-row button {
    width: 100%;
  }

}

@media (prefers-reduced-motion: reduce) {
  .sending-spinner { animation-duration: 1.8s; }
}
