.loan-page-header {
    text-align: center;
    margin: 40px 20px 20px 20px;
}

.loan-page-title {
    font-weight: 500;
    color: #0F2BC9;
    font-size: 2.50rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.loan-page-subtitle {
    font-weight: 400;
    color: #666;
    max-width: 1000px;
    font-size: 1rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* Loan Calculator Section */
.loan-calculator {
    padding: 2rem 1rem;
}

.loan-card {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0ebff 100%);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
    flex-wrap: wrap;
    padding: 3rem;
}

.loan-left {
    flex: 1;
    min-width: 300px;
}

/* Updated Loan Right Section */
.loan-right {
    max-width: 1000px;
    margin: 2rem auto 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 2rem;
    gap: 2rem;
}

/* Result Box Styles */
.result-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0ebff 100%);
    border-radius: 15px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    width: 100%;
    max-height: 110px;
}

.result-box.main-result {
    max-width: 400px;
    margin: 0 auto;
}

.result-box .result-value {
    font-weight: 600;
    font-size: 1.8rem;
    color: #0a750ada;
    margin-bottom: 0.5rem;
}

.result-box .result-label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.loan-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    width: 100%;
}

.loan-summary .result-box {
    flex: 1;
    min-width: 180px;
    max-width: 200px;
    margin-top: 1.5rem;
}

.loan-left label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    margin-top: 15px;
}

.loan-left input,
.loan-left select {
    width: 80%;
    padding: 13px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Roboto Slab', serif;
    font-weight: 400;
    font-size: 1rem;
}

/* Custom select styles */
.custom-select {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin-bottom: 10px;
}

