{
  "id": 109,
  "slug": "conversational-progressive-wizard",
  "name": "Step-by-Step Conversational Progressive Wizard",
  "kind": "ui",
  "family": "Forms & Onboarding",
  "sourceSite": {
    "name": "Typeform",
    "url": "https://www.typeform.com",
    "verifiedStatus": 200
  },
  "tagline": "One-question-at-a-time progressive form with smooth transitions, keyboard letter shortcuts, and thumb-zone navigation.",
  "whyUnique": "Eliminates long-form overwhelm by focusing attention on a single conversational prompt at a time with instant visual progress and effortless keyboard/touch flow.",
  "theme": "light",
  "mobileStrength": "native-first",
  "tags": [
    "conversational-form",
    "progressive-wizard",
    "onboarding",
    "keyboard-shortcuts",
    "step-form"
  ],
  "bestFor": [
    "Client intake & project estimators",
    "Account onboarding flows",
    "Interactive quizzes & surveys",
    "Insurance & fintech quotes"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#FAF7F2",
      "name": "Warm Linen"
    },
    {
      "role": "surface",
      "hex": "#FFFFFF",
      "name": "Paper Card"
    },
    {
      "role": "ink",
      "hex": "#1F1A17",
      "name": "Espresso Ink"
    },
    {
      "role": "accent",
      "hex": "#2563EB",
      "name": "Cobalt Focus"
    },
    {
      "role": "muted",
      "hex": "#6E655E",
      "name": "Warm Taupe"
    }
  ],
  "typography": {
    "display": "Newsreader",
    "body": "Inter",
    "mono": "JetBrains Mono",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@500&family=Newsreader:wght@500;600&display=swap",
    "scaleNotes": "Inviting 24-32px serif question prompts paired with crisp 15px choice cards and mono keycap badges (A, B, C)."
  },
  "layoutNotes": "Pinned top progress hairline, centered single-prompt stage, and sticky bottom Back/Continue navigation dock.",
  "interactionNotes": "Supports tap/click selection, A/B/C/D letter shortcuts, Enter to advance, inline validation feedback, and a final editable summary receipt.",
  "mobileNotes": "Full-width >=52px choice cards and bottom-docked Continue button keep the entire flow comfortably one-handed on 390px screens.",
  "agentGuardrails": {
    "do": [
      "Always display a clear step counter and progress bar so users know how many prompts remain",
      "Allow users to go back and edit previous answers without losing later entries",
      "Support Enter to advance and letter shortcuts on desktop while keeping large tap targets on mobile"
    ],
    "dont": [
      "Do not auto-advance multi-select chip questions before the user explicitly confirms",
      "Do not hide validation errors until the final step; validate gently per step"
    ]
  },
  "demoFile": "demos/conversational-progressive-wizard.html",
  "thumbDesktop": "thumbs/conversational-progressive-wizard-desktop.webp",
  "thumbMobile": "thumbs/conversational-progressive-wizard-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/conversational-progressive-wizard",
    "markdown": "https://templates.michaelpitts.net/t/conversational-progressive-wizard.md",
    "api": "https://templates.michaelpitts.net/api/templates/conversational-progressive-wizard",
    "demo": "https://templates.michaelpitts.net/demos/conversational-progressive-wizard.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/conversational-progressive-wizard-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/conversational-progressive-wizard-mobile.webp"
  },
  "agentPrompt": "Design & build using template #109 \"Step-by-Step Conversational Progressive Wizard\" (ui / Forms & Onboarding, light theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/conversational-progressive-wizard.md\nLive demo: https://templates.michaelpitts.net/demos/conversational-progressive-wizard.html\nReal-world inspiration: Typeform (https://www.typeform.com)\n\nCore aesthetic: Eliminates long-form overwhelm by focusing attention on a single conversational prompt at a time with instant visual progress and effortless keyboard/touch flow.\nPalette: canvas: #FAF7F2 (Warm Linen), surface: #FFFFFF (Paper Card), ink: #1F1A17 (Espresso Ink), accent: #2563EB (Cobalt Focus), muted: #6E655E (Warm Taupe)\nTypography: Display=\"Newsreader\", Body=\"Inter\", Mono=\"JetBrains Mono\"\nLayout: Pinned top progress hairline, centered single-prompt stage, and sticky bottom Back/Continue navigation dock.\nInteractions: Supports tap/click selection, A/B/C/D letter shortcuts, Enter to advance, inline validation feedback, and a final editable summary receipt.\nMobile: Full-width >=52px choice cards and bottom-docked Continue button keep the entire flow comfortably one-handed on 390px screens.\n\nGuardrails:\n- DO: Always display a clear step counter and progress bar so users know how many prompts remain\n- DO: Allow users to go back and edit previous answers without losing later entries\n- DO: Support Enter to advance and letter shortcuts on desktop while keeping large tap targets on mobile\n- DON'T: Do not auto-advance multi-select chip questions before the user explicitly confirms\n- DON'T: Do not hide validation errors until the final step; validate gently per step",
  "sourceCode": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Atelier North — Conversational Progressive Brand Estimator</title>\n<style>\n  :root {\n    --canvas: #FAF7F2;\n    --surface: #FFFFFF;\n    --ink: #1F1A17;\n    --accent: #2563EB;\n    --accent-hover: #1D4ED8;\n    --accent-soft: #EFF6FF;\n    --muted: #6E655E;\n    --border: #E7E0D6;\n    --danger: #DC2626;\n    --success: #059669;\n    --radius: 16px;\n    --font-sans: \"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n    --font-serif: Georgia, \"Iowan Old Style\", \"Times New Roman\", serif;\n  }\n\n  * { box-sizing: border-box; margin: 0; padding: 0; }\n\n  html, body {\n    height: 100%;\n    background: var(--canvas);\n    color: var(--ink);\n    font-family: var(--font-sans);\n    line-height: 1.5;\n    -webkit-font-smoothing: antialiased;\n    overflow-x: clip;\n  }\n\n  .wizard-shell {\n    min-height: 100dvh;\n    display: flex;\n    flex-direction: column;\n  }\n\n  /* Top Progress & Brand */\n  .progress-track {\n    position: fixed;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 4px;\n    background: #EAE2D7;\n    z-index: 30;\n  }\n\n  .progress-fill {\n    height: 100%;\n    width: 20%;\n    background: var(--accent);\n    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);\n  }\n\n  .top-header {\n    max-width: 780px;\n    width: 100%;\n    margin: 0 auto;\n    padding: 20px 18px 8px;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n  }\n\n  .studio-mark {\n    display: inline-flex;\n    align-items: center;\n    gap: 9px;\n    font-weight: 700;\n    font-size: 0.92rem;\n    letter-spacing: -0.01em;\n  }\n\n  .studio-dot {\n    width: 26px;\n    height: 26px;\n    border-radius: 7px;\n    background: var(--ink);\n    color: var(--canvas);\n    display: grid;\n    place-items: center;\n    font-family: var(--font-serif);\n    font-size: 0.85rem;\n  }\n\n  .step-counter {\n    font-size: 0.8rem;\n    font-weight: 600;\n    color: var(--muted);\n    background: var(--surface);\n    border: 1px solid var(--border);\n    padding: 5px 11px;\n    border-radius: 999px;\n  }\n\n  /* Main Stage */\n  .stage {\n    flex: 1;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 16px 18px 104px;\n  }\n\n  .question-card {\n    width: 100%;\n    max-width: 680px;\n    animation: slideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);\n  }\n\n  @keyframes slideIn {\n    from { opacity: 0; transform: translateY(18px); }\n    to { opacity: 1; transform: translateY(0); }\n  }\n\n  .q-kicker {\n    display: inline-flex;\n    align-items: center;\n    gap: 7px;\n    font-size: 0.8rem;\n    font-weight: 700;\n    color: var(--accent);\n    text-transform: uppercase;\n    letter-spacing: 0.06em;\n    margin-bottom: 10px;\n  }\n\n  .q-title {\n    font-family: var(--font-serif);\n    font-size: clamp(1.5rem, 4vw, 2.15rem);\n    font-weight: 400;\n    line-height: 1.22;\n    letter-spacing: -0.015em;\n    margin-bottom: 10px;\n  }\n\n  .q-subtitle {\n    font-size: 0.95rem;\n    color: var(--muted);\n    margin-bottom: 24px;\n  }\n\n  /* Option Cards (Single-select) */\n  .options-list {\n    display: grid;\n    grid-template-columns: 1fr;\n    gap: 10px;\n  }\n\n  @media (min-width: 600px) {\n    .options-list.two-col {\n      grid-template-columns: repeat(2, minmax(0, 1fr));\n    }\n  }\n\n  .opt-card {\n    width: 100%;\n    min-height: 58px;\n    padding: 13px 15px;\n    border-radius: 13px;\n    border: 1.5px solid var(--border);\n    background: var(--surface);\n    color: var(--ink);\n    text-align: left;\n    font-family: inherit;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;\n  }\n\n  .opt-card:hover {\n    border-color: #BFDBFE;\n    background: #FBFDFF;\n  }\n\n  .opt-card:active {\n    transform: scale(0.99);\n  }\n\n  .opt-card.selected {\n    border-color: var(--accent);\n    background: var(--accent-soft);\n    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);\n  }\n\n  .keycap {\n    width: 28px;\n    height: 28px;\n    border-radius: 7px;\n    border: 1px solid var(--border);\n    background: var(--canvas);\n    color: var(--muted);\n    font-size: 0.76rem;\n    font-weight: 700;\n    display: grid;\n    place-items: center;\n    flex-shrink: 0;\n  }\n\n  .opt-card.selected .keycap {\n    background: var(--accent);\n    border-color: var(--accent);\n    color: #FFFFFF;\n  }\n\n  .opt-text strong {\n    display: block;\n    font-size: 0.94rem;\n    font-weight: 650;\n  }\n\n  .opt-text span {\n    display: block;\n    font-size: 0.78rem;\n    color: var(--muted);\n  }\n\n  /* Scope Multi-Select Chips */\n  .chips-wrap {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 10px;\n  }\n\n  .scope-chip {\n    min-height: 46px;\n    padding: 0 15px;\n    border-radius: 999px;\n    border: 1.5px solid var(--border);\n    background: var(--surface);\n    color: var(--ink);\n    font-size: 0.88rem;\n    font-weight: 600;\n    font-family: inherit;\n    cursor: pointer;\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n    transition: all 0.15s;\n  }\n\n  .scope-chip:hover { border-color: #93C5FD; }\n\n  .scope-chip.selected {\n    background: var(--accent);\n    border-color: var(--accent);\n    color: #FFFFFF;\n  }\n\n  .scope-chip .chip-key {\n    font-size: 0.7rem;\n    font-weight: 700;\n    opacity: 0.72;\n    padding: 2px 6px;\n    border-radius: 5px;\n    background: rgba(0, 0, 0, 0.06);\n  }\n\n  .scope-chip.selected .chip-key {\n    background: rgba(255, 255, 255, 0.22);\n    opacity: 1;\n  }\n\n  /* Budget Slider */\n  .budget-panel {\n    background: var(--surface);\n    border: 1.5px solid var(--border);\n    border-radius: var(--radius);\n    padding: 22px 20px;\n  }\n\n  .budget-readout {\n    display: flex;\n    align-items: baseline;\n    justify-content: space-between;\n    gap: 12px;\n    margin-bottom: 18px;\n    flex-wrap: wrap;\n  }\n\n  .budget-figure {\n    font-family: var(--font-serif);\n    font-size: 2.1rem;\n    color: var(--ink);\n  }\n\n  .budget-tier {\n    font-size: 0.8rem;\n    font-weight: 700;\n    color: var(--accent);\n    background: var(--accent-soft);\n    padding: 5px 11px;\n    border-radius: 999px;\n  }\n\n  .range-input {\n    width: 100%;\n    height: 8px;\n    -webkit-appearance: none;\n    appearance: none;\n    background: #E7E0D6;\n    border-radius: 999px;\n    outline: none;\n    cursor: pointer;\n  }\n\n  .range-input::-webkit-slider-thumb {\n    -webkit-appearance: none;\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    background: var(--accent);\n    border: 3px solid #FFFFFF;\n    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.38);\n    cursor: pointer;\n  }\n\n  .range-input::-moz-range-thumb {\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    background: var(--accent);\n    border: 3px solid #FFFFFF;\n    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.38);\n    cursor: pointer;\n  }\n\n  .range-ticks {\n    display: flex;\n    justify-content: space-between;\n    margin-top: 10px;\n    font-size: 0.76rem;\n    color: var(--muted);\n    font-weight: 600;\n  }\n\n  /* Contact Inputs */\n  .field-group {\n    display: flex;\n    flex-direction: column;\n    gap: 14px;\n  }\n\n  .field label {\n    display: block;\n    font-size: 0.82rem;\n    font-weight: 700;\n    margin-bottom: 6px;\n    color: var(--ink);\n  }\n\n  .text-input {\n    width: 100%;\n    min-height: 48px;\n    padding: 10px 14px;\n    border-radius: 12px;\n    border: 1.5px solid var(--border);\n    background: var(--surface);\n    color: var(--ink);\n    font-size: 0.96rem;\n    font-family: inherit;\n    transition: border-color 0.15s, box-shadow 0.15s;\n  }\n\n  .text-input:focus {\n    outline: none;\n    border-color: var(--accent);\n    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);\n  }\n\n  .error-msg {\n    margin-top: 12px;\n    font-size: 0.84rem;\n    font-weight: 600;\n    color: var(--danger);\n    min-height: 20px;\n  }\n\n  /* Receipt Summary */\n  .receipt-card {\n    background: var(--surface);\n    border: 1.5px solid var(--border);\n    border-radius: var(--radius);\n    padding: 22px;\n    box-shadow: 0 12px 32px rgba(31, 26, 23, 0.06);\n  }\n\n  .receipt-row {\n    display: flex;\n    align-items: flex-start;\n    justify-content: space-between;\n    gap: 12px;\n    padding: 11px 0;\n    border-bottom: 1px dashed var(--border);\n    font-size: 0.9rem;\n  }\n\n  .receipt-row:last-of-type { border-bottom: none; }\n\n  .receipt-label {\n    color: var(--muted);\n    font-size: 0.82rem;\n    font-weight: 600;\n  }\n\n  .receipt-val {\n    text-align: right;\n    font-weight: 650;\n  }\n\n  .edit-link {\n    border: none;\n    background: transparent;\n    color: var(--accent);\n    font-size: 0.78rem;\n    font-weight: 600;\n    cursor: pointer;\n    margin-left: 8px;\n    text-decoration: underline;\n  }\n\n  .estimate-box {\n    margin-top: 16px;\n    padding: 15px 16px;\n    border-radius: 12px;\n    background: var(--canvas);\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .estimate-box strong {\n    font-family: var(--font-serif);\n    font-size: 1.35rem;\n    color: var(--accent);\n  }\n\n  /* Bottom Thumb Navigation Bar */\n  .bottom-nav {\n    position: fixed;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(250, 247, 242, 0.92);\n    backdrop-filter: blur(10px);\n    border-top: 1px solid var(--border);\n    padding: 12px 18px;\n    z-index: 25;\n  }\n\n  .bottom-nav-inner {\n    max-width: 680px;\n    margin: 0 auto;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n\n  .kbd-hint {\n    display: none;\n    font-size: 0.78rem;\n    color: var(--muted);\n  }\n\n  @media (min-width: 640px) {\n    .kbd-hint { display: inline; }\n  }\n\n  .nav-btns {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    margin-left: auto;\n    width: 100%;\n    justify-content: space-between;\n  }\n\n  @media (min-width: 640px) {\n    .nav-btns { width: auto; }\n  }\n\n  .btn-back {\n    min-height: 46px;\n    min-width: 90px;\n    padding: 0 16px;\n    border-radius: 12px;\n    border: 1.5px solid var(--border);\n    background: var(--surface);\n    color: var(--ink);\n    font-size: 0.88rem;\n    font-weight: 650;\n    font-family: inherit;\n    cursor: pointer;\n  }\n\n  .btn-back:disabled {\n    opacity: 0.4;\n    cursor: not-allowed;\n  }\n\n  .btn-next {\n    min-height: 46px;\n    min-width: 132px;\n    padding: 0 20px;\n    border-radius: 12px;\n    border: none;\n    background: var(--accent);\n    color: #FFFFFF;\n    font-size: 0.9rem;\n    font-weight: 700;\n    font-family: inherit;\n    cursor: pointer;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    gap: 7px;\n    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);\n  }\n\n  .btn-next:hover { background: var(--accent-hover); }\n\n  .submitted-badge {\n    display: inline-flex;\n    align-items: center;\n    gap: 7px;\n    background: #ECFDF5;\n    color: var(--success);\n    padding: 7px 13px;\n    border-radius: 999px;\n    font-size: 0.82rem;\n    font-weight: 700;\n    margin-bottom: 14px;\n  }\n</style>\n</head>\n<body>\n<div class=\"wizard-shell\">\n  <div class=\"progress-track\"><div id=\"progressFill\" class=\"progress-fill\"></div></div>\n\n  <header class=\"top-header\">\n    <div class=\"studio-mark\">\n      <span class=\"studio-dot\">A</span>\n      <span>Atelier North</span>\n    </div>\n    <span id=\"stepCounter\" class=\"step-counter\">1 of 5</span>\n  </header>\n\n  <main class=\"stage\">\n    <div id=\"stageHost\" class=\"question-card\" aria-live=\"polite\"></div>\n  </main>\n\n  <footer class=\"bottom-nav\">\n    <div class=\"bottom-nav-inner\">\n      <span id=\"kbdHint\" class=\"kbd-hint\">Press <strong>A–D</strong> to choose &middot; <strong>Enter</strong> to continue</span>\n      <div class=\"nav-btns\">\n        <button id=\"btnBack\" class=\"btn-back\" type=\"button\">&larr; Back</button>\n        <button id=\"btnNext\" class=\"btn-next\" type=\"button\">Continue &rarr;</button>\n      </div>\n    </div>\n  </footer>\n</div>\n\n<script>\n(function () {\n  const PROJECT_TYPES = [\n    { key: \"A\", id: \"rebrand\", title: \"Full Brand Identity\", desc: \"Positioning, visual system, guidelines & launch kit\", base: 18000 },\n    { key: \"B\", id: \"web\", title: \"Flagship Marketing Site\", desc: \"Custom editorial web design & interactive frontend\", base: 14000 },\n    { key: \"C\", id: \"product\", title: \"Product Design System\", desc: \"Component library, tokens & core UX architecture\", base: 22000 },\n    { key: \"D\", id: \"campaign\", title: \"Launch Campaign\", desc: \"Art direction, motion assets & landing pages\", base: 9500 }\n  ];\n\n  const TIMELINES = [\n    { key: \"A\", id: \"rush\", title: \"Sprint (3–4 weeks)\", desc: \"Dedicated senior pod, expedited milestones\", mult: 1.25 },\n    { key: \"B\", id: \"standard\", title: \"Standard (6–8 weeks)\", desc: \"Balanced discovery, exploration & polish\", mult: 1.0 },\n    { key: \"C\", id: \"extended\", title: \"Quarter-long (10–12 weeks)\", desc: \"Deep research, testing & phased rollout\", mult: 1.1 },\n    { key: \"D\", id: \"flexible\", title: \"Flexible / Exploring\", desc: \"Aligning internally before locking a start date\", mult: 1.0 }\n  ];\n\n  const SCOPES = [\n    { key: \"A\", label: \"Brand Strategy\", add: 3500 },\n    { key: \"B\", label: \"Logo & Typography\", add: 4000 },\n    { key: \"C\", label: \"Web Development\", add: 5500 },\n    { key: \"D\", label: \"Motion & 3D\", add: 3000 },\n    { key: \"E\", label: \"Copywriting\", add: 2500 },\n    { key: \"F\", label: \"Design Tokens\", add: 3500 }\n  ];\n\n  const state = {\n    step: 0, // 0..4 questions, 5 = receipt\n    projectType: null,\n    timeline: null,\n    scopes: new Set([\"Brand Strategy\", \"Logo & Typography\"]),\n    budget: 25000,\n    name: \"\",\n    email: \"\",\n    company: \"\",\n    error: \"\",\n    submitted: false\n  };\n\n  const els = {\n    host: document.getElementById(\"stageHost\"),\n    progress: document.getElementById(\"progressFill\"),\n    counter: document.getElementById(\"stepCounter\"),\n    btnBack: document.getElementById(\"btnBack\"),\n    btnNext: document.getElementById(\"btnNext\"),\n    kbdHint: document.getElementById(\"kbdHint\")\n  };\n\n  function budgetTier(val) {\n    if (val < 15000) return \"Focused Sprint\";\n    if (val < 30000) return \"Core Studio Engagement\";\n    if (val < 55000) return \"Flagship Transformation\";\n    return \"Enterprise Retainer\";\n  }\n\n  function calcEstimate() {\n    const pt = PROJECT_TYPES.find((p) => p.id === state.projectType) || PROJECT_TYPES[0];\n    const tl = TIMELINES.find((t) => t.id === state.timeline) || TIMELINES[1];\n    let scopeTotal = 0;\n    SCOPES.forEach((s) => { if (state.scopes.has(s.label)) scopeTotal += s.add; });\n    const raw = Math.round((pt.base + scopeTotal) * tl.mult / 500) * 500;\n    return { low: Math.max(8000, raw - 3000), high: raw + 4000 };\n  }\n\n  function validateStep() {\n    state.error = \"\";\n    if (state.step === 0 && !state.projectType) {\n      state.error = \"Choose a project type to continue.\";\n      return false;\n    }\n    if (state.step === 1 && !state.timeline) {\n      state.error = \"Select a target timeline to continue.\";\n      return false;\n    }\n    if (state.step === 2 && state.scopes.size === 0) {\n      state.error = \"Pick at least one deliverable chip.\";\n      return false;\n    }\n    if (state.step === 4) {\n      if (state.name.trim().length < 2) {\n        state.error = \"Please enter your name.\";\n        return false;\n      }\n      if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(state.email.trim())) {\n        state.error = \"Please enter a valid work email address.\";\n        return false;\n      }\n    }\n    return true;\n  }\n\n  function render() {\n    const pct = state.step >= 5 ? 100 : ((state.step + 1) / 5) * 100;\n    els.progress.style.width = pct + \"%\";\n    els.counter.textContent = state.step < 5 ? `${state.step + 1} of 5` : \"Summary Receipt\";\n    els.btnBack.disabled = state.step === 0;\n\n    // Re-trigger entry animation\n    els.host.style.animation = \"none\";\n    void els.host.offsetWidth;\n    els.host.style.animation = \"\";\n\n    if (state.step === 0) {\n      els.kbdHint.innerHTML = \"Press <strong>A–D</strong> to pick &middot; <strong>Enter</strong> to continue\";\n      els.btnNext.textContent = \"Continue →\";\n      els.host.innerHTML = `\n        <div class=\"q-kicker\">Step 01 &middot; Project Type</div>\n        <h1 class=\"q-title\">What are we building together?</h1>\n        <p class=\"q-subtitle\">Select the primary engagement track so we can tailor deliverables and pacing.</p>\n        <div class=\"options-list\">\n          ${PROJECT_TYPES.map((p) => `\n            <button class=\"opt-card ${state.projectType === p.id ? \"selected\" : \"\"}\" data-type=\"${p.id}\" type=\"button\">\n              <span class=\"keycap\">${p.key}</span>\n              <span class=\"opt-text\"><strong>${p.title}</strong><span>${p.desc}</span></span>\n            </button>\n          `).join(\"\")}\n        </div>\n        <div class=\"error-msg\">${state.error}</div>\n      `;\n    } else if (state.step === 1) {\n      els.kbdHint.innerHTML = \"Press <strong>A–D</strong> to pick &middot; <strong>Enter</strong> to continue\";\n      els.btnNext.textContent = \"Continue →\";\n      els.host.innerHTML = `\n        <div class=\"q-kicker\">Step 02 &middot; Timeline</div>\n        <h1 class=\"q-title\">When do you want to launch?</h1>\n        <p class=\"q-subtitle\">This helps us reserve the right creative &amp; engineering pod for your window.</p>\n        <div class=\"options-list two-col\">\n          ${TIMELINES.map((t) => `\n            <button class=\"opt-card ${state.timeline === t.id ? \"selected\" : \"\"}\" data-time=\"${t.id}\" type=\"button\">\n              <span class=\"keycap\">${t.key}</span>\n              <span class=\"opt-text\"><strong>${t.title}</strong><span>${t.desc}</span></span>\n            </button>\n          `).join(\"\")}\n        </div>\n        <div class=\"error-msg\">${state.error}</div>\n      `;\n    } else if (state.step === 2) {\n      els.kbdHint.innerHTML = \"Press <strong>A–F</strong> to toggle chips &middot; <strong>Enter</strong> to continue\";\n      els.btnNext.textContent = \"Continue →\";\n      els.host.innerHTML = `\n        <div class=\"q-kicker\">Step 03 &middot; Scope</div>\n        <h1 class=\"q-title\">Which deliverables should be included?</h1>\n        <p class=\"q-subtitle\">Toggle as many as you need — we will factor them into your live estimate.</p>\n        <div class=\"chips-wrap\">\n          ${SCOPES.map((s) => `\n            <button class=\"scope-chip ${state.scopes.has(s.label) ? \"selected\" : \"\"}\" data-scope=\"${s.label}\" type=\"button\">\n              <span class=\"chip-key\">${s.key}</span>\n              <span>${s.label}</span>\n            </button>\n          `).join(\"\")}\n        </div>\n        <div class=\"error-msg\">${state.error}</div>\n      `;\n    } else if (state.step === 3) {\n      els.kbdHint.innerHTML = \"Use <strong>&larr;/&rarr;</strong> on slider &middot; <strong>Enter</strong> to continue\";\n      els.btnNext.textContent = \"Continue →\";\n      els.host.innerHTML = `\n        <div class=\"q-kicker\">Step 04 &middot; Investment</div>\n        <h1 class=\"q-title\">What budget range feels comfortable?</h1>\n        <p class=\"q-subtitle\">Slide to set a ballpark target — no commitment required.</p>\n        <div class=\"budget-panel\">\n          <div class=\"budget-readout\">\n            <span id=\"budgetVal\" class=\"budget-figure\">$${state.budget.toLocaleString(\"en-US\")}</span>\n            <span id=\"budgetTier\" class=\"budget-tier\">${budgetTier(state.budget)}</span>\n          </div>\n          <input id=\"budgetSlider\" class=\"range-input\" type=\"range\" min=\"8000\" max=\"75000\" step=\"1000\" value=\"${state.budget}\" aria-label=\"Target budget\">\n          <div class=\"range-ticks\">\n            <span>$8k</span><span>$25k</span><span>$50k</span><span>$75k+</span>\n          </div>\n        </div>\n        <div class=\"error-msg\">${state.error}</div>\n      `;\n    } else if (state.step === 4) {\n      els.kbdHint.innerHTML = \"Press <strong>Enter</strong> to review your summary receipt\";\n      els.btnNext.textContent = \"Review Receipt →\";\n      els.host.innerHTML = `\n        <div class=\"q-kicker\">Step 05 &middot; Contact</div>\n        <h1 class=\"q-title\">Where should we send your estimate?</h1>\n        <p class=\"q-subtitle\">We reply within one business day with a tailored scope and calendar link.</p>\n        <div class=\"field-group\">\n          <div class=\"field\">\n            <label for=\"inpName\">Your Name *</label>\n            <input id=\"inpName\" class=\"text-input\" type=\"text\" placeholder=\"Maya Lin\" value=\"${state.name.replace(/\"/g, \"&quot;\")}\" autocomplete=\"name\">\n          </div>\n          <div class=\"field\">\n            <label for=\"inpEmail\">Work Email *</label>\n            <input id=\"inpEmail\" class=\"text-input\" type=\"email\" placeholder=\"maya@northstar.co\" value=\"${state.email.replace(/\"/g, \"&quot;\")}\" autocomplete=\"email\">\n          </div>\n          <div class=\"field\">\n            <label for=\"inpCompany\">Company or Brand (optional)</label>\n            <input id=\"inpCompany\" class=\"text-input\" type=\"text\" placeholder=\"Northstar Labs\" value=\"${state.company.replace(/\"/g, \"&quot;\")}\" autocomplete=\"organization\">\n          </div>\n        </div>\n        <div class=\"error-msg\">${state.error}</div>\n      `;\n    } else {\n      const pt = PROJECT_TYPES.find((p) => p.id === state.projectType) || PROJECT_TYPES[0];\n      const tl = TIMELINES.find((t) => t.id === state.timeline) || TIMELINES[1];\n      const est = calcEstimate();\n      els.kbdHint.innerHTML = state.submitted ? \"Brief received &middot; Thank you!\" : \"Review details or jump back to edit any step\";\n      els.btnNext.textContent = state.submitted ? \"Start New Brief\" : \"Submit Brief ✓\";\n      els.host.innerHTML = `\n        ${state.submitted ? `<div class=\"submitted-badge\">&#10003; Brief sent to Atelier North</div>` : `<div class=\"q-kicker\">Live Summary Receipt</div>`}\n        <h1 class=\"q-title\">${state.submitted ? \"We have your brief, \" + state.name.split(\" \")[0] + \".\" : \"Ready to lock in your scope?\"}</h1>\n        <p class=\"q-subtitle\">${state.submitted ? \"A copy of this estimate has been queued for \" + state.email + \".\" : \"Everything below updates dynamically from your answers.\"}</p>\n        <div class=\"receipt-card\">\n          <div class=\"receipt-row\">\n            <span class=\"receipt-label\">Project Track <button class=\"edit-link\" data-jump=\"0\" type=\"button\">Edit</button></span>\n            <span class=\"receipt-val\">${pt.title}</span>\n          </div>\n          <div class=\"receipt-row\">\n            <span class=\"receipt-label\">Timeline <button class=\"edit-link\" data-jump=\"1\" type=\"button\">Edit</button></span>\n            <span class=\"receipt-val\">${tl.title}</span>\n          </div>\n          <div class=\"receipt-row\">\n            <span class=\"receipt-label\">Deliverables <button class=\"edit-link\" data-jump=\"2\" type=\"button\">Edit</button></span>\n            <span class=\"receipt-val\">${Array.from(state.scopes).join(\", \")}</span>\n          </div>\n          <div class=\"receipt-row\">\n            <span class=\"receipt-label\">Target Budget <button class=\"edit-link\" data-jump=\"3\" type=\"button\">Edit</button></span>\n            <span class=\"receipt-val\">$${state.budget.toLocaleString(\"en-US\")} (${budgetTier(state.budget)})</span>\n          </div>\n          <div class=\"receipt-row\">\n            <span class=\"receipt-label\">Contact <button class=\"edit-link\" data-jump=\"4\" type=\"button\">Edit</button></span>\n            <span class=\"receipt-val\">${state.name}${state.company ? \" · \" + state.company : \"\"}<br><span style=\"color:var(--muted);font-weight:500\">${state.email}</span></span>\n          </div>\n          <div class=\"estimate-box\">\n            <div>\n              <div style=\"font-size:0.78rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:0.04em\">Estimated Studio Range</div>\n              <div style=\"font-size:0.8rem;color:var(--muted)\">Based on selected scope &amp; pacing</div>\n            </div>\n            <strong>$${est.low.toLocaleString(\"en-US\")} – $${est.high.toLocaleString(\"en-US\")}</strong>\n          </div>\n        </div>\n      `;\n    }\n  }\n\n  function advance() {\n    if (state.step === 5) {\n      if (state.submitted) {\n        state.step = 0;\n        state.submitted = false;\n        state.projectType = null;\n        state.timeline = null;\n        render();\n      } else {\n        state.submitted = true;\n        render();\n      }\n      return;\n    }\n    if (!validateStep()) {\n      render();\n      return;\n    }\n    state.step += 1;\n    render();\n  }\n\n  els.btnNext.addEventListener(\"click\", advance);\n  els.btnBack.addEventListener(\"click\", () => {\n    if (state.step > 0) {\n      state.error = \"\";\n      state.submitted = false;\n      state.step -= 1;\n      render();\n    }\n  });\n\n  els.host.addEventListener(\"click\", (e) => {\n    const typeBtn = e.target.closest(\"[data-type]\");\n    if (typeBtn) {\n      state.projectType = typeBtn.dataset.type;\n      state.error = \"\";\n      render();\n      setTimeout(() => { if (state.step === 0) { state.step = 1; render(); } }, 220);\n      return;\n    }\n    const timeBtn = e.target.closest(\"[data-time]\");\n    if (timeBtn) {\n      state.timeline = timeBtn.dataset.time;\n      state.error = \"\";\n      render();\n      setTimeout(() => { if (state.step === 1) { state.step = 2; render(); } }, 220);\n      return;\n    }\n    const scopeBtn = e.target.closest(\"[data-scope]\");\n    if (scopeBtn) {\n      const lbl = scopeBtn.dataset.scope;\n      if (state.scopes.has(lbl)) state.scopes.delete(lbl);\n      else state.scopes.add(lbl);\n      state.error = \"\";\n      render();\n      return;\n    }\n    const jumpBtn = e.target.closest(\"[data-jump]\");\n    if (jumpBtn) {\n      state.submitted = false;\n      state.step = Number(jumpBtn.dataset.jump);\n      render();\n    }\n  });\n\n  els.host.addEventListener(\"input\", (e) => {\n    if (e.target.id === \"budgetSlider\") {\n      state.budget = Number(e.target.value);\n      document.getElementById(\"budgetVal\").textContent = \"$\" + state.budget.toLocaleString(\"en-US\");\n      document.getElementById(\"budgetTier\").textContent = budgetTier(state.budget);\n    } else if (e.target.id === \"inpName\") {\n      state.name = e.target.value;\n    } else if (e.target.id === \"inpEmail\") {\n      state.email = e.target.value;\n    } else if (e.target.id === \"inpCompany\") {\n      state.company = e.target.value;\n    }\n  });\n\n  document.addEventListener(\"keydown\", (e) => {\n    const tag = document.activeElement && document.activeElement.tagName;\n    const inText = tag === \"INPUT\" && document.activeElement.type !== \"range\";\n\n    if (e.key === \"Enter\") {\n      e.preventDefault();\n      advance();\n      return;\n    }\n    if (inText) return;\n\n    const k = e.key.toUpperCase();\n    if (state.step === 0) {\n      const match = PROJECT_TYPES.find((p) => p.key === k);\n      if (match) { state.projectType = match.id; state.error = \"\"; render(); }\n    } else if (state.step === 1) {\n      const match = TIMELINES.find((t) => t.key === k);\n      if (match) { state.timeline = match.id; state.error = \"\"; render(); }\n    } else if (state.step === 2) {\n      const match = SCOPES.find((s) => s.key === k);\n      if (match) {\n        if (state.scopes.has(match.label)) state.scopes.delete(match.label);\n        else state.scopes.add(match.label);\n        state.error = \"\";\n        render();\n      }\n    }\n  });\n\n  render();\n})();\n</script>\n</body>\n</html>\n"
}
