html, body {
    position: relative;
}

/* ===== Базовое модальное окно ===== */
.modal-password {
    width: 750px;
    max-width: calc(100% - 32px);
    height: auto;
    min-height: 260px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid rgba(14, 81, 141, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(14, 38, 66, 0.28);
    position: fixed;
    z-index: 1000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: modalPop .28s cubic-bezier(.2, .8, .25, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Узкий вариант — для коротких уведомлений */
.modal-narrow {
    width: 460px;
    min-height: 0;
}

.modal-content-custom {
    position: relative;
    padding: 48px 56px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.content-wide {
    padding: 40px !important;
}

.modal-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.modal-title {
    margin-top: 22px;
    font-family: "MontserratSemiBold", "MontserratRegular", sans-serif;
    font-size: 24px;
    line-height: 130%;
    text-align: center;
    letter-spacing: 0.01em;
    color: #0E2642;
}

.modal-text {
    margin-top: 14px;
    font-family: "MontserratRegular", sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 18px;
    line-height: 150%;
    text-align: center;
    letter-spacing: 0.01em;
    color: #5a6b7b;
}

/* ===== Кнопки ===== */
.modal-back {
    margin-top: 28px;
    font-family: "MontserratRegular", sans-serif;
    font-size: 17px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    text-align: center;
    letter-spacing: 0.02em;
    color: #0E518D;
    background-color: transparent;
    border: 1px solid #0E518D;
    border-radius: 50px;
    padding: 12px 30px;
    cursor: pointer;
    transition: all .2s;
}

.modal-submit {
    margin-top: 24px;
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    border: 1px solid #0E518D;
    border-radius: 50px;
    background: #ffffff;
    font-family: MontserratRegular, sans-serif;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0.02em;
    color: #0E518D;
    cursor: pointer;
    transition: all .2s;
}

.modal-submit:hover {
    color: #fff;
    background-color: #0E518D;
}

/* Основная (заполненная) кнопка */
.modal-submit.modal-btn-primary {
    margin-top: 28px;
    width: auto;
    min-width: 200px;
    height: 52px;
    padding: 0 36px;
    background: #0E518D;
    color: #fff;
}

.modal-submit.modal-btn-primary:hover {
    background: #0b4271;
    border-color: #0b4271;
}

/* Крестик закрытия */
.modal-close-x {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(14, 81, 141, 0.08);
    color: #0E518D;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    transition: background .2s, transform .2s;
}

.modal-close-x:hover {
    background: rgba(14, 81, 141, 0.16);
    transform: rotate(90deg);
}

/* ===== Поля ввода внутри модалок ===== */
.modal-input {
    margin-top: 15px;
    width: 100%;
    height: 44px;
    background: rgba(14, 81, 141, 0.06);
    border-radius: 8px;
    border: 1px solid transparent;
    outline: none;
    font-family: "MontserratLight", sans-serif;
    font-size: 17px;
    line-height: 24px;
    color: rgba(0, 0, 0, 0.75);
    padding: 5px 18px;
    transition: border-color .2s, background .2s;
}

.modal-input:focus {
    border-color: #0E518D;
    background: #fff;
}

.modal-textarea {
    margin-top: 15px;
    width: 100%;
    height: 150px;
    background-color: rgba(14, 81, 141, 0.06);
    border-radius: 8px;
    border: 1px solid transparent;
    outline: none;
    font-family: "MontserratRegular", sans-serif;
    font-size: 17px;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.75);
    padding: 12px 18px;
    resize: none;
    overflow: auto;
    transition: border-color .2s, background .2s;
}

.modal-textarea:focus {
    border-color: #0E518D;
    background: #fff;
}

/* Старый крестик (оставлен для совместимости) */
.modal-close {
    display: none;
    border: none;
    background-color: transparent;
    width: 30px;
    height: 30px;
    position: absolute;
    top: 10%;
    left: 85%;
    background-image: url("../../img/main/modal/close.svg");
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 999;
    background-color: rgba(8, 24, 41, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

@media (max-width: 768px) {
    .modal-password {
        max-width: calc(100% - 24px);
    }

    .modal-content-custom {
        padding: 40px 28px;
    }
}

@media screen and (max-width: 576px) {
    .modal-content-custom {
        padding: 32px 22px;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-text {
        font-size: 16px;
    }
}

/* ===== Уведомление "Сообщение отправлено" (Bootstrap-модалка) ===== */
#sendInfoMessage,
#placementChoiceModal {
    padding-right: 0 !important; /* убираем сдвиг от компенсации скроллбара */
}

#sendInfoMessage .modal-dialog,
#placementChoiceModal .modal-dialog {
    justify-content: center;
    display: flex;
    margin: 0;
    max-width: 460px;
    width: calc(100% - 32px);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* точное центрирование */
}

#sendInfoMessage .modal-content.info-send-modal,
#placementChoiceModal .modal-content.info-send-modal {
    border: none;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(14, 38, 66, 0.28);
    overflow: hidden;
}

.info-send-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 48px;
}

.info-send-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.info-send-text {
    margin: 18px 0 0;
    font-family: "MontserratMedium", "MontserratRegular", sans-serif;
    font-size: 20px;
    line-height: 1.4;
    color: #0E2642;
}

/* Единый фон для Bootstrap-модалок (как у остальных оверлеев) */
.modal-backdrop {
    background-color: rgba(8, 24, 41, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.modal-backdrop.show {
    opacity: 1;
}

.myOffice-link.office-placement-button {
    width: 365px;
    max-width: 100%;
    min-width: 0;
    padding: 15px 2px;
    border: 1px solid #d52b1e !important;
    border-radius: 50px !important;
    background: #d52b1e;
    color: #fff;
    cursor: pointer;
}

.myOffice-link.office-placement-button:hover {
    background: #fff;
    color: #d52b1e;
}

.myOffice-link.office-placement-button:focus-visible {
    outline: 2px solid #d52b1e;
    outline-offset: 3px;
}

#placementChoiceModal .modal-dialog {
    max-height: 90vh;
}

#placementChoiceModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

#placementChoiceModal .btn-details {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575px) {
    #placementChoiceModal .info-send-body {
        padding: 40px 24px 24px;
    }

    #placementChoiceModal .btn-details {
        font-size: 16px;
    }
}

@media screen and (max-width: 576px) {
    .myOffice-link.office-placement-button,
    .myOffice__nav > .myDeal > button {
        padding: 16px 8px !important;
        height: auto;
        font-size: 16px;
        line-height: 24px;
    }
}