.select-selected {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 12px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.select-selected.active {
    border-color: #0F2BC9;
    box-shadow: 0 0 5px rgba(15, 43, 201, 0.3);
}

.select-selected .arrow {
    transition: transform 0.3s ease;
}

.select-selected.active .arrow {
    transform: rotate(180deg);
}

.select-items {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    font-family: 'Roboto Slab', serif;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.select-items div {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-items div:hover {
    background-color: #f0f4ff;
}

.input-suffix {
    position: relative;
    display: inline-block;
    width: 80%;
}

.input-suffix input {
    width: 100%;
    padding-right: 30px;
    box-sizing: border-box;
}

.input-suffix .suffix {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #555;
    font-weight: bold;
}

/* Original select styling fallback (if still used) */
.loan-left select#currency {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 500;
    font-family: 'Roboto Slab', serif;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.loan-left select#currency:hover {
    border-color: #0F2BC9;
}

.loan-left select#currency:focus {
    outline: none;
    border-color: #0F2BC9;
    box-shadow: 0 0 5px rgba(15, 43, 201, 0.3);
}

.loan-left .loan-term-radio {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    margin-top: 5px;
}

/* Custom Radio Buttons */
.loan-term-radio .container {
    display: inline-block;
    position: relative;
    padding-left: 25px;
    margin-right: 30px;
    margin-bottom: 4px;
    cursor: pointer;
    font-weight: 400;
    user-select: none;
}

.loan-term-radio .container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.loan-term-radio .checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 23px;
    width: 23px;
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.loan-term-radio .container input:checked~.checkmark {
    background-color: #0F2BC9;
}

.loan-term-radio .checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.loan-term-radio .container input:checked~.checkmark:after {
    display: block;
}

.loan-term-radio .container .checkmark:after {
    top: 4px;
    left: 4px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: white;
}

.loan-left .calculate-btn {
    margin-top: 20px;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #0F2BC9 0%, #667eea 100%);
    width: 80%;
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Roboto Slab', serif;
    transition: background 0.3s ease;
}

.loan-left .calculate-btn:hover {
    transform: translateY(1px);
}

.chart-container {
    width: 100%;
    max-width: 280px;
    margin: 70px auto 20px auto;
    flex: 1;
}

.chart-legend {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.chart-legend div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.dot-blue {
    background: #0F2BC9;
}

.dot-yellow {
    background: #FFD700;
}

.dot-pink {
    background: #FF69B4;
}

.chart-values {
    display: flex;
    justify-content: space-around;
    margin: -8px -18px 0 0;
    font-weight: 400;
}

.chart-values div {
    text-align: center;
    min-width: 60px;
}

.loan-left input[type=number]::-webkit-outer-spin-button,
.loan-left input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.loan-left input[type=number] {
    -moz-appearance: textfield;
}

@media (max-width: 900px) {
    .loan-card {
        flex-direction: column;
    }

    .divider {
        display: none;
    }
}


.formula-block {
    font-weight: bold;
    font-size: 1.1rem;
    background: #f0f4ff;
    width: auto;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}


/***** Media Query *****/
/***** Tablets in portrait & smaller laptops (≤991px) ******/
@media (max-width: 991px) {
    .loan-page-title {
        font-weight: 700;
        font-size: 2rem;
    }

    .loan-page-subtitle {
        font-size: 1.1rem;
        max-width: 850px;
    }

    .loan-calculator {
        padding: 2rem 3rem;
    }
}

/***** Standard tablets & landscape phones (≤768px) ******/
@media (max-width: 768px) {
    .loan-page-title {
        font-weight: 700;
        font-size: 1.9rem;
    }

    .loan-page-subtitle {
        font-size: 1rem;
        max-width: 850px;
    }

    .loan-calculator {
        padding: 2rem 7rem;
    }

    .loan-card {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .loan-left {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .loan-left input,
    .loan-left select {
        width: 100%;
        padding: 13px 12px;
        font-size: 1rem;
    }

    .custom-select {
        width: 100%;
        max-width: 400px;
    }

    .loan-left .calculate-btn {
        margin-top: 20px;
        padding: 1rem 3rem;
        width: 100%;
    }

    .chart-container {
        flex: 1 1 100%;
        max-width: 50%;
        margin: 20px 0;
    }

    .loan-right {
        max-width: 100%;
        padding: 1rem 1.5rem;
        gap: 1.5rem;
    }

    .loan-right .head-center h3 {
        font-size: 1.1rem;
    }

    .loan-right .head-center .result-value {
        font-size: 1.4rem;
    }

    .loan-summary {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .loan-summary div {
        min-width: 120px;
    }

    .loan-summary h5 {
        font-size: 1rem;
    }

    .loan-summary .result-value {
        font-size: 1.2rem;
    }

    .input-suffix {
        position: relative;
        display: inline-block;
        width: 100%;
    }
}

/***** Large smartphones & phablets (≤617px) ******/
@media (max-width: 617px) {
    .loan-page-title {
        font-weight: 700;
        font-size: 1.7rem;
    }

    .loan-page-subtitle {
        font-size: 0.85rem;
        max-width: 750px;
    }

    .loan-calculator {
        padding: 2rem 4rem;
    }

    .loan-card {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        max-width: 800px;
    }

    .loan-left {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .loan-left input,
    .loan-left select {
        width: 100%;
        padding: 13px 12px;
        font-size: 1rem;
    }

    .custom-select {
        width: 100%;
        max-width: 400px;
    }

    .loan-left .calculate-btn {
        margin-top: 20px;
        padding: 1rem 3rem;
        width: 100%;
    }

    .chart-container {
        flex: 1 1 100%;
        max-width: 60%;
        margin: 20px 0;
    }

}

/***** Small smartphones (≤450px) ******/
@media (max-width: 450px) {
    .loan-page-title {
        font-weight: 700;
        font-size: 1.5rem;
    }

    .loan-page-header {
    text-align: center;
    margin: 40px 10px 20px 10px;
}

    .loan-page-subtitle {
        font-size: 0.80rem;
        max-width: 750px;
    }

    .loan-calculator {
        padding: 1.3rem;
    }

    .loan-card {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        max-width: 800px;
        padding: 1.3rem;
    }

    .loan-left {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .loan-left input,
    .loan-left select {
        width: 100%;
        padding: 13px 12px;
        font-size: 0.9rem;
        font-weight: 400;
    }

    .custom-select {
        width: 100%;
        max-width: 400px;
    }

    .loan-left .calculate-btn {
        margin-top: 20px;
        padding: 1rem 3rem;
        width: 100%;
    }

    .chart-container {
        flex: 1 1 100%;
        max-width: 65%;
        margin: 20px 0;
    }

    .loan-right {
        padding: 0.8rem 1rem;
        gap: 1rem;
    }

    .loan-right .head-center h3 {
        font-size: 1rem;
    }

    .loan-right .head-center .result-value {
        font-size: 1.2rem;
    }

    .loan-summary {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }

    .loan-summary div {
        min-width: auto;
        width: 100%;
    }

    .loan-summary h5 {
        font-size: 0.95rem;
    }

    .loan-summary .result-value {
        font-size: 1.1rem;
    }

    .result-box .result-value {
        font-size: 1.5rem;
    }

    .result-box .result-label {
        font-size: 0.90rem;
    }
}

/***** Extra small phones & older devices (≤365px) ******/
@media (max-width: 365px) {
    .loan-calculator {
        padding: 0;
        margin: 0 0 0 5px;
        width: 95%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .loan-card {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        width: 96%;
        max-width: 96%;
        padding: 1rem;
        margin: 0 0 0 8px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .loan-left {
        flex: 1;
        width: 100%;
        max-width: 100%;
    }

    .chart-container {
        flex: 1;
        width: 70%;
        max-width: 100%;
    }

    .chart-container {
        margin: 0 0 20px 0;
        padding: 0;
    }

    .loan-left input,
    .loan-left select {
        width: 100%;
        padding: 12px 12px;
        font-size: 0.8rem;
    }

    .custom-select {
        width: 100%;
        max-width: 400px;
    }

    .select-selected {
        padding: 8px 12px;
    }

    .loan-left .calculate-btn {
        margin-top: 20px;
        padding: 1rem 3rem;
        width: 100%;
    }

    .loan-right {
        max-width: 95%;
        margin: 1.5rem auto 1.4rem auto;
        padding: 0.8rem 0.8rem;
        gap: 0.8rem;
    }

    .loan-right .head-center h3 {
        font-size: 0.95rem;
    }

    .loan-right .head-center .result-value {
        font-size: 1.1rem;
    }

    .loan-summary {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .loan-summary div {
        min-width: auto;
        width: 100%;
        text-align: center;
        gap: 0.3rem;
    }

    .loan-summary h5 {
        font-size: 0.85rem;
    }

    .loan-summary .result-value {
        font-size: 1rem;
    }

    .result-box .result-value {
        font-size: 1.3rem;
    }

    .result-box .result-label {
        font-size: 0.85rem;
    }
}