.loan-calculator {
    max-width: 675px;
    margin: 0 auto;
    padding: 32px 44px;
    background: #ffffff;
    border-radius: 20px;
}

.calculator-field {
    margin-bottom: 13px;
}

.calculator-field label {
    display: block;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
    color: #0B2D1E;
    font-family: "Figtree", sans-serif;
}

.field-controls {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0px;
}

.loan-calculator .box-wrapper {
    border-radius: 20px;
    background-color: #F8F9F8;
    padding: 27px 32px;
    margin-top: 21px;
}

.amount-slider,
.months-slider {
    flex: 1;
    height: 6px;
    background: #E6E6E6;
    outline: none;
    border-radius: 50px;
    -webkit-appearance: none;
    max-width: 396px;
}

.amount-slider::-webkit-slider-thumb,
.months-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2c5f2d;
    border-radius: 50%;
    cursor: pointer;
}

.amount-slider::-moz-range-thumb,
.months-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2c5f2d;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.input-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border-radius: 8px;
    max-width: 130px;
    border: 1px solid #E6E6E6;
    height: 50px;
    line-height: 50px;
    margin-top: -9px;
}

.currency-prefix,
.unit-suffix {
    font-size: 12px;
    color: #0B2D1E;
    font-weight: 500;
}

.amount-input,
.months-input {
    width: 80px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    color: #0B2D1E;
    outline: none;
    font-family: "Figtree", sans-serif;
}

.amount-input::-webkit-inner-spin-button,
.amount-input::-webkit-outer-spin-button,
.months-input::-webkit-inner-spin-button,
.months-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #0B2D1E;
    max-width: 396px;
    margin-top: -21px;
}

.monthly-payment {
    color: #0B2D1E;
    text-align: center;
    margin-bottom: 23px;
}

.monthly-payment label {
    display: block;
    font-size: 16px;
    margin-bottom: 10px;
}

.payment-amount {
    font-size: 28px;
    line-height: 18px;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.payment-amount .currency {
    font-size: 28px;
}

.calculator-button {
    display: block;
    width: 100%;
    padding: 16px;
    background: #0B2D1E;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.calculator-button:hover {
    background: #97F46D;
    color: #0B2D1E;
}

.schedule-link,
.link {
    display: block;
    text-align: center;
    margin-top: 29px;
    color: #0B2D1E;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

.schedule-link:hover,
.link:hover {
    color: #97F46D;
}

.link {
    margin-top: 8px;
}

.schedule-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.popup-close:hover {
    color: #333;
}

.popup-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.popup-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5f2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.schedule-table-wrapper {
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.schedule-table thead th {
    background: #2c5f2d;
    color: #ffffff;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.schedule-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.schedule-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.schedule-table tbody tr:hover {
    background: #f0f0f0;
}

.schedule-error {
    text-align: center;
    padding: 40px;
    color: #d32f2f;
    font-size: 16px;
}

.active-modal {
    position: fixed;
    width: 100%;
}

.active-modal .header {
    z-index: 1;
}

@media (max-width: 768px) {
    .loan-calculator {
        padding: 20px;
    }
    
    .input-wrapper {
        justify-content: center;
    }
    
    .payment-amount {
        font-size: 28px;
    }
    
    .popup-content {
        width: 95%;
        padding: 20px;
    }
    
    .schedule-table {
        font-size: 12px;
    }
    
    .schedule-table thead th,
    .schedule-table tbody td {
        padding: 8px 4px;
    }
}

@media only screen and (max-width: 1390px) {
    .amount-slider, 
    .months-slider,
    .range-labels {
        max-width: 220px;
    }
}

@media only screen and (max-width: 991px) {
    .amount-input, 
    .months-input {
        font-size: 14px;
    }

    .currency-prefix, .unit-suffix {
        font-size: 10px;
    }

    .input-wrapper {
        max-width: 35%;
    }

    
    .amount-slider, 
    .months-slider, 
    .range-labels {
        max-width: 60%;
    }

    .range-labels {
        font-size: 11px;
    }
}