.input {
    color: var(--Base-Dark, #171717);
    font-family: inherit;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    letter-spacing: 0.16px;
    background-color: #ffffff;
    border: 1px solid var(--Gray-4, #D1D1D2);
    border-radius: 8px;
    min-height: 48px;
    max-width: 100%;
    padding: 6px 12px;
    transition: all .3s ease;    

    &.input-filter {
        min-height: 44px;
        width: 100%;
    }

    &:hover {
        border-color: var(--Gray-5, #bdbdc2);
    }

    &:focus {
        border-color: var(--Gray-7, #7A7A85);
    }

    &:disabled {
        border: 1px solid var(--Gray-3, #E5E5E6);
        background-color: var(--Gray-1, #FAFAFA);
        color: var(--Gray-5, #BDBDC2);
    }
}

input {
    &::placeholder {
        color: var(--Gray-6, #9A9AA2);
        font-family: inherit;
        font-style: normal;
        font-weight: 400;
        line-height: 140%;
        letter-spacing: 0.48px;
    }

}

.form__error {
    color: var(--Dark-wine-1, #92111C);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    letter-spacing: 0.14px;
    margin-top: 8px;
}

.radio__label {
    display: flex;
    column-gap: 10px;
    cursor: pointer;    

    input[type="radio"] {
        display: none;
    }
    
    .radio__label-box {
        display: inline-flex;
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        border: 1px solid var(--Gray-7, #7A7A85);
        margin-top: 1px;

        &::before {
            content: "";
            background-color: var(--Dark-wine-2, #770E16);
            width: calc(100% - 6px);
            height: calc(100% - 6px);
            border-radius: 50%;
            margin-top: 3px;
            margin-left: 3px;
            opacity: 0;
            transition: opacity .3s ease;
        }
    }

    input[type="radio"]:checked + .radio__label-box {

        &::before {
            opacity: 1;
        }
    }
}


.checkbox__label {
    display: flex;
    column-gap: 10px;
    cursor: pointer;    

    input[type="checkbox"] {
        display: none;
    }
    
    .checkbox__label-box {
        display: inline-flex;
        position: relative;
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        border-radius: 4px;
        border: 1px solid var(--Gray-7, #7A7A85);
        margin-top: 2px;
        
        &::before {
            content: "";
            background-image: url('../../icons/checkbox.svg');
            background-position: center;
            background-repeat: no-repeat;
            background-size: 10px;
            position: absolute;
            width: 100%;
            height: 100%;
            opacity: 0;
            transition: opacity .3s ease;
        }
    }

    .checkbox__label-name {
        color: var(--Base-Dark, #171717);
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
        line-height: 140%;
        letter-spacing: 0.16px;
    }

    &.form__field-required {
        .checkbox__label-name:after {
            content: "*";
            color: var(--Light-Red, #B71522);
            margin-left: 2px;
        }
    }
    input[type="checkbox"]:checked + .checkbox__label-box {

        &::before {
            opacity: 1;
        }
    }
}

.form__group {
    margin-top: 56px;
    margin-bottom: 56px;

    .form__group-title {
        color: var(--Base-Dark, #171717);
        font-size: 20px;
        font-style: normal;
        font-weight: 500;
        line-height: 150%;
        letter-spacing: 0.2px;
        margin-bottom: 32px;
    }
}

.form__data {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;

    .form__field {
        &.form__element-half {
            flex: 1 0 calc(50% - 16px);
        }

        &.form__element-full {
            flex: 1 0 100%;
        }

        .input__label {
            display: flex;
            flex-direction: column;
            width: 100%;

            .form__field-name {
                color: var(--Base-Dark, #202020);
                font-size: 14px;
                font-style: normal;
                font-weight: 400;
                line-height: 150%;
                letter-spacing: 0.14px;
                margin-bottom: 8px;
            }

            &.input__code {
                flex-direction: unset;
                flex-wrap: wrap;
                column-gap: 12px;

                .form__field-name {
                    flex: 1 0 100%;
                }

                .input {
                    width: 48px;
                    text-align: center;
                }
            }

            &.input__label-error {
                input, select {
                    border-color: var(--Dark-wine-1, #92111C);
                    background-color: #FFEFF0;
                }
            }
        }

        &.form__field-required {
            .form__field-name:after {
                content: "*";
                color: var(--Light-Red, #B71522);
                margin-left: 2px;
            }
        }
    }

    .form__options {
        &.form__element-half {
            flex: 1 0 calc(50% - 16px);
        }

        &.form__element-full {
            flex: 1 0 100%;
        }

        &.form__options-horizontal {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
        }

        &.form__options-vertical {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
    }
}

.form__description {
    color: var(--Base-Dark, #171717);
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    letter-spacing: 0.2px;
}

.form__notice {
    color: var(--Gray-7, #7A7A85);
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    letter-spacing: 0.16px;
    margin-top: 8px;
}

.form__content {
    margin-bottom: 32px;
}

.form__section {
    &:not(:last-child) {
        border-bottom: solid 1px var(--Gray-4, #D1D1D2);
        padding-bottom: 24px;
        margin-bottom: 24px;
    }
}

.form__buttons {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    margin-top: 40px;
    
    
    
    
    
    
    
    

    .button {
        width: 100%;
    }
}

.visual__validator {
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 2px 4px 18px 0 rgba(122, 122, 133, 0.10);
    display: grid;
    max-width: 520px;
    padding: 16px 24px;
    grid-template-columns: auto 1fr;
    justify-content: flex-start;
    gap: 8px 16px;
    margin-top: 16px;
    position: relative;
    

    &::before {
        content: "";
        position: absolute;
        display: block;
        width: 15px;
        height: 15px;
        background-color: #ffffff;
        top: -7px;
        left: 30px;
        transform: rotate(45deg);
    }

    .validator__item {
        color: var(--Gray-6, #9A9AA2);
        font-size: 12px;
        font-style: normal;
        font-weight: 400;
        line-height: 100%;
        letter-spacing: 0.24px;
        display: flex;
        align-items: center;
        column-gap: 4px;

        &::before {
            content: "";
            background-image: url('../../icons/visual-validator--no.svg');
            display: inline-flex;
            width: 14px;
            height: 14px;
            background-position: center;
            background-repeat: no-repeat;
            background-size: contain;
        }

        &.validator__item_valid {
            color: var(--Green-1, #0CCC4C);
            &::before {
                content: "";
                background-image: url('../../icons/visual-validator--yes.svg');
            }
        }
    }

    .validator__security {
        color: var(--Gray-6, #9A9AA2);
        font-size: 12px;
        font-style: normal;
        font-weight: 400;
        line-height: 100%;
        letter-spacing: 0.24px;
        grid-column: 1/3;
        margin-top: 8px;

        .validator__security-value {
            transition: color .3s ease;

            &[data-score="low"] {
                color: var(--Light-Red, #B71522);
            }

            &[data-score="medium"] {
                color: var(--Orange-1, #cc8f0c);
            }

            &[data-score="high"] {
                color: var(--Green-1, #0CCC4C);
            }
        }
    }

    .validator__progress {
        grid-column: 1 / 3;
        height: 4px;
        border-radius: 12px;
        background-color: var(--Gray-2, #F2F2F2);
        position: relative;
        overflow: hidden;
        margin-top: 4px;        

        &[data-score="low"] {
            --color: var(--Light-Red, #B71522);
        }

        &[data-score="medium"] {
            --color: var(--Orange-1, #cc8f0c);
        }

        &[data-score="high"] {
            --color: var(--Green-1, #0CCC4C);
        }

        &::before {
            content: "";
            display: block;
            width: var(--percent);
            background-color: var(--color);
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            transition: width .3s ease, background-color .3s ease;
        }
    }
}

@media (max-width: 992px) {
    .form__group {
        margin-top:40px;
        margin-bottom:40px;

        .form__group-title {
            margin-bottom:24px;
        }

        &:first-child {
             margin-top:32px;
         }

        .form__data {
            .form__options {
                gap: 32px;
                margin-bottom:20px;

                .radio__label {
                    gap:8px;
                }
                &.form__options-vertical {
                     margin-top:20px;
                     gap:8px;
                 }
                &:last-child {
                     margin-bottom:0;
                 }

            }
            .form__field {
                input {
                    width:100%;
                }
                &.form__element-half {
                     flex:none;
                     width:100%;
                 }
                input::placeholder {
                    color: var(--Gray-6, #9A9AA2);
                }
            }
        }
    }

    .visual__validator {
        display:block;
        max-width:310px;

        .validator__item {
            margin-bottom:8px;
        }
        .validator__security {
            margin-top:16px;
            margin-bottom:12px;
        }
    }
}