:root {
  --primary: #7132f5;
  --primary-light: #9d6cff;
  --primary-dark: #5741d8;
  --primary-deep: #5b1ecf;
  --primary-glow: rgba(113, 50, 245, 0.35);
  --primary-soft: rgba(113, 50, 245, 0.12);
  --ink: #101114;
  --ink-secondary: #484b5e;
  --silver-blue: #9497a9;
  --border: rgba(222, 222, 229, 0.9);
  --background: rgba(255, 255, 255, 0.94);
  --success: #149e61;
  --radius-btn: 12px;
  --radius-card: 18px;
  --font: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}

.shell {
  height: 100dvh;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  position: relative;
  background: linear-gradient(145deg, #1a0b2e 0%, #2d1b69 40%, #120818 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
}

.glow-a {
  width: 260px;
  height: 260px;
  background: #7132f5;
  top: 12%;
  left: 6%;
  animation: drift 12s ease-in-out infinite alternate;
}

.glow-b {
  width: 200px;
  height: 200px;
  background: #5741d8;
  bottom: 10%;
  right: 8%;
  animation: drift 14s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  to {
    transform: translate(20px, 14px) scale(1.06);
  }
}

.card {
  width: min(100%, 360px);
  height: auto;
  max-height: calc(100dvh - 1.5rem);
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 36px rgba(16, 8, 40, 0.28);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: width 0.2s ease;
}

.card[data-mode="choices"] {
  width: min(100%, 400px);
}

.card[data-mode="done"] {
  width: min(100%, 300px);
}

.top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem 0.35rem;
}

.wordmark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-deep));
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 12px var(--primary-glow);
  flex: 0 0 auto;
}

.brand {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  color: #101114;
}

.dots {
  margin-left: auto;
  display: flex;
  gap: 5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e2e2ea;
  transition: all 0.25s ease;
}

.dot.is-on {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  transform: scale(1.15);
}

.dot.is-done {
  background: var(--success);
}

.progress-line {
  height: 3px;
  margin: 0 0.8rem 0.45rem;
  background: #ececf2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--primary-deep), var(--primary-light));
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#survey-form {
  display: block;
  padding: 0 0.8rem 0.75rem;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: stepIn 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step h2 {
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #101114;
  opacity: 1;
}

.step-sub {
  display: none;
}

.step-caption {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--ink-secondary);
  max-width: 36ch;
}

.step input[type="text"],
.step input[type="tel"],
.step input[type="email"],
.input-lg {
  width: 100%;
  padding: 0.78rem 0.85rem;
  font: inherit;
  font-size: 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.step input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.28rem;
  align-content: start;
}

.choice {
  position: relative;
  cursor: pointer;
  display: block;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

.choices-stack {
  grid-template-columns: 1fr;
  gap: 0.28rem;
}

.choices-portfolio {
  gap: 0.8rem;
}

.choices-portfolio .choice-stack span {
  min-height: 3.25rem;
  font-size: 1.02rem;
  font-weight: 600;
  padding-left: 1.1rem;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  border-color: rgba(200, 200, 210, 0.95);
  box-shadow: none;
}

.choices-portfolio .choice input:checked + span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.portfolio-priority {
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(222, 222, 229, 0.95);
  display: flex;
  justify-content: center;
}

.choice-priority {
  appearance: none;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  min-width: 6.25rem;
  max-width: 8.5rem;
  padding: 0.35rem 0.55rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 182, 194, 0.55);
  background: #f6f6f9;
  color: var(--silver-blue);
  box-shadow: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.choice-priority-main {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #6a6d7c;
}

.choice-priority-cap {
  font-size: 0.58rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--silver-blue);
}

.choice-priority-hint {
  font-size: 0.58rem;
  color: var(--ink-secondary);
  margin-top: 0.12rem;
}

.choice-priority.is-armed {
  border-color: rgba(113, 50, 245, 0.55);
  background: rgba(113, 50, 245, 0.06);
  color: var(--primary-deep);
}

.choice-priority.is-armed .choice-priority-main {
  color: var(--primary-deep);
}

.step-note {
  margin: 1.1rem 0 0;
  padding: 0 0.15rem;
  font-size: 0.68rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--silver-blue);
  text-align: center;
  max-width: 34ch;
  margin-left: auto;
  margin-right: 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;
}

.choices-issues {
  grid-template-columns: 1fr 1fr;
  gap: 0.28rem;
}

.choice-stack span {
  min-height: 2.35rem;
  font-size: 1rem;
  justify-content: flex-start;
  padding-left: 1.05rem;
}

.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.35rem 0.45rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.15;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink-secondary);
  background: linear-gradient(180deg, #fff 0%, #f8f7fc 100%);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s, color 0.12s;
  pointer-events: none;
}

.choice input:checked + span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px var(--primary-glow);
  transform: translateY(-1px);
}

.choice input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.choice:active span {
  transform: scale(0.97);
}

.actions {
  margin-top: 0.65rem;
  padding: 0;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 45%, var(--primary-deep) 100%);
  box-shadow: 0 8px 18px var(--primary-glow);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--primary-glow);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%) translateY(8px);
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: var(--success);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(20, 158, 97, 0.3);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 5;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-warn {
  background: #c53030;
}

.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 1.1rem 1.25rem;
  text-align: center;
  animation: stepIn 0.3s ease;
}

.success-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--primary-soft), rgba(20, 158, 97, 0.2), var(--primary-soft));
  display: grid;
  place-items: center;
  margin-bottom: 0.65rem;
}

.success-ring span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--success);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 42px;
  box-shadow: 0 4px 12px rgba(20, 158, 97, 0.2);
}

.success-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: #101114;
}

.success-copy {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--silver-blue);
}

.success-ref {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-secondary);
}

@media (max-height: 520px) {
  .step h2 {
    font-size: 1.05rem;
  }
  .choice-stack span {
    min-height: 2.6rem;
  }
  .choice span {
    min-height: 2.2rem;
    font-size: 0.72rem;
  }
}
