:root {
  --bg: #081427;
  --bg-deep: #06111f;
  --surface: rgba(12, 28, 50, 0.88);
  --surface-strong: #0f2037;
  --surface-soft: rgba(17, 35, 61, 0.72);
  --card: rgba(247, 250, 255, 0.98);
  --card-soft: rgba(230, 239, 248, 0.95);
  --ink: #0c1d33;
  --muted: #5d718d;
  --line: rgba(124, 150, 184, 0.22);
  --line-strong: rgba(111, 227, 215, 0.34);
  --accent: #72e3d4;
  --accent-deep: #46cdbf;
  --accent-soft: rgba(114, 227, 212, 0.16);
  --accent-strong: rgba(114, 227, 212, 0.24);
  --text-on-dark: #f4f8fc;
  --shadow: 0 30px 80px rgba(2, 10, 22, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text-on-dark);
  font-family: "Archivo", "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(114, 227, 212, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(57, 132, 203, 0.14), transparent 26%),
    linear-gradient(180deg, #0a1730 0%, var(--bg) 40%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 420px;
  pointer-events: none;
  opacity: 0.34;
  background:
    linear-gradient(135deg, transparent 42%, rgba(114, 227, 212, 0.09) 42%, rgba(114, 227, 212, 0.09) 58%, transparent 58%) 0 0 / 62px 62px,
    linear-gradient(225deg, transparent 42%, rgba(114, 227, 212, 0.07) 42%, rgba(114, 227, 212, 0.07) 58%, transparent 58%) 31px 31px / 62px 62px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.site-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.site-menu-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(10, 23, 48, 0.64);
  border: 1px solid rgba(114, 227, 212, 0.14);
  color: rgba(244, 248, 252, 0.84);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.site-menu-link:hover,
.site-menu-link.active {
  transform: translateY(-2px);
  border-color: rgba(114, 227, 212, 0.4);
  background: rgba(12, 33, 58, 0.92);
  color: var(--text-on-dark);
}

.hero,
.template-card,
.meta-card,
.question-section,
.preview-card,
.hero-panel {
  border: 1px solid rgba(114, 227, 212, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 420px);
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(40px, 6vw, 80px);
  border-radius: var(--radius-xl);
  margin-bottom: clamp(36px, 5vw, 56px);
  background:
    linear-gradient(135deg, rgba(9, 22, 42, 0.98), rgba(13, 32, 55, 0.95)),
    var(--surface);
}

.hero-copy > * + * { margin-top: 18px; }
.hero-copy h1 { margin-top: 22px; }
.hero-copy .lede { margin-top: 24px; max-width: 50ch; }
.hero-copy .hero-actions { margin-top: 32px; }

.brand-lockup {
  display: inline-block;
  margin-bottom: 18px;
  line-height: 0;
}

.brand-lockup img {
  display: block;
  height: clamp(54px, 6.5vw, 84px);
  width: auto;
}

.eyebrow,
.panel-label,
.status-label {
  margin: 0 0 10px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(152, 177, 208, 0.84);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Archivo", "Avenir Next", sans-serif;
  letter-spacing: -0.045em;
}

h1 {
  font-size: clamp(2.8rem, 4.4vw, 5.4rem);
  font-weight: 300;
  line-height: 0.95;
  max-width: 18ch;
}

h2 {
  font-size: clamp(1.95rem, 3vw, 3.3rem);
  font-weight: 300;
  line-height: 0.95;
}

h3 {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.05;
}

.hero .lede,
.hero .panel-label,
.hero .privacy-note,
.hero .section-note,
.hero-panel .lede,
.hero-panel li,
.hero-copy .lede {
  color: rgba(229, 238, 248, 0.82);
}

.lede,
.section-note {
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.6;
}

.setup-panel .section-note,
.template-strip .section-note,
.builder .section-note {
  color: rgba(229, 238, 248, 0.78);
}

.privacy-note {
  margin: 10px 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hero-actions,
.preview-actions,
.status-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-link,
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-link:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.primary-link,
.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #052032;
  box-shadow: 0 16px 34px rgba(66, 209, 193, 0.24);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
  border: 1px solid rgba(114, 227, 212, 0.45);
}
.ghost-button:hover {
  background: rgba(114, 227, 212, 0.12);
  border-color: var(--accent);
}

.meta-card .ghost-button,
.template-card .ghost-button,
.preview-card .ghost-button,
.question-section .ghost-button,
.wizard-actions .ghost-button {
  background: #f6fbff;
  color: var(--ink);
  border-color: rgba(93, 113, 141, 0.18);
}
.meta-card .ghost-button:hover,
.template-card .ghost-button:hover,
.preview-card .ghost-button:hover,
.question-section .ghost-button:hover,
.wizard-actions .ghost-button:hover {
  background: #ffffff;
  border-color: var(--accent-deep);
}

.hero-panel {
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(18, 40, 68, 0.9), rgba(11, 28, 49, 0.94)),
    var(--surface-strong);
}

.starter-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 14px;
  line-height: 1.45;
}

