:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #0f1522;
  --muted: #5b6577;
  --line: #dfe3ec;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --accent-soft: #e9efff;
  --ok: #0f8a5f;
  --err: #c0304a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 21, 34, .04), 0 10px 30px rgba(15, 21, 34, .07);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 15% -10%, #e7edff 0%, rgba(231, 237, 255, 0) 70%),
    radial-gradient(700px 380px at 95% 0%, #eaf6f0 0%, rgba(234, 246, 240, 0) 65%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(880px, 100% - 40px);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header */

.site-header {
  padding: 20px 0 8px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: 17px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2f5bea, #10a37f);
  align-self: center;
  box-shadow: 0 2px 6px rgba(47, 91, 234, .35);
}

.brand-suffix {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
  background: #eef2fa;
}

.lang-menu {
  position: relative;
  margin-left: 4px;
}

.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .8);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary:hover {
  border-color: #b9c6ea;
}

.lang-menu summary:focus-visible {
  outline: 3px solid rgba(47, 91, 234, .35);
  outline-offset: 2px;
}

.lang-menu[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 234, .15);
}

.chev {
  transition: transform .15s ease;
}

.lang-menu[open] .chev {
  transform: rotate(180deg);
}

.lang-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}

.lang-item:hover {
  background: #f2f5fb;
}

.lang-item:focus-visible {
  outline: 3px solid rgba(47, 91, 234, .35);
  outline-offset: -1px;
}

.lang-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.lang-item.is-active::after {
  content: "✓";
  font-size: 13px;
}

/* Hero */

.hero {
  padding: 40px 0 26px;
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -.025em;
}

.lede {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--muted);
  max-width: 58ch;
}

.note {
  display: inline-block;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff6e6;
  border: 1px solid #f2ddb4;
  color: #7a5510;
  font-size: 13.5px;
}

/* Cards and form */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.survey {
  margin-bottom: 28px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.progress {
  margin-bottom: 26px;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: #edf0f7;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f5bea, #12a37e);
  transition: width .25s ease;
}

.progress-label {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.step-title {
  margin: 0 0 18px;
  font-size: 22px;
  letter-spacing: -.015em;
  outline: none;
}

fieldset.q {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.step .q + .q {
  margin-top: 28px;
}

.q-head {
  padding: 0;
  margin-bottom: 12px;
}

.q-label {
  font-weight: 600;
  font-size: 16px;
}

.req {
  color: var(--err);
  margin-left: 2px;
}

.opt-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1f7;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  vertical-align: 1px;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.opt:hover {
  border-color: #b9c6ea;
}

.opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.opt-box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid #97a3ba;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  transition: border-color .15s ease, background .15s ease;
}

.opt input[type="checkbox"] + .opt-box {
  border-radius: 6px;
}

.opt-box::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .12s ease;
}

.opt input[type="checkbox"] + .opt-box::after {
  width: 10px;
  height: 5px;
  margin-top: -2px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  border-radius: 1px;
  background: transparent;
  transform: rotate(-45deg) scale(0);
}

.opt input:checked + .opt-box {
  background: var(--accent);
  border-color: var(--accent);
}

.opt input:checked + .opt-box::after {
  transform: scale(1);
}

.opt input[type="checkbox"]:checked + .opt-box::after {
  transform: rotate(-45deg) scale(1);
}

.opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.opt input:focus-visible + .opt-box {
  outline: 3px solid rgba(47, 91, 234, .35);
  outline-offset: 2px;
}

.opt-text {
  font-size: 15px;
  line-height: 1.4;
}

/* Scale */

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.scale-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}

.scale-opt:hover {
  border-color: #b9c6ea;
}

.scale-opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.scale-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #97a3ba;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.scale-text {
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--muted);
}

.scale-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.scale-opt:has(input:checked) .scale-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.scale-opt input:focus-visible + .scale-num {
  outline: 3px solid rgba(47, 91, 234, .35);
  outline-offset: 2px;
}

/* Text inputs */

textarea,
input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea:focus,
input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 234, .18);
}

textarea {
  min-height: 110px;
}

/* Consent */

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.consent-row > input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.consent-row > label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--muted);
}

.consent-row .opt-box {
  margin-top: 2px;
}

