body { font-family: sans-serif; padding: 20px; max-width: 100%; margin: auto; font-size: 1.2rem; line-height: 1.6; background-color: #f9f9f9; } h1 { font-size: 1.8rem; margin-bottom: 20px; } .question { display: none; margin-bottom: 30px; background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 0 10px rgba(0,0,0,0.05); } .question.active { display: block; } label { display: block; margin-top: 20px; font-weight: bold; } select, input[type="text"], input[type="number"] { width: 100%; padding: 14px; margin-top: 10px; font-size: 1.2rem; border-radius: 8px; border: 1px solid #ccc; } input[type="radio"], input[type="checkbox"] { transform: scale(1.4); margin-right: 12px; margin-top: 18px; } button { margin-top: 24px; padding: 16px 24px; font-size: 1.3rem; background-color: #007bff; color: white; border: none; border-radius: 10px; width: 100%; cursor: pointer; } button:hover { background-color: #0056b3; } .result { font-weight: bold; font-size: 1.4rem; margin-top: 30px; text-align: center; } a { color: #007bff; text-decoration: underline; } @media (max-width: 600px) { body { padding: 16px; } h1 { font-size: 1.6rem; } } What is your phone's operating system? Select OS iOS Android Other Next How many days will you be in Japan? Next What is your home country? Next Estimated data usage: Light Medium Heavy Next What will you use the eSIM for? (Select all that apply) Streaming Voice calling to local numbers Map navigation Social media Data connection sharing with family Get Recommendation const esimOptions = [ { name: "Ubigi", url: "https://www.ubigi.com", minDays: 3, maxDays: 30, usageLevel: "medium", matchTags: ["Streaming", "Map navigation", "Social media"] }, { name: "SakuraMobile", url: "https://www.sakuramobile.jp", minDays: 5, maxDays: 60, usageLevel: "heavy", matchTags: ["Streaming", "Data connection sharing with family"] }, { name: "Mobal Japan", url: "https://www.mobal.com/japan-esim/", minDays: 1, maxDays: 90, usageLevel: "light", matchTags: ["Voice calling to local numbers", "Map navigation", "Social media"] } ]; const fallbackESIM = { name: "Japan Travel eSIM by Airalo", url: "https://www.airalo.com/japan-esim" }; function handleNext(nextId, fieldId) { const input = document.getElementById(fieldId); const radios = document.getElementsByName(fieldId); let isValid = false; if (input) { isValid = input.value.trim() !== ""; } else if (radios.length) { isValid = Array.from(radios).some(r => r.checked); } if (isValid) { document.getElementById(`q${nextId - 1}`).classList.remove("active"); document.getElementById(`q${nextId}`).classList.add("active"); } else { alert("Please make a selection before proceeding."); } } function getSelectedDataUsage() { const radios = document.getElementsByName("data"); for (let r of radios) { if (r.checked) return r.value; } return null; } function getSelectedUsageOptions() { const checkboxes = document.getElementsByName("usage"); return Array.from(checkboxes).filter(cb => cb.checked).map(cb => cb.value); } function recommendESIM() { const days = parseInt(document.getElementById("days").value); const dataUsage = getSelectedDataUsage(); const usageOptions = getSelectedUsageOptions(); if (isNaN(days) || !dataUsage) { document.getElementById("result").innerText = "Missing input."; return; } const matched = esimOptions.find(option => { const withinDays = days >= option.minDays && days option.matchTags.includes(tag)); return withinDays && (dataMatch || tagMatch); }); const result = matched ? `✅ We recommend ${matched.name}.` : `⚠️ No perfect match found. Try ${fallbackESIM.name} instead.`; document.getElementById("q5").classList.remove("active"); document.getElementById("result").innerHTML = result; }