/* =========================================================
   LOAN CALCULATOR
   ========================================================= */

.loan-home-section {
    padding: 55px 0 65px;
 
}


/* =========================================================
   HEADING
   ========================================================= */

.loan-home-heading {
    margin-bottom: 28px;
}

.loan-home-heading .section-title {
    margin-bottom: 8px;
}

.loan-home-heading p {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}


/* =========================================================
   CALCULATOR
   ========================================================= */

.loan-home-calculator {
    display: grid;
    grid-template-columns: 1.2fr .8fr;

    background: #fff;

    border: 1px solid #e2e5e9;
    border-radius: 6px;

    overflow: hidden;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .06);
}


/* =========================================================
   LEFT SIDE
   ========================================================= */

.loan-home-left {
    padding: 38px 40px;
}

.loan-field {
    margin-bottom: 34px;
}

.loan-field:last-of-type {
    margin-bottom: 28px;
}

.loan-field label {
    display: block;

    margin-bottom: 12px;

    color: #333;

    font-size: 15px;
    font-weight: 700;
}


/* =========================================================
   AMOUNT INPUT
   ========================================================= */

.loan-amount-wrap {
    display: flex;
    align-items: center;

    width: 100%;
    height: 58px;

    padding: 0 17px;

    margin-bottom: 12px;

    background: #fff;

    border: 1px solid #d7dce2;
    border-radius: 5px;

    box-sizing: border-box;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.loan-amount-wrap:focus-within {
    border-color: #2167b2;

    box-shadow:
        0 0 0 3px rgba(33, 103, 178, .08);
}

.loan-amount-wrap input {
    display: block;

    width: 100%;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    outline: 0 !important;

    background: transparent !important;

    box-shadow: none !important;

    color: #333;

    font-family: inherit;
    font-size: 22px;
    font-weight: 600;

    line-height: 1;
}

.loan-amount-wrap input:focus {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.loan-amount-wrap span {
    flex-shrink: 0;

    margin-left: 15px;

    color: #777;

    font-size: 13px;
    font-weight: 400;

    white-space: nowrap;
}


/* =========================================================
   RANGE
   ========================================================= */

/*
 * ВАЖНО:
 * Сам input имеет высоту 48px.
 * Поэтому на телефоне пользователю не нужно попадать
 * пальцем точно в тонкую линию.
 *
 * При этом визуальная дорожка имеет высоту только 8px.
 */

#loanAmountRange {
    -webkit-appearance: none;
    appearance: none;

    display: block;

    width: 100%;
    height: 48px;

    margin: 0;
    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    cursor: pointer;

    box-sizing: border-box;

    /*
     * Вертикальный скролл страницы остаётся возможным.
     * Горизонтальное движение используется ползунком.
     */
    touch-action: pan-y;
}


/* ---------------------------------------------------------
   Chrome / Edge / Safari
   --------------------------------------------------------- */

#loanAmountRange::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    appearance: none;

    width: 100%;
    height: 8px;

    border: 0;
    border-radius: 20px;

    background:
        linear-gradient(
            to right,
            #2167b2 0%,
            #2167b2 var(--range-progress, 0%),
            #d8dde3 var(--range-progress, 0%),
            #d8dde3 100%
        );

    cursor: pointer;
}


#loanAmountRange::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 28px;
    height: 28px;

    /*
     * 28px бегунок относительно 8px дорожки.
     */
    margin-top: -10px;

    border: 4px solid #fff;
    border-radius: 50%;

    background: #2167b2;

    box-shadow:
        0 0 0 2px #2167b2,
        0 3px 8px rgba(0, 0, 0, .20);

    cursor: grab;
}


#loanAmountRange::-webkit-slider-thumb:active {
    cursor: grabbing;
}


/* ---------------------------------------------------------
   Firefox
   --------------------------------------------------------- */

#loanAmountRange::-moz-range-track {
    width: 100%;
    height: 8px;

    border: 0;
    border-radius: 20px;

    background: #d8dde3;

    cursor: pointer;
}


