:root {
  --bg: #f4f1ea;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(18, 25, 34, 0.14);
  --line-strong: rgba(18, 25, 34, 0.26);
  --text: #0f1720;
  --muted: #596476;
  --accent: #2f63ff;
  --accent-soft: rgba(47, 99, 255, 0.12);
  --success: #1f7a56;
  --error: #b13a2f;
  --shadow: 0 18px 42px rgba(12, 17, 24, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --content: 1240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(47, 99, 255, 0.09), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.3)),
    var(--bg);
  color: var(--text);
  font-family: "Public Sans", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.page-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 32, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 32, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 88%);
}

.layout {
  width: min(calc(100% - 32px), var(--content));
  margin: 0 auto;
  padding: 48px 0 72px;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 24px;
  position: relative;
}

.hero,
.survey-shell {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
}

.hero {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 760px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: 48px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(47, 99, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(47, 99, 255, 0.09), rgba(255, 255, 255, 0)),
    rgba(255, 255, 255, 0.2);
  transform: rotate(12deg);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(15, 23, 32, 0.08);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
}

.eyebrow,
.section-kicker,
.panel-label,
.survey-step,
.question-number,
.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.eyebrow,
.section-kicker,
.panel-label,
.survey-step,
.question-number {
  color: var(--accent);
}

.hero h1,
.survey-shell h2,
.question-heading h3 {
  margin: 0;
  font-family: "Chivo", sans-serif;
}

.hero h1 {
  font-size: clamp(2.8rem, 4vw, 4.8rem);
  line-height: 0.94;
  max-width: 11ch;
}

.hero-copy,
.panel-copy,
.panel-list,
.section-copy,
.question-heading p,
.success-state p,
.choice-description {
  color: var(--muted);
  line-height: 1.65;
}

.hero-copy {
  max-width: 58ch;
  font-size: 1.04rem;
}

.hero-stats,
.hero-panels {
  display: grid;
  gap: 14px;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.info-panel,
.question-block,
.statement-card,
.scale-band,
.success-state,
.form-error {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: var(--radius-sm);
}

.stat-card {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
}

.stat-value {
  font-family: "Chivo", sans-serif;
  font-weight: 800;
  font-size: 1.24rem;
}

.hero-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: auto;
}

.info-panel {
  padding: 20px;
}

.info-panel:first-child {
  background:
    linear-gradient(180deg, rgba(47, 99, 255, 0.12), rgba(255, 255, 255, 0.95)),
    var(--panel-strong);
}

.panel-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.panel-list li + li {
  margin-top: 8px;
}

.survey-shell {
  padding: 28px;
  box-shadow: var(--shadow);
}

.survey-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.survey-header h2 {
  font-size: clamp(1.8rem, 2vw, 2.6rem);
  line-height: 1;
  margin-top: 6px;
}

.progress-chip {
  min-width: 70px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-align: center;
  font-weight: 700;
}

.progress-bar {
  margin-top: 18px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.08);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 14%;
  height: 100%;
  background: linear-gradient(90deg, #111827, #2f63ff);
  transition: width 220ms ease;
}

.section-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 24px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.section-copy {
  margin: 0;
  max-width: 56ch;
}

.step {
  display: none;
}

.step.is-active {
  display: block;
  animation: fadeIn 240ms ease;
}

.question-block,
.statement-card {
  padding: 20px;
  transition:
    transform 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
}

.question-block + .question-block,
.statement-card + .statement-card {
  margin-top: 14px;
}

.question-block:hover,
.statement-card:hover {
  border-color: rgba(18, 25, 34, 0.18);
  box-shadow: 0 12px 30px rgba(12, 17, 24, 0.06);
}

.question-heading {
  display: flex;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.question-number {
  min-width: 36px;
  padding-top: 4px;
}

.question-heading h3 {
  font-size: 1.18rem;
  line-height: 1.2;
}

.question-heading p {
  margin: 8px 0 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.choice-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card,
.choice-chip,
.likert-option {
  position: relative;
  cursor: pointer;
}

.choice-card input,
.choice-chip input,
.likert-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  pointer-events: none;
}

.choice-card {
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 249, 251, 0.88));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.choice-card:hover,
.choice-chip:hover,
.likert-option:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(15, 23, 32, 0.08);
}

.choice-title {
  font-family: "Chivo", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
}

.choice-chip {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 249, 251, 0.88));
  overflow: hidden;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.choice-chip::after,
.choice-card::after,
.likert-option::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(47, 99, 255, 0), rgba(47, 99, 255, 0.75), rgba(47, 99, 255, 0));
  transform: scaleX(0.2);
  transform-origin: center;
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.choice-chip__icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(47, 99, 255, 0.14);
  background: linear-gradient(180deg, rgba(47, 99, 255, 0.12), rgba(255, 255, 255, 0.95));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition:
    transform 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    color 220ms ease;
}

