<div style="max-width:450px;margin:auto;padding:20px;border:1px solid #ddd;border-radius:10px;">
  <h3>🎓 Dream Education Calculator</h3>
  
  <label>Current Cost of Education (₹):</label>
  <input type="number" id="eduCost" value="500000" style="width:100%;padding:8px;margin:5px 0;">
  
  <label>Years Left (until child starts education):</label>
  <input type="number" id="eduYears" value="10" style="width:100%;padding:8px;margin:5px 0;">
  
  <label>Expected Inflation Rate (% per year):</label>
  <input type="number" id="eduInflation" value="6" style="width:100%;padding:8px;margin:5px 0;">
  
  <label>Expected Investment Return (% per year):</label>
  <input type="number" id="eduReturn" value="12" style="width:100%;padding:8px;margin:5px 0;">
  
  <button onclick="calculateEducation()" 
          style="width:100%;padding:10px;background:#4CAF50;color:white;border:none;border-radius:5px;margin-top:10px;">
    Calculate
  </button>
  
  <div id="eduResult" style="margin-top:15px;color:green;font-weight:bold;"></div>
</div>

<script>
function calculateEducation() {
    let cost = parseFloat(document.getElementById("eduCost").value);
    let years = parseFloat(document.getElementById("eduYears").value);
    let infl = parseFloat(document.getElementById("eduInflation").value) / 100;
    let ret = parseFloat(document.getElementById("eduReturn").value) / 100 / 12;

    // Future cost after inflation
    let futureCost = cost * Math.pow(1 + infl, years);

    // SIP required to reach future cost
    let months = years * 12;
    let sip = futureCost * ret / ((Math.pow(1 + ret, months) - 1) * (1 + ret));

    document.getElementById("eduResult").innerHTML = 
        "Future Cost of Education: ₹ " + futureCost.toFixed(2).toLocaleString('en-IN') +
        "<br>Required Monthly SIP: ₹ " + sip.toFixed(2).toLocaleString('en-IN');
}
</script>
