:root {
  --paper: #f6f1e7;
  --ink: #161616;
  --muted: #8d877c;
  --line: #e4ddd0;
  --card: #fffdf8;
  --indigo: #3c2f86;
  --indigo-soft: #efeaf8;
  --danger: #9b3b3b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(60, 47, 134, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--indigo);
  transition: width 0.25s ease;
}

#app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 4.5rem 1.25rem 3rem;
}

.step {
  width: min(40rem, 100%);
  text-align: center;
  animation: rise 0.28s ease;
}

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

.kicker {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.help {
  max-width: 36rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.welcome,
.next-label {
  max-width: 36rem;
  margin: 1.15rem auto 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.55;
}

.next-label {
  margin-top: 1.5rem;
  font-weight: 650;
}

.help a {
  color: inherit;
}

.help strong {
  color: var(--ink);
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
}

button,
.pay {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--indigo);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.72rem 1.15rem;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.back {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0.2rem;
}

.choices,
.fields,
.groups {
  margin: 1.6rem auto 0;
  text-align: left;
}

.choices {
  display: grid;
  gap: 0.65rem;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 34rem;
  margin: 1.4rem 0 0;
}

.cards .choice {
  width: 7.4rem;
  min-height: 7.4rem;
  justify-content: center;
  padding: 0.7rem 0.55rem;
  border-color: #161616;
  border-radius: 2px;
  background: #e4dfd4;
  font-size: 0.92rem;
  text-align: center;
}

.cards .choice.selected {
  background: #d4cec1;
  box-shadow: inset 0 0 0 1px #161616;
}

.cards-step {
  text-align: left;
}

.cards-step h1 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
}

.cards-step .help {
  margin-left: 0;
  margin-right: 0;
  font-size: 0.98rem;
  text-align: left;
}

.cards-step .actions {
  justify-content: flex-start;
}

.cards-step .hint {
  display: none;
}

.choice {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  line-height: 1.35;
  padding: 0.85rem 1rem;
  text-align: left;
}

.choice:hover,
.choice.selected {
  border-color: var(--indigo);
}

.choice.selected {
  background: var(--indigo-soft);
}

.fields {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #3f3c36;
  font-size: 0.92rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  padding: 0.8rem 0.9rem;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--indigo);
  outline: 2px solid rgba(60, 47, 134, 0.15);
}

.error {
  margin: 0.7rem 0 0;
  color: var(--danger);
  font-size: 0.92rem;
}

.groups {
  display: grid;
  gap: 1.4rem;
}

.groups h2 {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pills .choice {
  width: auto;
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
}

.note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .actions {
    flex-direction: column;
  }

  .back {
    position: static;
    display: block;
    margin: 0 auto 1rem;
  }

  #app {
    place-items: start center;
    padding-top: 1.25rem;
  }
}
