:root {
  --bg-mint: #d8ece4;
  --bg-sand: #f0dcd0;
  --bg-rose: #f6c4b4;
  --ink: #253449;
  --ink-soft: #53667a;
  --surface: rgba(255, 251, 247, 0.9);
  --surface-border: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 24px 52px rgba(77, 45, 28, 0.17);
  --line: #d5dce2;
  --brand: #1f61f1;
  --brand-deep: #123da8;
  --brand-soft: #dce9ff;
  --accent: #ff7a45;
  --accent-soft: rgba(255, 122, 69, 0.16);
  --error: #d54a4a;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--bg-mint) 0%, var(--bg-mint) 28%, var(--bg-sand) 28%, #efddd3 100%),
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.5) 0%, transparent 30%),
    radial-gradient(circle at 20% 70%, rgba(255, 255, 255, 0.32) 0%, transparent 34%);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: -6%;
  width: 112%;
  border-radius: 50%;
  pointer-events: none;
  z-index: -2;
}

body::before {
  height: 48vh;
  bottom: -26vh;
  background: radial-gradient(ellipse at center, rgba(159, 126, 105, 0.24) 0%, rgba(159, 126, 105, 0.08) 58%, rgba(159, 126, 105, 0) 78%);
}

body::after {
  height: 42vh;
  bottom: -30vh;
  background: radial-gradient(ellipse at center, rgba(250, 255, 255, 0.4) 0%, rgba(250, 255, 255, 0) 75%);
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}

.ambient-1 {
  width: 360px;
  height: 360px;
  top: 70px;
  left: -120px;
  background: rgba(122, 214, 199, 0.34);
}

.ambient-2 {
  width: 320px;
  height: 320px;
  right: -80px;
  top: 240px;
  background: rgba(255, 136, 92, 0.24);
}

.ambient-3 {
  width: 420px;
  height: 420px;
  left: calc(50% - 210px);
  bottom: -180px;
  background: rgba(26, 96, 233, 0.2);
}

.page-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 8px;
  background: rgba(31, 97, 241, 0.13);
  z-index: 30;
}

.page-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #0e49cc 0%, #2b78ff 50%, #3b8dff 100%);
  box-shadow: 0 1px 14px rgba(26, 102, 248, 0.55);
  transition: width 0.35s ease;
}

.layout {
  width: min(1020px, 94vw);
  margin: 84px auto 22px;
  display: grid;
  justify-items: center;
  gap: 30px;
}

.panel {
  width: min(680px, 100%);
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(6px);
}

.intro-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(28px, 5.8vw, 48px) clamp(20px, 5vw, 54px);
  animation: introRise 0.55s ease both;
}

.intro-card::before {
  content: "";
  position: absolute;
  inset: -120px auto auto -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 140, 95, 0.25), rgba(255, 140, 95, 0));
  pointer-events: none;
}

.intro-card::after {
  content: "";
  position: absolute;
  inset: auto -100px -130px auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(37, 90, 215, 0.2), rgba(37, 90, 215, 0));
  pointer-events: none;
}

.intro-kicker {
  margin: 0 auto 16px;
  width: fit-content;
  padding: 7px 14px;
  border: 1px solid rgba(31, 97, 241, 0.35);
  border-radius: 999px;
  background: rgba(232, 242, 255, 0.8);
  color: #2254c7;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 700;
}

.intro-card h1 {
  margin: 0 0 14px;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-size: clamp(1.95rem, 4.2vw, 3.05rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.intro-card p {
  margin: 0 auto 34px;
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.35vw, 1.14rem);
  line-height: 1.64;
}

.survey-flow {
  width: min(920px, 100%);
  min-width: 0;
}

.card-stack {
  position: relative;
  padding-top: 14px;
  min-width: 0;
}

.card-backdrop {
  position: absolute;
  inset: 0 20px 0 6px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 122, 69, 0.3), transparent 38%),
    linear-gradient(135deg, rgba(44, 107, 245, 0.58), rgba(68, 176, 198, 0.35));
  transform: translate(-14px, -11px) rotate(-0.4deg);
  box-shadow: 0 20px 36px rgba(48, 66, 108, 0.22);
}

