/* Center the form container and set a maximum width for responsiveness */
.loan-form-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.loan-form {
    width: 90%;
    max-width: 600px; /* Limits form width on larger screens */
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.loan-form fieldset {
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    margin-left: 15px;
    margin-right: 15px;
}

.loan-form legend {
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0 10px;
}

.loan-form table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

/* Alignment and spacing for table columns */
.loan-form .right-align {
    text-align: right;
    padding-right: 10px;
}

.loan-form .left-align {
    text-align: left;
    padding-left: 10px;
}

/* Input, select, and textarea styling for consistency */
.loan-form input[type="number"],
.loan-form select {
    /* width: 100%; */
    width: 70%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

/* Submit and Cancel buttons styling */
.loan-form input[type="submit"] {
    width: 48%;
    padding: 10px;
    margin-top: 10px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Styling for Cancel button */
.loan-form input[name="submitCancel"] {
    background-color: #f44336;
    color: #fff;
}

/* Styling for Calculate button */
.loan-form input[name="submit"] {
    background-color: #4CAF50;
    color: #fff;
}

.loan-details-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.loan-details-container h3 {
    text-align: center;
}

.loan-details-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.loan-details-label {
    font-weight: bold;
}

.loan-details-value {
    text-align: right;
}

.form-group {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

label {
    text-align: right;
    padding-right: 10px;
}
h3 {
    color: red;
    text-align: center;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .loan-form-container {
        padding: 15px;
    }

    .loan-form {
        padding: 15px;
    }

    .loan-form fieldset {
        padding: 10px;
        margin-left: 10px;
        margin-right: 10px;
    }
    .loan-form input[type="number"],
    .loan-form select {
        width: 60%;
    }
}

@media (max-width: 600px) {
    .loan-form {
        padding: 10px;
    }

    .loan-form input[type="submit"] {
        width: 100%;
        margin-top: 10px;
    }

    .loan-details-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .loan-details-label,
    .loan-details-value {
        width: 100%;
        text-align: left;
        margin: 2px 0;
        padding: 2px;
    }
    .loan-form fieldset {
        padding: 10px;
        margin-left: 10px;
        margin-right: 10px;
    }
    .loan-form input[type="number"],
    .loan-form select {
        width: 60%;
    }
}
