.popup__bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    opacity: 0;
/*// Скрываем фон и сам попап*/
    pointer-events: none;
/*// Запрещаем ему быть целью событий*/
    transition: 0.5s all;
    z-index: 2;
}

.popup__bg.active {
/*// При добавлении класса 'active'*/
    opacity: 1;
/*// Показываем фон и попап*/
    pointer-events: all;
/*// Возвращаем события*/
    transition: 0.5s all;
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
/*// Центрируем и масштабируем в 0 само окно*/
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 25px;
    box-sizing: border-box;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    overflow: hidden;
    transition: 0.5s all;
}

.popup.send-mail:after {
    content:'Ваша заявка принята. Ждите звонок менеджера.';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 100px;
    border-radius: 20px;
    background-color: #fff;
    z-index: 1;
    box-sizing: border-box;
}

.popup.active {
    transform: translate(-50%, -50%) scale(1);
    transition: 0.5s all;
}
/* Конец важной части */
/* Далее код для стилизации формы */
.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.close-popup:after,
.close-popup:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 2px;
    background-color: #333;
}

.close-popup:after {
    transform: translate(-50%, -50%) rotate(45deg);
}
.close-popup:before {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.popup label {
    display: flex;
    justify-content: center;
}

.popup__input-container {
    display: flex;
    justify-content: center;
}

.input-code {
    padding: 5px;
    font-family: inherit;
    text-align: center;
    background-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    -moz-appearance: textfield;
    box-sizing: border-box;
    height: 2em;
    width: 1.7em;
    border: 1px solid #ccc;
    border-radius: 10px;
    margin: 0 5px;
    color: #111;
    font-size: 24px;
    caret-color: transparent;
    outline: none;
    box-shadow: inset 0 0 0 0 transparent;
    transition: 0.15s ease-in-out;
    perspective-origin: center;
    transform-style: preserve-3d;
    transform: perspective(500px) rotateX(0) rotateY(0);
}
.popup .input-code:focus {
     box-shadow: inset 0 0 0 3px #0be33a;
    color: #0be33a;
 }

.popup .input-code::selection {
     color: #0be33a;
 }

.popup .input-code::-moz-selection {
    color: #0be33a;
 }

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

.popup__title {
    width: 100%;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.2em;
}


.popup .display-none {
    display: none;
}

.input-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ddd;
    z-index: -1;
}

.popup__error {
    min-height: 16px;
    color: #f00;
    font-size: 14px;
    line-height: 1em;
}

.cross-error {
    position: relative;
    top: 2px;
    margin-right: 5px;
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: red;

}

.cross-error:after,
.cross-error:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 2px;
    background-color: #fff;
}

.cross-error:after {
    transform: translate(-50%, -50%) rotate(45deg);
}
.cross-error:before {
    transform: translate(-50%, -50%) rotate(-45deg);
}


.popup .send-code {
    margin-bottom: 0;
}

.popup .get-code {
    width: max-content;
    height: auto;
    padding: 3px;
    border: 1px solid transparent;
    background-color: transparent;
    font-weight: 300;
    color: #333;
    font-size: 12px;
    line-height: 1em;
    margin-bottom: 0;
    text-transform: none;
    text-shadow: none;
}

.get-code:disabled {
    opacity: .6;

}

.popup__get-code-descr {
    min-height: 1em;
    font-size: 12px;
    line-height: 1em;
    color: #3b3b79;
    text-transform: none;
    text-shadow: none;
}

@media screen and (max-width: 800px) {
    .popup {
        width: 300px;
    }
    .popup.send-mail:after {
        padding: 0 50px;
    }
}

@media screen and (min-width: 800px) {
    .popup {
        width: 400px;
    }
}