.choice-chip__icon svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-chip__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.choice-chip__title {
  font-weight: 700;
  line-height: 1.15;
  font-size: 0.98rem;
}

.choice-card:has(input:checked),
.choice-chip:has(input:checked),
.likert-option:has(input:checked) {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(47, 99, 255, 0.12), rgba(255, 255, 255, 0.96));
  box-shadow: 0 14px 32px rgba(47, 99, 255, 0.12);
}

.choice-card:hover::after,
.choice-chip:hover::after,
.likert-option:hover::after,
.choice-card:has(input:checked)::after,
.choice-chip:has(input:checked)::after,
.likert-option:has(input:checked)::after {
  transform: scaleX(1);
  opacity: 1;
}

.choice-chip:has(input:checked) .choice-chip__icon {
  background: linear-gradient(180deg, rgba(47, 99, 255, 0.22), rgba(255, 255, 255, 0.98));
  border-color: rgba(47, 99, 255, 0.32);
  color: var(--accent);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 10px 20px rgba(47, 99, 255, 0.14);
}

.scale-band {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.94rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.statement-card__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.statement-number {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Chivo", sans-serif;
  font-weight: 800;
}

.statement-text {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.5;
}

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

.likert-option {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 10px;
  overflow: hidden;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.likert-option__stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.likert-value {
  font-family: "Chivo", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.likert-label {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}

.question-block--textarea textarea {
  width: 100%;
  resize: vertical;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.question-block--textarea textarea:focus {
  outline: 2px solid rgba(47, 99, 255, 0.2);
  border-color: var(--accent);
}

.survey-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.button {
  appearance: none;
  border: 1px solid transparent;
  background: var(--text);
  color: white;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: #1b2431;
}

.button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.form-error {
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--error);
  border-color: rgba(177, 58, 47, 0.24);
  background: rgba(177, 58, 47, 0.06);
}

.is-invalid {
  border-color: rgba(177, 58, 47, 0.45);
}

.success-state {
  padding: 28px;
}

.success-state h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
  margin: 8px 0 10px;
}

.success-state .button {
  margin-top: 10px;
}

.result-profile {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.result-hero,
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(47, 99, 255, 0.08), rgba(255, 255, 255, 0.96));
}

.result-hero {
  padding: 20px;
}

.result-label,
.result-card__title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.result-hero h3 {
  margin: 8px 0 10px;
  font-family: "Chivo", sans-serif;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1;
}

.result-lead {
  margin: 0;
  max-width: 56ch;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-card {
  padding: 16px;
}

.result-card__top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.result-card__value {
  font-family: "Chivo", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.result-card__copy {
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 0.92rem;
}

.result-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.08);
  overflow: hidden;
  margin-top: 12px;
}

.result-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f1720, #2f63ff);
}

.survey-header,
.section-intro,
.question-block,
.statement-card,
.survey-actions {
  animation: liftIn 420ms ease both;
}

.question-block:nth-of-type(2),
.statement-card:nth-of-type(2) {
  animation-delay: 40ms;
}

.question-block:nth-of-type(3),
.statement-card:nth-of-type(3) {
  animation-delay: 80ms;
}

.question-block:nth-of-type(4),
.statement-card:nth-of-type(4) {
  animation-delay: 120ms;
}

.confetti-piece {
  position: absolute;
  width: var(--size);
  height: calc(var(--size) * 1.5);
  opacity: 0.95;
  animation: confettiFall var(--duration) ease-in var(--delay) forwards;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift), 105vh, 0) rotate(var(--rotate));
    opacity: 0.95;
  }
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .survey-shell {
    order: 1;
  }

  .hero {
    order: 2;
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .layout {
    width: min(calc(100% - 20px), var(--content));
    padding: 20px 0 40px;
  }

  .survey-shell {
    padding: 20px;
  }

  .hero {
    display: none;
  }

  .choice-grid,
  .choice-grid--two,
  .likert-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .survey-header,
  .section-intro,
  .scale-band {
    flex-direction: column;
    align-items: stretch;
  }

  .survey-shell {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }

  .survey-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 18px -20px 0;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(
      180deg,
      rgba(244, 241, 234, 0.12),
      rgba(244, 241, 234, 0.88) 26%,
      rgba(244, 241, 234, 0.98)
    );
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }

  .survey-actions .button {
    width: 100%;
  }

  .question-heading,
  .statement-card__meta {
    grid-template-columns: 1fr;
    display: grid;
  }

  .question-number,
  .statement-number {
    width: fit-content;
  }
}
