:root {
  --ink: #171832;
  --muted: #667095;
  --purple: #7658ff;
  --purple-dark: #4c38b5;
  --gold: #ffe27a;
  --gold-dark: #eda51e;
  --blue: #74d5ff;
  --paper: rgba(255, 255, 255, 0.78);
  --line: rgba(92, 104, 168, 0.2);
  --shadow: 0 26px 80px rgba(48, 50, 100, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 226, 122, 0.45), transparent 24rem),
    radial-gradient(circle at 90% 16%, rgba(118, 88, 255, 0.18), transparent 26rem),
    linear-gradient(145deg, #effbff, #faf5ff 56%, #ffffff);
  overflow-x: hidden;
}

button, input, textarea { font: inherit; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(118, 88, 255, 0.24);
  outline-offset: 3px;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 226, 122, 0.72);
  animation: float 8s ease-in-out infinite;
}

.bg span:nth-child(1) { left: 12%; top: 18%; }
.bg span:nth-child(2) { right: 18%; top: 24%; background: rgba(116, 213, 255, 0.7); animation-delay: -2s; }
.bg span:nth-child(3) { left: 22%; bottom: 20%; background: rgba(118, 88, 255, 0.28); animation-delay: -4s; }
.bg span:nth-child(4) { right: 28%; bottom: 12%; animation-delay: -6s; }

.invite-page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(48, 50, 100, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  line-height: 1;
}

.brand small {
  color: var(--muted);
  font-weight: 800;
  margin-top: 4px;
}

.price-pill {
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(48, 50, 100, 0.12);
  white-space: nowrap;
}

.hero {
  max-width: 780px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple-dark);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.15rem, 6vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.5;
}

.wizard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.74fr);
  gap: 22px;
  align-items: stretch;
}

.wizard-card,
.preview-card,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.wizard-card {
  min-height: 560px;
  padding: clamp(22px, 4vw, 38px);
}

.progress-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.progress-head span {
  color: var(--purple-dark);
  font-weight: 900;
}

.progress-head strong {
  font-size: clamp(1.3rem, 3vw, 2rem);
  text-align: right;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  overflow: hidden;
  margin-bottom: 34px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  transition: width 0.28s ease;
}

.step {
  display: none;
  min-height: 300px;
  animation: fadeUp 0.24s ease both;
}

.step.is-active { display: block; }

label {
  display: block;
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 4vw, 2.35rem);
  font-weight: 950;
  line-height: 1.05;
}

input,
textarea {
  width: 100%;
  border: 2px solid rgba(92, 104, 168, 0.2);
  border-radius: 24px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.45;
}

input.is-invalid,
textarea.is-invalid {
  border-color: #d94a72;
  box-shadow: 0 0 0 5px rgba(217, 74, 114, 0.12);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chips button,
#suggestBtn {
  border: 0;
  border-radius: 999px;
  padding: 11px 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--purple-dark);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(48, 50, 100, 0.08);
}

.chips button:hover,
#suggestBtn:hover,
.ghost:hover,
.primary:hover {
  transform: translateY(-1px);
}

.message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.message-head label {
  margin: 0;
}

.hint,
.form-error {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.form-error {
  color: #b93159;
}

.actions,
.modal-actions,
.result-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.primary,
.ghost,
.gold-link,
.ghost-link {
  border: 0;
  border-radius: 999px;
  padding: 16px 22px;
  font-weight: 950;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary,
.gold-link {
  background: linear-gradient(135deg, #fff28c, var(--gold-dark));
  color: #251b05;
  box-shadow: 0 18px 38px rgba(237, 165, 30, 0.32);
}

.ghost,
.ghost-link {
  background: rgba(255, 255, 255, 0.78);
  color: var(--purple-dark);
}

.primary:disabled,
.ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.preview-card {
  padding: clamp(22px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

.preview-badge {
  align-self: start;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 226, 122, 0.52);
  color: #705019;
  font-weight: 950;
}

.preview-card h2 {
  margin: 18px 0 12px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.08;
}

.preview-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.05rem;
}

.status-box {
  margin-top: auto;
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.small {
  height: 9px;
  margin: 0;
}

video {
  width: 100%;
  border-radius: 22px;
  margin-top: 18px;
  background: #111;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 24, 50, 0.42);
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(480px, 100%);
  padding: 28px;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.5;
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@media (max-width: 840px) {
  .invite-page {
    width: min(100% - 24px, 620px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand img {
    width: 52px;
    height: 52px;
  }

  .price-pill {
    padding: 10px 12px;
  }

  .wizard-shell {
    grid-template-columns: 1fr;
  }

  .wizard-card,
  .preview-card {
    min-height: auto;
  }

  .step {
    min-height: 260px;
  }

  .message-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions,
  .modal-actions,
  .result-actions {
    flex-direction: column;
  }

  .actions > *,
  .modal-actions > *,
  .result-actions > * {
    width: 100%;
  }
}
