:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --ink: #18212b;
  --muted: #596674;
  --line: #dbe2ea;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #0b5d57;
  --danger: #b42318;
  --focus: #f4b942;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.page {
  width: 100%;
}

.survey-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.survey-header,
.result-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 14px;
}

.brand {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.subtitle {
  margin: 6px 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.notice,
.privacy,
.help {
  color: var(--muted);
}

.notice {
  margin: 0;
}

.test-badge {
  display: inline-block;
  margin: 14px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #f1d38a;
  background: #fff8e5;
  color: #6f4f00;
  font-weight: 700;
}

.block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin: 14px 0;
}

.question {
  padding: 16px 0;
  border-bottom: 1px solid #edf1f5;
}

.question:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.question-title {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.control ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.control li {
  margin: 0;
}

.control label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

input[type="radio"],
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.range-wrap {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 12px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

output {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: rgba(245, 247, 249, 0.94);
  border-top: 1px solid var(--line);
  padding: 12px 0 6px;
  backdrop-filter: blur(8px);
}

button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.link-button {
  display: inline-block;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.protocol {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-size: 18px;
}

.messages {
  background: #fff8e5;
  border: 1px solid #f1d38a;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
}

.messages p {
  margin: 0;
}

.error,
.errorlist {
  color: var(--danger);
  font-weight: 700;
}

.error {
  margin: 8px 0 0;
}

.has-error .control label,
.has-error select,
.has-error textarea {
  border-color: var(--danger);
}

.result-card {
  max-width: 620px;
  margin: 48px auto;
}

.footer {
  max-width: 820px;
  margin: 0 auto 32px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: var(--muted);
}

.consent {
  margin: 2px 0 18px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.consent label {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}

.consent input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-top: 0;
}

.consent a {
  color: var(--brand);
  font-weight: 700;
}

.links-tool {
  max-width: 820px;
}

.utm-form {
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
}

.utm-form input,
.utm-item input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}

.utm-list {
  display: grid;
  gap: 12px;
}

.utm-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.utm-item h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

[hidden] {
  display: none !important;
}

@media (min-width: 720px) {
  .survey-shell {
    padding-top: 32px;
  }

  h1 {
    font-size: 34px;
  }

  .survey-header,
  .block {
    padding: 24px;
  }
}
