.modal {
    width: min(502px, 95vw);

    max-height: 661px;
    height: 661px;

    position: fixed;
    top: 50%;
    left: 50%;

    border-radius: 30px;

    transform: translate(-50%, 50%);
    opacity: 0;
    visibility: hidden;

    background-image: 
        linear-gradient(rgba(0, 0, 0, 0), rgb(0, 0, 0, 1)),
        url("../images/background-pattern-modal.acfdda23662a.webp"), 
        linear-gradient(to right, #5A2E73, #BD45A6);
    background-repeat: no-repeat;
    background-size: 100% 289px, auto 116%, 100%;
    background-position: 0 100%, right -294px top -72px, 0 0;
    background-blend-mode: normal, screen, normal;

    box-shadow: var(--ui-glass-shadow);

    z-index: 5;

    overflow: hidden;

    transition: transform .4s ease-out, opacity .3s ease-out, visibility .3s ease-out;
}

.modal:has(.login__wrapper:not([data-login])){
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0), rgb(0, 0, 0, 1)),
        url("../images/krissy_492_18+.2cfa4acc2ac2.png"),
        url("../images/background-pattern-modal.acfdda23662a.webp"),
        linear-gradient(to right, #5A2E73, #BD45A6);
    background-repeat: no-repeat;
    background-size: 100% 296px, 250px, 116%, 100%;
    background-position: 0 100%, 50% 32%, right -294px top -72px, 0 0;
    background-blend-mode: normal, normal, screen, normal;
}

@media screen and (max-width: 743px) {
    .modal:has(.login__wrapper:not([data-login])){
        background-size: 100% 296px, 200px, 116%, 100%;
        background-position: 0 100%, 50% 37%, right -294px top -72px, 0 0;
    }
}

.modal__blur {
    position: fixed;
    width: 100vw;
    height: calc(var(--vh) * 100);
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    visibility: hidden;

    top: 0;
    left: 0;
    z-index: 4;

    transition: backdrop-filter .3s ease-out, visibility .3s ease-out;
}

.modal__close-button {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    position: absolute;

    top: 0;
    right: 0;

    background: none;
    border: none;

    transition: background .3s ease-in;

    cursor: pointer;

    z-index: 7;
}

.modal__close-button:hover {
    background: #ffffff15;
}

.modal__heading {
    font-size: 3.6rem;
    font-weight: 600;
    line-height: 115%;
    color: var(--text-color);
    text-align: center;

    margin-top: calc(var(--vh) * 10);
    margin-bottom: calc(var(--vh) * 7);
}

.modal__form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;

    position: relative;
}

.modal__form-error-messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    position: absolute;
    bottom: calc(100% + 4px);

    font-size: 1.4rem;
    
    color: #ffffff;

    text-align: center;
}

.modal__input-wrapper {
    position: relative;
    width: 100%; /* Адаптивы */
}

.modal__input-error-messages {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    position: absolute;
    bottom: calc(100% + 1px);

    font-size: 1.4rem;
    
    color: #ffffff;
}

.modal__input {
    width: 391px;
    height: 60px;

    font-size: 1.8rem;
    font-weight: 400;

    text-align: center;

    color: rgba(255, 255, 255, 0.7);

    background: rgba(255, 159, 211, 1);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);

    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    box-shadow: var(--ui-glass-shadow);
}

.modal__input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.modal__input:focus {
    outline: 2px solid rgba(255, 255, 255, 1);
}

.modal__submit {
    max-width: 391px;
    width: 80%;
    margin: 0 75px;
    margin-bottom: 20px;
}

.modal__submit:hover {
    background-color: var(--pink-hover);
}

.modal__user-agreement {
    font-family: "Nunito Sans";
    font-size: 1.4rem;
    font-weight: 300;

    text-align: center;

    color: rgba(255, 255, 255, 0.7);

    padding: 0 35px 15px;
    max-width: 430px;
}

.modal__user-agreement-link {
    color: #FB4BCA;
    transition: color .2s ease-out;
    white-space: nowrap;
}

.modal__user-agreement-link:hover {
    color: #fa76d5;
}

.modal__login-text {
    font-family: "Nunito Sans";
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-color);
}

.modal__login-link {
    color: #EE61A6;
    text-decoration: none;
    transition: color .2s ease-out;

    border-bottom: 1px solid #EE61A6;
}

.modal__login-link:hover {
    color: #ec84b7;
    border-bottom: 1px solid #ec84b7;
}

.modal .error-messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;

    margin-bottom: 10px;
    max-width: 391px;
}

/*
@media (max-width: 743px) {
    .modal__form {
        width: 70%;
    }
    

    .modal__input {
        max-width: 391px;
        width: 100%;
        height: 45px;
    }

    .modal__input-wrapper {
        width: 100%;
    }
}
*/