#loanAmountRange::-moz-range-progress {
    height: 8px;

    border-radius: 20px;

    background: #2167b2;
}


#loanAmountRange::-moz-range-thumb {
    width: 20px;
    height: 20px;

    border: 4px solid #fff;
    border-radius: 50%;

    background: #2167b2;

    box-shadow:
        0 0 0 2px #2167b2,
        0 3px 8px rgba(0, 0, 0, .18);

    cursor: grab;
}


/* ---------------------------------------------------------
   FOCUS
   --------------------------------------------------------- */

#loanAmountRange:focus {
    outline: none;
}

#loanAmountRange:focus-visible::-webkit-slider-thumb {
    box-shadow:
        0 0 0 2px #2167b2,
        0 0 0 6px rgba(33, 103, 178, .15);
}


/* =========================================================
   RANGE MIN / MAX
   ========================================================= */

.loan-range-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: -4px;

    color: #7a8492;

    font-size: 12px;
    line-height: 1.4;
}

.loan-range-labels span:last-child {
    text-align: right;
}


/* =========================================================
   TERM BUTTONS
   ========================================================= */

.loan-term-buttons {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 10px;
}

.loan-term {
    min-height: 52px;

    padding: 13px 10px;

    border: 1px solid #d7dce2;
    border-radius: 5px;

    background: #fff;

    color: #333;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        color .15s ease;
}

.loan-term:hover {
    border-color: #2167b2;
    color: #2167b2;
}

.loan-term.active {
    border-color: #2167b2;

    background: #2167b2;

    color: #fff;
}

.loan-term.active:hover {
    color: #fff;
}


/* =========================================================
   PAYMENT INFORMATION
   ========================================================= */

.loan-interest-info {
    position: relative;

    padding: 16px 18px 16px 47px;

    border-left: 3px solid #2167b2;
    border-radius: 3px;

    background: #edf4fb;

    color: #39516e;

    font-size: 14px;
    line-height: 1.55;
}

.loan-interest-info::before {
    content: "i";

    position: absolute;

    top: 17px;
    left: 17px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 19px;
    height: 19px;

    border-radius: 50%;

    background: #2167b2;

    color: #fff;

    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   RIGHT RESULT
   ========================================================= */

.loan-home-result {
    padding: 38px 35px;

    background: #2167b2;

    color: #fff;
}

.loan-result-label {
    margin-bottom: 8px;

    color: rgba(255, 255, 255, .78);

    font-size: 14px;
    line-height: 1.4;
}


/* =========================================================
   MAIN PAYMENT
   ========================================================= */

.loan-result-main {
    margin-bottom: 27px;

    color: #fff;

    font-size: 39px;
    font-weight: 700;

    line-height: 1.15;

    letter-spacing: -.5px;
}

.loan-result-main small {
    margin-left: 5px;

    font-size: 16px;
    font-weight: 600;

    letter-spacing: 0;
}


/* =========================================================
   RESULT ROWS
   ========================================================= */

.loan-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 0;

    border-top: 1px solid rgba(255, 255, 255, .20);
}

.loan-result-row span {
    color: rgba(255, 255, 255, .73);

    font-size: 13px;
    line-height: 1.4;
}

.loan-result-row strong {
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.4;

    text-align: right;

    white-space: nowrap;
}


/* =========================================================
   NOTES
   ========================================================= */

.loan-result-note {
    margin-top: 11px;

    color: rgba(255, 255, 255, .75);

    font-size: 11.5px;
    line-height: 1.5;
}

