:root {
  --blue: #0858a8;
  --blue-dark: #06457f;
  --sky: #10a8e0;
  --green: #108840;
  --green-dark: #0c6c33;
  --lime: #80c048;
  --ink: #142033;
  --muted: #3d4a5c;
  --line: #d7e3ee;
  --cream: #f5f8fb;
  --white: #ffffff;
  --danger: #8a1f1f;
  --danger-bg: #fdf2f2;
  --danger-border: #e8b4b4;
  --focus: #10a8e0;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(8, 88, 168, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Source Sans 3", "Source Sans Pro", Calibri, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  font-size: 18px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 8px 16px;
  z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

header {
  background: var(--white);
  border-bottom: 4px solid var(--lime);
  padding: 12px 20px 10px;
  text-align: center;
}
.logo {
  width: min(220px, 70vw);
  height: auto;
  display: inline-block;
}
.home-link { display: inline-block; }

.warning {
  margin: 0;
  background: var(--danger-bg);
  border-bottom: 2px solid var(--danger-border);
  color: var(--danger);
  font-weight: 700;
  font-size: 1.02rem;
  padding: 12px 18px;
  text-align: center;
  line-height: 1.35;
}
.warning a { color: var(--danger); font-weight: 800; }

.privacy {
  margin: 0;
  padding: 10px 18px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
  background: #eef6ee;
  border-bottom: 1px solid #d5e8d5;
}

main {
  flex: 1;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--lime));
  border-radius: 99px;
  transition: width 0.2s ease;
}

.step h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  color: var(--blue-dark);
  line-height: 1.25;
}
.step h1.question-long {
  font-size: 1.22rem;
  margin-bottom: 16px;
}
.hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.98rem;
}
.hint.tight { margin-top: 4px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

label.field {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
}
label.field .sub {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 2px 0 8px;
}
input[type="text"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  appearance: none;
}
input:hover, textarea:hover { border-color: #b9cde0; }
textarea { min-height: 5.5rem; resize: vertical; }

.chips, .choices, .pain-scale, .since-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.chip, .choice, .pain-btn, .since-chip {
  appearance: none;
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  line-height: 1.2;
}
.choice {
  border-radius: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 16px;
}
.pain-btn {
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 12px;
  font-size: 1.05rem;
}
.chip[aria-pressed="true"],
.choice[aria-pressed="true"],
.pain-btn[aria-pressed="true"],
.since-chip[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.pain-btn.none-btn { width: auto; padding: 0 12px; font-size: 0.92rem; }

.preview {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.98rem;
  color: var(--ink);
  margin: 0 0 16px;
}

.err {
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 10px;
  min-height: 1.2em;
}

.actions {
  display: flex;
  gap: 10px;
  margin: 8px 0 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 16px 16px;
  border-radius: 14px;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-back {
  background: var(--white);
  color: var(--blue-dark);
  border: 2px solid var(--line);
  flex: 0 0 auto;
  min-width: 6.2rem;
}
.btn-next, .btn-send {
  background: var(--green);
  color: #fff;
}
.btn-next:hover, .btn-send:hover { background: var(--green-dark); }
.btn-send { background: #108840; font-size: 1.08rem; }

.skip-text {
  display: block;
  text-align: center;
  font-weight: 700;
  margin: 4px 0 20px;
}
.home-foot {
  display: block;
  text-align: center;
  font-size: 0.92rem;
  margin: 0 0 28px;
  color: var(--muted);
}

noscript {
  display: block;
  margin: 16px;
  padding: 14px 16px;
  background: #fff8e8;
  border: 1px solid #efd89a;
  border-radius: var(--radius);
  color: #4a3b16;
}

#desktop-fallback {
  margin: 0 0 8px;
  text-align: center;
}
.sms-number {
  margin: 8px 0 14px;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--blue-dark);
  line-height: 1.2;
}
.btn-copy {
  background: var(--green);
  color: #fff;
  width: 100%;
  margin: 0 0 8px;
}
.btn-copy:hover { background: var(--green-dark); }
.copy-status {
  min-height: 1.3em;
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--green-dark);
}
#sms-qr {
  display: block;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 8px;
  image-rendering: pixelated;
  max-width: min(220px, 70vw);
  height: auto;
}
textarea.preview {
  display: block;
  width: 100%;
  min-height: 8.5rem;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.45;
  white-space: pre-wrap;
  resize: none;
}
@media (min-width: 800px) {
  main { padding-bottom: 40px; }
  .sms-number { font-size: 2.4rem; }
}
