.modal-callback {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    overflow-y: auto;
}

.modal-callback.active {
    display: flex;
}

.modal_container {
    position: relative;
    margin: auto;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
}

/* Для блокировки скролла на body */
.body-no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}
.modal-callback{
    position: fixed;
    display: none;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:rgba(0,0,0,0.5);
    z-index: 999999999;
}

.modal_container{
    position: relative;
    padding: 32px;
    width: 100%;
    max-width: 580px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal__close{
    position: absolute;
    cursor: pointer;
    top: 1em;
    right: 1em;
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #666;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
}

.modal__close:hover {
    color: #333;
    transform: rotate(90deg);
}

.modal__title{
    text-align: center;
    width: 100%;
    padding: 0 0 1.5rem;
    margin: 0;
    color: #003151;
    font-size: 1.8em;
    font-weight: 600;
    line-height: 1.3;
}

.modal-form__field{
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 1.5em;
}

.modal-grid{
    display: flex;
    flex-direction: column;
}

.modal-form__label{
    font-size: 0.9em;
    padding-bottom: 0.5em;
    color: #555;
    font-weight: 500;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: #777;
    z-index: 1;
}

.modal-form__input{
    height: 50px;
    padding: 12px 12px 12px 40px !important;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.phone-mask {
    letter-spacing: 1px;
}

.error_ip {
    display: none;
    margin: 0 0 12px;
    color: #dc3545;
    font-size: 14px;
    font-weight: 500;
}

.modal-form__input:focus{
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.modal-form__button{
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-top: 1.5em;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.button__secondary{
    cursor: pointer;
    background-color: #007bff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.button__secondary:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.button__secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.button__secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.button__secondary:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.form__agree{
    width: 100%;
    margin: 1.5rem 0 0;
    color: #666;
    font-size: 0.85em;
    line-height: 1.5;
    text-align: left;
}

.form__checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.custom-checkbox {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    background: white;
    transition: all 0.2s ease;
}

.modal-form__agree-label > [type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.modal-form__agree-label > [type="checkbox"]:checked + .custom-checkbox {
    background-color: #007bff;
    border-color: #007bff;
}

.modal-form__agree-label > [type="checkbox"]:checked + .custom-checkbox::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form__agree a {
    color: #007bff;
    text-decoration: none;
}

.form__agree a:hover {
    text-decoration: underline;
}

/* Success message styles */
.modal-form__success {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.modal-form__success-icon {
    margin-bottom: 20px;
}

.modal-form__success-icon svg {
    width: 64px;
    height: 64px;
}

.modal-form__success-text-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 15px;
}

.modal-form__success-text-desc {
    font-size: 1em;
    color: #555;
    line-height: 1.5;
    margin-bottom: 25px;
}

.input-error {
    border: 1px solid red !important;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5) !important;
}

/* Подсветка чекбокса через соседний кастомный элемент */
.js-form-apply.input-error + .custom-checkbox {
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.4);
    border: 1px solid red;
    border-radius: 4px;
}

.input-error:checked + .custom-checkbox{
    box-shadow: none;
    border: none;
    border-radius: 4px;
}


.button__back {
    margin-top: 20px;
    background-color: #6c757d;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.button__back:hover {
    background-color: #007bff;
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

.form__success-icon>svg{
    fill: #007bff;
}

@media (max-width: 589px) {
    .modal_container{
        width: 90%;
    }
}
