:root {
  --bg: #fbf6f7;
  --surface: #ffffff;
  --text: #2b2226;
  --muted: #7a6c72;
  --line: #ecdfe4;
  --accent: #c2416b;
  --accent-ink: #ffffff;
  --star: #f0b429;
  --star-off: #ddd3d7;
  --danger: #b3261e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171214;
    --surface: #221b1e;
    --text: #f3ecef;
    --muted: #b2a4aa;
    --line: #3a2f34;
    --accent: #e86b93;
    --accent-ink: #1c1215;
    --star-off: #4a3d43;
    --danger: #ff8a80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 24px 16px 48px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.card {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 20px 28px;
  box-shadow: 0 6px 30px rgb(43 34 38 / 8%);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 18px; }
.brand__mark { color: var(--accent); font-size: 24px; line-height: 1; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.muted { color: var(--muted); }
#subtitle { margin: 0 0 20px; }

.q { border: 0; margin: 0 0 18px; padding: 0; }
.q legend, .label { font-weight: 600; margin-bottom: 6px; display: block; padding: 0; }
.req { color: var(--accent); }

/* Зірки: інпути в зворотному порядку, щоб ~ підсвічував лівіші */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { font-size: 40px; line-height: 1; color: var(--star-off); cursor: pointer; padding: 0 2px; transition: transform .1s, color .1s; user-select: none; }
.stars label:hover, .stars label:hover ~ label,
.stars input:checked ~ label { color: var(--star); }
.stars label:active { transform: scale(.9); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.stars__hint { display: block; min-height: 1.5em; font-size: 14px; color: var(--muted); }

/* Шкала 0–10 і варіанти відповіді: радіокнопки, стилізовані як кнопки */
.scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.choices { display: flex; flex-direction: column; gap: 6px; }
.scale input, .choices input { position: absolute; opacity: 0; pointer-events: none; }
.scale label, .choices label {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  transition: background .1s, border-color .1s;
}
.scale label { padding: 9px 0; text-align: center; font-weight: 600; font-size: 15px; }
.choices label { padding: 10px 14px; }
.scale label:hover, .choices label:hover { border-color: var(--accent); }
.scale input:checked + label, .choices input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scale input:focus-visible + label, .choices input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale__ends { display: flex; justify-content: space-between; font-size: 13px; margin-top: 4px; }

.demo-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

.btn {
  width: 100%;
  font: inherit;
  font-weight: 600;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: wait; }
.error { color: var(--danger); margin: 0 0 12px; }

.btn { display: block; text-align: center; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.message { text-align: center; padding: 16px 0 4px; }
.message__icon { font-size: 56px; margin-bottom: 8px; }
.message p { margin: 0; }
.message #msgExtra { margin-top: 20px; }

/* Демо на головній: SMS як у телефоні + посилання на анкети */
.demo { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.demo h2 { font-size: 18px; margin: 0 0 6px; }
.tabs { display: flex; gap: 6px; margin: 12px 0; }
.tabs button {
  flex: 1;
  font: inherit;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sms {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 4px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.sms a { color: var(--accent); }