.loan-result-row + .loan-result-note {
    margin-top: 22px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .loan-home-calculator {
        grid-template-columns: 1fr .8fr;
    }

    .loan-home-left {
        padding: 32px 28px;
    }

    .loan-home-result {
        padding: 32px 28px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .loan-home-section {
        padding: 38px 0 45px;
    }


    /* -----------------------------------------------------
       Heading
       ----------------------------------------------------- */

    .loan-home-heading {
        margin-bottom: 22px;
    }

    .loan-home-heading p {
        font-size: 14px;
        line-height: 1.5;
    }


    /* -----------------------------------------------------
       Calculator
       ----------------------------------------------------- */

    .loan-home-calculator {
        display: block;

        border-radius: 5px;

        box-shadow:
            0 5px 18px rgba(0, 0, 0, .06);
    }


    /* -----------------------------------------------------
       Left
       ----------------------------------------------------- */

    .loan-home-left {
        padding: 25px 18px 28px;
    }

    .loan-field {
        margin-bottom: 27px;
    }

    .loan-field:last-of-type {
        margin-bottom: 25px;
    }

    .loan-field label {
        margin-bottom: 10px;

        font-size: 14px;
    }


    /* -----------------------------------------------------
       Amount
       ----------------------------------------------------- */

    .loan-amount-wrap {
        height: 55px;

        margin-bottom: 6px;

        padding: 0 14px;
    }

    .loan-amount-wrap input {
        font-size: 20px;
    }

    .loan-amount-wrap span {
        margin-left: 10px;

        font-size: 12px;
    }


    /* -----------------------------------------------------
       RANGE MOBILE

       Не уменьшаем высоту input!
       48px оставляем специально для пальца.
       ----------------------------------------------------- */

    #loanAmountRange {
        width: 100%;
        height: 48px;

        margin: 0;

        touch-action: pan-y;
    }

    #loanAmountRange::-webkit-slider-runnable-track {
        height: 8px;
    }

    #loanAmountRange::-webkit-slider-thumb {
        width: 30px;
        height: 30px;

        margin-top: -11px;

        border-width: 4px;
    }


    /* -----------------------------------------------------
       Range labels
       ----------------------------------------------------- */

    .loan-range-labels {
        margin-top: -5px;

        gap: 10px;

        font-size: 10px;
    }


    /* -----------------------------------------------------
       Terms
       ----------------------------------------------------- */

    .loan-term-buttons {
        gap: 6px;
    }

    .loan-term {
        min-height: 50px;

        padding: 10px 4px;

        font-size: 12px;

        /*
         * Убирает задержку некоторых мобильных
         * браузеров при нажатии.
         */
        touch-action: manipulation;
    }


    /* -----------------------------------------------------
       Information
       ----------------------------------------------------- */

    .loan-interest-info {
        padding:
            14px
            14px
            14px
            43px;

        font-size: 12.5px;
    }

    .loan-interest-info::before {
        top: 15px;
        left: 14px;
    }


    /* -----------------------------------------------------
       Result
       ----------------------------------------------------- */

    .loan-home-result {
        padding: 28px 20px 30px;
    }

    .loan-result-label {
        font-size: 13px;
    }

    .loan-result-main {
        margin-bottom: 23px;

        font-size: 34px;
    }

    .loan-result-main small {
        font-size: 14px;
    }


    /* -----------------------------------------------------
       Result rows
       ----------------------------------------------------- */

    .loan-result-row {
        padding: 13px 0;
    }

    .loan-result-row span {
        font-size: 12px;
    }

    .loan-result-row strong {
        font-size: 13px;
    }


    /* -----------------------------------------------------
       Notes
       ----------------------------------------------------- */

    .loan-result-note {
        font-size: 10.5px;
    }

}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 390px) {

    .loan-home-left {
        padding-left: 15px;
        padding-right: 15px;
    }

    .loan-home-result {
        padding-left: 17px;
        padding-right: 17px;
    }

    .loan-term {
        font-size: 11px;
    }

    .loan-result-main {
        font-size: 31px;
    }

    .loan-result-row {
        gap: 10px;
    }

    .loan-range-labels {
        gap: 8px;
    }

}
/* Убираем рамку вокруг всего range при клике */
#loanAmountRange,
#loanAmountRange:hover,
#loanAmountRange:focus,
#loanAmountRange:active,
#loanAmountRange:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Chrome / Safari / Edge */
#loanAmountRange::-webkit-slider-runnable-track {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Firefox */
#loanAmountRange::-moz-range-track {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}