Mortgage Affordability Calculator
Use this calculator to estimate how much you can borrow for a mortgage based on your income, debts, and desired monthly payment.
" +
"Estimated Maximum Loan Amount: " + formattedMaxLoan + "" +
"Estimated Maximum Home Price (including down payment): " + formattedMaxHomePrice + "" +
"Estimated Maximum Monthly Housing Payment (Principal & Interest): " + formattedMaxHousingPayment + "" +
"Note: This calculation is an estimate and does not include property taxes, homeowner's insurance, or private mortgage insurance (PMI), which will increase your total monthly housing cost." +
"
";
}
.calculator-container {
font-family: sans-serif;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
max-width: 600px;
margin: 20px auto;
background-color: #f9f9f9;
}
.calculator-container h2 {
text-align: center;
margin-bottom: 15px;
color: #333;
}
.calculator-container p {
text-align: center;
margin-bottom: 25px;
color: #555;
font-size: 0.95em;
}
.calculator-inputs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 15px;
margin-bottom: 20px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group label {
margin-bottom: 5px;
font-weight: bold;
color: #444;
}
.form-group input[type="number"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1em;
width: calc(100% – 22px); /* Adjust for padding and border */
}
.calculator-container button {
display: block;
width: 100%;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
font-size: 1.1em;
cursor: pointer;
transition: background-color 0.3s ease;
margin-top: 10px;
}
.calculator-container button:hover {
background-color: #0056b3;
}
.calculator-result {
margin-top: 30px;
padding: 15px;
border: 1px dashed #ccc;
border-radius: 5px;
background-color: #fff;
text-align: center;
}
.calculator-result p {
margin-bottom: 10px;
color: #333;
font-size: 1em;
}
.calculator-result p strong {
color: #007bff;
}
.calculator-result small {
font-size: 0.8em;
color: #777;
display: block;
margin-top: 15px;
}