Fantastic—your answers show you’re fully ready to start the 12-step vision programme. Check your inbox for next steps.
`, support: `You’re keen to begin but want some help. Look out for an email with a support-pack and onboarding call slots.
`, maybe: `We’ll send you our free masterclass replay so you can explore the method at your own pace.
`, not_ready: `No worries—feel free to browse our blog or follow us on social for helpful eye-care tips until you’re ready.
`, }; /*────────────────── CSS injection (once) ────────────────────────────────*/ const STYLE_ID = 'hvq-styles'; if (!document.getElementById(STYLE_ID)) { const style = document.createElement('style'); style.id = STYLE_ID; style.textContent = ` :root{ --quiz-overlay-bg:rgba(0,0,0,.6); --quiz-popup-bg:#fff; --quiz-popup-width:600px; --quiz-popup-padding:30px; --quiz-border-radius:10px; --quiz-question-color:#222; --quiz-btn-bg:#0e8c7f; --quiz-btn-text:#fff; --quiz-btn-close-bg:#aaa; } #quizOverlay{display:none;position:fixed;inset:0;background:var(--quiz-overlay-bg);z-index:9998} #quizPopup{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%); background:var(--quiz-popup-bg);padding:var(--quiz-popup-padding);max-width:var(--quiz-popup-width); width:95%;border-radius:var(--quiz-border-radius);box-shadow:0 10px 40px rgba(0,0,0,.3); font-family:Arial,sans-serif;z-index:9999} #quizContainer .quiz-step{margin-bottom:20px} #quizContainer .quiz-step h3{margin-bottom:12px;color:var(--quiz-question-color)} #quizContainer .quiz-step label{display:block;margin:8px 0;cursor:pointer} #quizContainer .quiz-step input[type=radio]{margin-right:8px} .quiz-nav{text-align:right;margin-top:12px} .quiz-nav button{background:var(--quiz-btn-bg);color:var(--quiz-btn-text); border:none;padding:10px 16px;margin-left:8px;border-radius:4px;cursor:pointer;font-size:1rem} .quiz-nav button#quizClose{background:var(--quiz-btn-close-bg)} .quiz-nav button:disabled{opacity:.5;cursor:not-allowed} #thankYouPanel{text-align:center} `; document.head.append(style); } /*────────────────── DOM scaffold ───────────────────────────────────────*/ const overlay = document.body.appendChild( Object.assign(document.createElement('div'), { id: 'quizOverlay' }), ); const popup = document.body.appendChild( Object.assign(document.createElement('div'), { id: 'quizPopup' }), ); const container = popup.appendChild( Object.assign(document.createElement('div'), { id: 'quizContainer' }), ); const nav = popup.appendChild( Object.assign(document.createElement('div'), { className: 'quiz-nav' }), ); const btn = (id, txt) => Object.assign(document.createElement('button'), { id, textContent: txt }); const backBtn = nav.appendChild(btn('quizBack', 'Back')); const nextBtn = nav.appendChild(btn('quizNext', 'Next')); const closeBtn = nav.appendChild(btn('quizClose', 'Close')); backBtn.disabled = nextBtn.disabled = true; /*────────────────── State ───────────────────────────────────────────────*/ let step = 0; let answers = []; let outcomeId = null; /*────────────────── Helpers ─────────────────────────────────────────────*/ function detailedJSON() { return JSON.stringify( answers.map(a => ({ id: a.questionId, question: QUESTIONS.find(q => q.id === a.questionId)?.text || '', answer: a.answer, })), ); } function mauticFormHTML() { return ` `; } /*────────────────── Render step ────────────────────────────────────────*/ function render() { if (step >= QUESTIONS.length) { outcomeId = determineOutcome(answers); container.innerHTML = `