/* Адаптивы */
@media (max-width: 743px) {
    /* .modal__heading {
        margin-top: 50px;
    } */

    .modal {
        height: auto;
        background-position: 0 100%, right 39% top 70%, 0 0;
    }

    .modal__form {
        width: 80%;
    }

    .modal__input {
        max-width: 391px;
        width: 100%;
        height: 45px;
    }

    .modal__user-agreement {
        font-size: 1.6rem;
        padding: 0 25px 20px;
    }

    .modal__submit {
        width: 100%;
        font-size: 2.2rem;
    }

    .modal__content {
        width: 100%;
        height: calc(var(--vh) * 95);
    }

    .contact-us {
        display: flex
;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
}

#modal_change_email {
    height: auto !important;
}



.modal.modern-message-box {
    position: fixed; /* Центрируем окно */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background-color: white !important;
    background-image: none !important;
    padding-top: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    width: 450px; /* Можно подогнать */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000; /* Для того чтобы окно было поверх */
    overflow: visible; /* Разрешаем выходить за пределы окна */
    height: auto;
}


/* Треугольник в отдельном блоке */
.modal.modern-message-box .triangle {
    position: absolute;
    bottom: -19px; /* Позиционируем ниже окна */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid white; /* Цвет треугольника */
}

/* Стиль заголовка */
.modal.modern-message-box h1 {
    margin-top: 0;
    font-size: 24px;
    color: #333;
}

/* Стиль кнопки */
.modal.modern-message-box .modal__submit {
    margin-top: 0;
    color: #FB4BCA;
    background-color: white;
    border: 1px solid #FB4BCA;
}

/*
.modal.modern-message-box {
    position: relative;
    text-align: center;
    background-color: white !important;
    padding: 40px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    height: 200px;
}*/



/* Добавляем треугольник снизу */
/*.modal.modern-message-box::after {
    content: "";
    position: absolute;
    bottom: -20px; 
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid white; 
}*/


.modal.modern-message-box h1 {
    margin: 10px 10px 20px 10px;
    font-size: 24px;
    color: #333;
}

/* .modal.modern-message-box modal__heading {
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
} */
/*
.modern-message-box .modal__submit {
    margin: 0 auto;
    color: #FB4BCA;
}*/

.modal.payment-methods {
    width: min(761px, 95vw);

    background-size: 100% 289px, auto 116%, 100%;
    background-position: 0 100%, right -234px top -72px, 0 0;
    background-blend-mode: normal, screen, normal;

    display: flex;
    position: absolute !important;  /* Required for translate() */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);   
}

.modal__heading.payment-methods {
    margin-top: 40px;
    margin-bottom: 26px;
}

.modal.select-crypto {
    width: min(761px, 95vw);

    background-size: 100% 289px, auto 116%, 100%;
    background-position: 0 100%, right -234px top -72px, 0 0;
    background-blend-mode: normal, screen, normal;
}

.modal__heading.select-crypto {
    margin-top: 60px;
    margin-bottom: 60px;
}

.modal.select-kassa {
    width: min(761px, 95vw);

    background-size: 100% 289px, auto 116%, 100%;
    background-position: 0 100%, right -234px top -72px, 0 0;
    background-blend-mode: normal, screen, normal;
}

.modal.select-kassa .modal__content{
    width: 100%;
}

.modal__heading.select-kassa {
    margin-top: 60px;
    margin-bottom: 60px;
}

.modal__heading.payment-tariff {
    font-size: 2.7rem;
    font-weight: 500;
    line-height: 115%;

    margin-top: 0px;
    margin-bottom: 20px;
}

.modal.edit-settings {
    display: block !important;
}

.modal.edit-settings {
    display: block !important;
}

.modal__login {
    display: block !important;
}


.modal__heading.compact {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

.modal__submit.compact {
    margin-bottom: 20px !important;
}

.modal__cancel.compact {
    margin-bottom: 20px !important;
}

/* Адаптация под SE */

@media screen and (max-width: 376px) {
    .modal:has(.login__wrapper:not([data-login])){
        background-image: 
            linear-gradient(rgba(0, 0, 0, 0), rgb(0, 0, 0, 1)),
            url("../images/krissy_492_18+.2cfa4acc2ac2.png"),
            url("../images/background-pattern-modal.acfdda23662a.webp"),
            linear-gradient(to right, #5A2E73, #BD45A6);
        background-repeat: no-repeat;
        background-size: 100% 289px, 160px, 116%, 100%;
        background-position: 0 100%, 50% 32%, right -200px top -72px, 0 0;
        background-blend-mode: normal, normal, screen, normal;
    }

    .modal__close-button {
        padding: 15px;
    }

    .modal__heading {
        margin-top: calc(var(--vh) * 6);
        margin-bottom: calc(var(--vh) * 4);
    }

    .modal__form {
        width: calc(100% - 30px);
    }

    .modal__form-error-messages {
        font-size: 1.3rem;
        line-height: 110%;
    }

    .modal__user-agreement {
        font-size: 1.5rem;
    }
}
