:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --page: #f2f2f7;
  --surface: #ffffff;
  --text: #111111;
  --muted: #585858;
  --line: rgba(17, 17, 17, 0.08);
  --green: #16a34a;
  --green-dark: #15803d;
  --green-soft: #dcfce7;
  --green-pale: #f0fdf4;
  --red: #dc2626;
  --focus: rgba(37, 99, 235, 0.38);
  --card-shadow: 0 8px 18px rgba(17, 17, 17, 0.08);
}

* { box-sizing: border-box; }

html { background: var(--page); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

[hidden] { display: none !important; }

.survey-header,
.survey-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px clamp(24px, 5vw, 72px);
}

.survey-header {
  min-height: 76px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.survey-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.survey-brand__icon {
  display: block;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 11px;
  box-shadow: 0 3px 8px rgba(17, 17, 17, 0.12);
}

.survey-header__back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.survey-header__back svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.survey-main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.survey-hero {
  padding: 6px 8px 22px;
}

.survey-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.survey-hero__copy > p {
  max-width: 720px;
  margin: 9px 0 0;
  color: #1f2937;
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.survey-hero__meta {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  color: #6b7280;
  font-size: 14px;
}

.survey-panel {
  display: grid;
  gap: 12px;
}

.survey-loading,
.survey-panel > .survey-submit__error {
  margin: 0;
  padding: 42px 30px;
  text-align: center;
}

.survey-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 8px 4px;
}

.survey-progress__track {
  overflow: hidden;
  height: 6px;
  background: #dfe1e5;
  border-radius: 999px;
}

.survey-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width 220ms ease;
}

.survey-progress p { margin: 0; color: #4b5563; font-size: 13px; font-weight: 650; white-space: nowrap; }

.survey-panel form > [data-survey-questions] {
  display: grid;
  gap: 14px;
}

.survey-question {
  min-width: 0;
  margin: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--card-shadow);
}

.survey-question legend {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  font-size: 19px;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.survey-question__number {
  display: inline-grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 750;
}

.required-mark { color: #f25f3a; margin-left: -7px; }
.optional-mark { color: var(--muted); font-size: 14px; font-weight: 500; }
.survey-question__hint { margin: 7px 0 0 44px; color: #6b7280; font-size: 14px; }

.survey-options {
  display: grid;
  gap: 11px;
  margin: 20px 0 0 44px;
}

.survey-options--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.survey-options--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.survey-options--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.survey-options label {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.3;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.survey-options label:hover { background: var(--green-pale); border-color: #bbf7d0; }

.survey-options input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin: 0;
  background-color: #fff;
  border: 2px solid #a8a8ad;
  cursor: pointer;
}

.survey-options input[type="radio"] { border-radius: 50%; }
.survey-options input[type="checkbox"] { border-radius: 7px; }

.survey-options input[type="radio"]:checked {
  background: radial-gradient(circle, #fff 0 4px, var(--green) 5px);
  border-color: var(--green);
}

.survey-options input[type="checkbox"]:checked {
  background-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10 3 3 7-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: var(--green);
}

.survey-options label:has(input:checked) {
  background: var(--green-pale);
  border-color: #86efac;
}

.survey-options input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.survey-question--error {
  border-radius: 22px;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
}

.survey-question__error {
  margin: 12px 0 0 52px;
  color: var(--red);
  font-size: 13px;
  font-weight: 650;
}

.survey-submit {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1.15fr) minmax(220px, 0.75fr);
  align-items: center;
  gap: 22px;
  margin-top: 14px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--card-shadow);
}

.survey-submit button,
.survey-success__actions a {
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.survey-submit button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.survey-submit button:hover,
.survey-success__actions a:hover { background: var(--green-dark); transform: translateY(-1px); }

.survey-submit button:focus-visible,
.survey-success__actions a:focus-visible,
.survey-success__actions button:focus-visible,
.survey-header a:focus-visible,
.survey-footer a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.survey-submit p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.survey-submit__error { color: var(--red) !important; font-weight: 650; }

.survey-success {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 30px;
  margin-top: 24px;
  padding: 30px;
  background: var(--surface);
  border: 1px solid #bbf7d0;
  border-radius: 24px;
  box-shadow: var(--card-shadow);
}

.survey-success__icon {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 46px;
}

.survey-success h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.survey-success p { margin: 8px 0 0; color: var(--muted); }
.survey-success__actions { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.survey-success__actions a { display: inline-grid; min-width: 140px; min-height: 44px; place-items: center; }
.survey-success__actions button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }

.survey-footer {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  color: #4b5563;
  font-size: 14px;
}

.survey-footer p { margin: 0; }
.survey-footer nav { display: flex; gap: 32px; }
.survey-footer a { text-decoration: none; }

@media (max-width: 900px) {
  .survey-main { width: min(760px, calc(100% - 28px)); padding-top: 24px; }
  .survey-hero { padding-inline: 12px; }
  .survey-options--five,
  .survey-options--four,
  .survey-options--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .survey-submit { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .survey-header { min-height: 68px; padding: 11px 16px; }
  .survey-brand { gap: 10px; font-size: 22px; }
  .survey-brand__icon { width: 42px; height: 42px; border-radius: 10px; }
  .survey-header__back { font-size: 13px; }
  .survey-main { width: min(100% - 24px, 520px); padding-top: 16px; }
  .survey-hero { padding: 2px 4px 16px; }
  .survey-hero h1 { font-size: clamp(30px, 8.5vw, 36px); }
  .survey-hero__copy > p { margin-top: 8px; font-size: 16px; }
  .survey-hero__meta { flex-wrap: wrap; margin-top: 9px; font-size: 13px; }
  .survey-progress { gap: 12px; padding: 0 4px 2px; }
  .survey-progress p { text-align: right; font-size: 12px; }
  .survey-question { padding: 20px 18px; border-radius: 20px; }
  .survey-question legend { align-items: flex-start; font-size: 18px; }
  .survey-question__hint,
  .survey-options { margin-left: 0; }
  .survey-options--five,
  .survey-options--four,
  .survey-options--three { grid-template-columns: 1fr; gap: 7px; }
  .survey-options label { min-height: 50px; padding-inline: 12px; }
  .survey-question__error { margin-left: 8px; }
  .survey-submit { padding: 18px; border-radius: 20px; text-align: center; }
  .survey-success { grid-template-columns: 1fr; text-align: center; }
  .survey-success__icon { width: 74px; height: 74px; margin-inline: auto; }
  .survey-success__actions { justify-content: center; flex-direction: column; }
  .survey-footer { padding-inline: 18px; }
}

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