.step {
  position: relative;
  display: none;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.97) 0%, rgba(251, 246, 242, 0.96) 100%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  padding: 30px clamp(14px, 3.3vw, 34px) 32px;
  box-shadow: var(--card-shadow);
  min-width: 0;
}

.step::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  top: -110px;
  right: -90px;
  background: radial-gradient(circle at center, rgba(33, 99, 235, 0.2), rgba(33, 99, 235, 0));
  pointer-events: none;
}

.step::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  bottom: -130px;
  left: -80px;
  background: radial-gradient(circle at center, rgba(255, 126, 75, 0.17), rgba(255, 126, 75, 0));
  pointer-events: none;
}

.step.is-active {
  display: block;
  animation: stepReveal 0.36s ease;
}

@keyframes introRise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stepReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.step-counter {
  margin: 0 0 16px;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 6px 13px 8px;
  border-radius: 999px;
  background: rgba(227, 236, 255, 0.75);
  border: 1px solid rgba(31, 97, 241, 0.28);
  color: var(--brand);
}

.step-counter span {
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 700;
}

.step-counter small {
  font-size: 0.98rem;
  color: #6f8094;
}

.step h2 {
  margin: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-size: clamp(1.33rem, 2.6vw, 2.06rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.required {
  margin-right: 7px;
  color: var(--accent);
}

.step-note {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.99rem;
}

.divider {
  margin: 22px 0;
  border-top: 1px dashed var(--line);
}

.contact-grid {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 600;
  font-size: 0.94rem;
  color: #2d3d53;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  border: 1px solid #ced8e2;
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b3c4d8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #1f61f1;
  box-shadow: 0 0 0 4px rgba(31, 97, 241, 0.14);
  transform: translateY(-1px);
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 16px;
}

.matrix {
  width: 100%;
  max-width: 100%;
  min-width: 735px;
  border-collapse: collapse;
  border: 1px solid #d8e0e8;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

.matrix th {
  padding: 14px 8px;
  font-size: 0.99rem;
  font-weight: 700;
  color: #294364;
  text-align: center;
  background: linear-gradient(180deg, #ecf4ff 0%, #e7eefb 100%);
  border-bottom: 1px solid #d8dfec;
}

.matrix .question-title td {
  padding: 17px 16px 8px;
  font-size: 1.01rem;
  color: #2d3f57;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.matrix .question-title.is-answered td {
  color: #1e4e98;
  background: linear-gradient(90deg, rgba(201, 223, 255, 0.46), rgba(201, 223, 255, 0));
}

.matrix .choice-row td {
  width: 20%;
  text-align: center;
  padding: 3px 0 16px;
  transition: background-color 0.25s ease;
}

.matrix .choice-row.is-answered td {
  background: linear-gradient(180deg, rgba(230, 241, 255, 0.75), rgba(230, 241, 255, 0));
}

.matrix .choice-row td.missing {
  background: rgba(213, 74, 74, 0.11);
}

.matrix input[type="radio"] {
  margin: 0;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.8px solid #9eb0c3;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.matrix input[type="radio"]::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff8a5a 0%, #ff6d37 100%);
  transform: scale(0);
  transition: transform 0.16s ease;
}

.matrix input[type="radio"]:hover {
  transform: scale(1.08);
  border-color: #7594b6;
}

.matrix input[type="radio"]:checked {
  border-color: #ff7a45;
  box-shadow: 0 0 0 4px rgba(255, 122, 69, 0.2);
}

.matrix input[type="radio"]:checked::after {
  transform: scale(1);
}

.step-error {
  min-height: 1.3em;
  margin: 12px 0 0;
  color: var(--error);
  font-size: 0.95rem;
  font-weight: 600;
}

.results-step .step-note {
  max-width: 60ch;
}

.result-highlight {
  border: 1px solid rgba(31, 97, 241, 0.26);
  background: linear-gradient(135deg, rgba(231, 240, 255, 0.82), rgba(255, 255, 255, 0.76));
  border-radius: 18px;
  padding: 16px 16px 14px;
}

.result-kicker {
  margin: 0 0 7px;
  color: #2256c9;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-highlight h3 {
  margin: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.result-advice {
  margin: 8px 0 0;
  color: #3d5270;
  line-height: 1.45;
}

.action-row {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 14px;
}

.pill-btn {
  border: 0;
  border-radius: 999px;
  min-width: 204px;
  padding: 12px 26px;
  font: inherit;
  font-size: 1.07rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #0d4fd8 0%, #1f76ff 100%);
  box-shadow: 0 8px 0 var(--brand-deep), 0 10px 24px rgba(24, 76, 196, 0.26);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.pill-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-18deg);
  transition: left 0.45s ease;
}

.pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 var(--brand-deep), 0 14px 28px rgba(24, 76, 196, 0.28);
}

.pill-btn:hover::before {
  left: 140%;
}

.pill-btn:active {
  transform: translateY(3px);
  box-shadow: 0 4px 0 var(--brand-deep), 0 7px 16px rgba(24, 76, 196, 0.25);
}

.pill-btn.ghost {
  color: #1f5bd2;
  background: linear-gradient(180deg, #f6f9ff 0%, #e9f0ff 100%);
  box-shadow: 0 7px 0 #c7d7f5, 0 8px 18px rgba(31, 97, 241, 0.14);
}

.pill-btn.ghost:active {
  box-shadow: 0 4px 0 #c7d7f5, 0 5px 10px rgba(31, 97, 241, 0.14);
}

.pill-btn[hidden] {
  display: none;
}


@media (max-width: 980px) {
  .layout {
    width: min(96vw, 920px);
  }

  .card-backdrop {
    inset: 0 10px 0 2px;
  }
}

@media (max-width: 760px) {
  .layout {
    width: calc(100vw - 16px);
    margin-top: 56px;
    gap: 16px;
  }

  .panel {
    width: 100%;
    border-radius: 18px;
  }

  .intro-card {
    padding: 20px 14px 22px;
  }

  .intro-kicker {
    margin-bottom: 10px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    padding: 6px 11px;
  }

  .intro-card h1 {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
    line-height: 1.05;
  }

  .intro-card p {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 18px;
  }

  .card-backdrop {
    transform: translate(-8px, -7px);
    border-radius: 18px;
  }

  .step {
    border-radius: 18px;
    padding: 20px 12px 22px;
  }

  .step-counter {
    padding: 5px 10px 7px;
  }

  .step-counter span {
    font-size: 1.4rem;
  }

  .step h2 {
    font-size: clamp(1.12rem, 5.8vw, 1.45rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px;
    padding: 10px 12px;
  }

  .action-row {
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .result-highlight {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .matrix {
    min-width: 100%;
    table-layout: fixed;
  }

  .matrix th {
    font-size: 0.76rem;
    line-height: 1.2;
    padding: 9px 4px;
    word-break: break-word;
  }

  .matrix .question-title td {
    font-size: 0.86rem;
    line-height: 1.3;
    padding: 12px 10px 8px;
    overflow-wrap: anywhere;
  }

  .matrix .choice-row td {
    padding: 4px 0 11px;
  }

  .pill-btn {
    font-size: 1rem;
    padding: 10px 18px;
    width: 100%;
    min-width: 0;
  }

  .ambient-1,
  .ambient-2,
  .ambient-3 {
    filter: blur(52px);
  }
}

@media (max-width: 420px) {
  .layout {
    width: calc(100vw - 10px);
    margin-top: 50px;
    gap: 14px;
  }

  .panel {
    border-radius: 16px;
  }

  .intro-card {
    padding: 16px 11px 18px;
  }

  .intro-kicker {
    font-size: 0.64rem;
    padding: 5px 9px;
  }

  .intro-card h1 {
    font-size: clamp(1.4rem, 8.3vw, 1.95rem);
    margin-bottom: 10px;
  }

  .intro-card p {
    font-size: 0.9rem;
    line-height: 1.38;
    margin-bottom: 14px;
  }

  .step {
    padding: 16px 10px 20px;
    border-radius: 16px;
  }

  .step h2 {
    font-size: clamp(1rem, 6vw, 1.28rem);
  }

  .matrix th {
    font-size: 0.68rem;
    padding: 8px 3px;
  }

  .matrix .question-title td {
    font-size: 0.8rem;
    padding: 10px 8px 7px;
  }

  .result-kicker {
    font-size: 0.72rem;
  }

  .page-progress {
    height: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