.starter-list--ordered { padding-left: 22px; }
.starter-list--ordered li::marker { color: var(--accent); font-weight: 700; }

.template-strip,
.setup-panel,
.builder {
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-heading {
  margin-bottom: 32px;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1fr);
  gap: clamp(28px, 3.5vw, 44px);
  margin-top: 28px;
}

.setup-copy {
  display: grid;
  align-content: start;
  gap: 16px;
}

.setup-status {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(114, 227, 212, 0.12);
  color: #124657;
  font-weight: 600;
  line-height: 1.45;
}

.section-heading,
.builder-header,
.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.template-card,
.meta-card,
.question-section,
.preview-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 253, 0.98)),
    var(--card);
  color: var(--ink);
}

.template-card {
  display: grid;
  gap: 16px;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.template-card:hover,
.template-card.active {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px rgba(4, 18, 36, 0.18);
}

.template-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.template-card-copy {
  display: grid;
  gap: 2px;
}

.template-card-actions {
  display: grid;
  gap: 10px;
}

.template-toggle-button.selected {
  border-color: rgba(70, 205, 191, 0.28);
  background: rgba(114, 227, 212, 0.14);
  color: #0d3a4d;
}

.template-edit-button,
.template-toggle-button {
  width: 100%;
}

.template-meta {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(114, 227, 212, 0.12);
  color: #0f5065;
  font-size: 0.82rem;
  font-weight: 600;
}

.builder {
  padding-top: 8px;
  max-width: 980px;
}

.status-chip {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(14, 31, 54, 0.74);
  border: 1px solid rgba(114, 227, 212, 0.18);
  color: var(--text-on-dark);
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 22px;
  margin-top: 20px;
}

.wizard-progress {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(114, 227, 212, 0.12);
}

.wizard-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: width 220ms ease;
}

.wizard-card {
  margin-top: 18px;
}

.question-panel {
  display: grid;
  gap: 18px;
}

.meta-card,
.question-section,
.preview-card {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.meta-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: clamp(28px, 3vw, 36px);
}

.consent-field {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(114, 227, 212, 0.08);
  border: 1px solid rgba(114, 227, 212, 0.18);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  color: #2a4357;
  cursor: pointer;
}
.consent-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent-deep);
  cursor: pointer;
}
.consent-field span { display: block; }

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink);
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(93, 113, 141, 0.18);
  background: #fbfdff;
  color: var(--ink);
  resize: vertical;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(93, 113, 141, 0.78);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(70, 205, 191, 0.55);
  box-shadow: 0 0 0 4px rgba(114, 227, 212, 0.15);
  background: #ffffff;
}

.questions-root {
  display: grid;
  gap: 18px;
}

.question-block {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.98), rgba(232, 241, 250, 0.96));
  border: 1px solid rgba(93, 113, 141, 0.14);
}

.question-block-header {
  display: flex;
  gap: 14px;
  align-items: start;
}

.question-block-header p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.question-section {
  display: grid;
  gap: 14px;
}

.question-section > div p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.section-index {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #0e5065;
  font-weight: 700;
}

.question-row {
  display: grid;
  gap: 8px;
}

.question-row p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.final-root {
  display: grid;
  gap: 18px;
}

.final-meta-card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.preview-card.sticky {
  position: sticky;
  top: 18px;
}

.output-preview {
  margin: 18px 0 0;
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #0b172d, #091121),
    #091121;
  color: #dfeaf6;
  border: 1px solid rgba(114, 227, 212, 0.14);
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.88rem;
  line-height: 1.62;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-grid,
  .builder-grid,
  .hero {
    grid-template-columns: 1fr;
  }

  .preview-card.sticky {
    position: static;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .hero,
  .meta-card,
  .question-section,
  .preview-card {
    padding: 22px;
  }

  .hero {
    margin-bottom: 24px;
  }

  .template-strip,
  .setup-panel,
  .builder {
    margin-bottom: 28px;
  }

  .section-heading {
    margin-bottom: 18px;
  }

  /* On mobile push the secondary CTA below the primary so it doesn't get lost */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .primary-link,
  .hero-actions .ghost-button {
    width: 100%;
  }

  .template-grid,
  .meta-card {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .wizard-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .section-heading,
  .builder-header,
  .preview-header {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }

  .brand-lockup img {
    height: 54px;
  }
}