.consent-row input[type="checkbox"] + label .opt-box {
  border-radius: 6px;
}

.consent-row input:checked + label .opt-box {
  background: var(--accent);
  border-color: var(--accent);
}

.consent-row input:checked + label .opt-box::after {
  content: "";
  width: 10px;
  height: 5px;
  margin-top: -2px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  border-radius: 1px;
  transform: rotate(-45deg);
}

.consent-row input:focus-visible + label .opt-box {
  outline: 3px solid rgba(47, 91, 234, .35);
  outline-offset: 2px;
}

.consent-link {
  margin: 8px 0 0 32px;
  font-size: 13px;
}

.consent-link a {
  color: var(--accent);
}

/* Errors and actions */

.q-error {
  margin: 8px 0 0;
  color: var(--err);
  font-size: 13.5px;
  font-weight: 500;
}

.q.invalid .opt,
.q.invalid .scale-opt {
  border-color: var(--err);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 22px;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
}

.btn:hover {
  background: #2549c4;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: .6;
  cursor: progress;
}

.btn.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover {
  background: #f2f5fb;
  border-color: #c8d2e6;
}

.btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

.form-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fdecef;
  border: 1px solid #f3c3cc;
  color: var(--err);
  font-size: 14px;
}

.turnstile-wrap {
  margin-top: 28px;
  min-height: 65px;
  display: flex;
  align-items: center;
}

/* Thank you */

.thankyou {
  text-align: center;
  margin-bottom: 28px;
}

.thankyou h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.thankyou p {
  color: var(--muted);
  margin: 0 auto 14px;
  max-width: 52ch;
}

.thankyou .ref {
  font-size: 14px;
}

.thankyou code {
  padding: 2px 8px;
  border-radius: 6px;
  background: #f0f3f9;
  font-size: 13px;
}

/* Privacy */

.privacy {
  margin-bottom: 40px;
}

.privacy h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.privacy p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14.5px;
}

.privacy p:last-child {
  margin-bottom: 0;
}

.reward-note {
  margin: 0 0 22px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #fff8e6;
  border: 1px solid #f0dca6;
  color: #7a5510;
  font-size: 14px;
  line-height: 1.45;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 34px;
  background: rgba(255, 255, 255, .6);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
}

/* Admin */

.admin {
  padding: 32px 0 60px;
}

.admin h1 {
  font-size: 28px;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

.admin h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.admin .card {
  margin-bottom: 18px;
}

.crumbs {
  margin: 0 0 10px;
  font-size: 13.5px;
}

.crumbs a {
  color: var(--accent);
  text-decoration: none;
}

.inbox-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.inbox-filter input[type="search"] {
  flex: 1 1 240px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.inbox-filter input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 234, .18);
}

.inbox-item {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.inbox-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.inbox-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.badge.alt {
  background: #eaf6f0;
  color: var(--ok);
}

.inbox-line {
  margin: 8px 0 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.inbox-line a {
  color: var(--accent);
}

.inbox-message {
  margin: 6px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain li + li {
  margin-top: 6px;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

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

.stat h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.stat h3 .muted {
  font-family: inherit;
  font-weight: 400;
  display: block;
  font-size: 12.5px;
  margin-top: 2px;
}

.stat > p {
  margin: 0 0 12px;
  font-size: 12.5px;
}

.dist {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.dist li {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 90px auto;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
}

.dist-label {
  color: var(--ink);
}

.dist-bar {
  height: 7px;
  border-radius: 999px;
  background: #edf0f7;
  overflow: hidden;
}

.dist-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.dist-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: #f8f9fc;
  position: sticky;
  top: 0;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Responsive */

@media (max-width: 640px) {
  .wrap {
    width: min(880px, 100% - 28px);
  }

  .card {
    padding: 20px;
  }

  .hero {
    padding: 28px 0 20px;
  }

  .scale {
    grid-template-columns: 1fr;
  }

  .scale-opt {
    flex-direction: row;
    text-align: left;
    padding: 11px 14px;
  }

  .scale-text {
    font-size: 13.5px;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .actions .btn {
    width: 100%;
  }

  .consent-link {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .nav-link {
    display: none;
  }

  .lang-list {
    min-width: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
