/* Модальное окно - базовые стили */
#modal_form {
    padding: 30px 20px;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25);
    background: #fff;
    position: fixed;
    top: 50%;
    left: 50%;
    display: none;
    opacity: 0;
    z-index: 999;
    border-radius: 30px;
    transform: translate(-50%, -50%);
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#modal_form .modal_form__inner {
    width: 100%;
}

#overlay {
    z-index: 3;
    position: fixed;
    background-color: #000;
    opacity: 0.8;
    -moz-opacity: 0.8;
    filter: alpha(opacity=80);
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    display: none;
}

#modal_form input {
    height: 50px;
    border-radius: 15px;
    width: 100%;
    font-size: 16px; /* Увеличил для мобильных */
    font-weight: 400;
    padding: 12px 16px;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    -webkit-appearance: none; /* Убирает стили по умолчанию на iOS */
}

#modal_form a {
    color: #333333;
}

#modal_form a p>strong {
    color: #135DA8 !important;
}

#modal_form .warning {
    font-weight: 400;
    font-size: 11px;
    line-height: 130%;
    text-align: center;
    padding: 0 10px;
    margin: 20px 0;
}

#modal_form h3 {
    text-align: center;
    font-size: 1.3rem;
    text-transform: uppercase;
    color: #000;
    margin: 0;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.3;
}

#modal_form .comment {
    padding-bottom: 20px;
    font-size: 14px;
    text-align: center;
    padding-top: 8px;
    line-height: 1.4;
}

.exit {
    background: #d0d0d0;
    display: block !important;
    border-radius: 50%;
    right: -15px;
    top: -15px;
    position: absolute;
    width: 40px;
    height: 40px;
    line-height: 36px;
    font-size: 28px;
    border: 2px solid #3e5368;
    -webkit-transition: background 0.2s linear;
    -moz-transition: background 0.2s linear;
    -o-transition: background 0.2s linear;
    transition: background 0.2s linear;
    z-index: 1000;
}

.exit:after {
    display: block;
    font-size: 20px;
    content: "×";
    text-align: center;
    line-height: 36px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    color: #000000;
    -webkit-transition: all 0.2s linear;
    -moz-transition: all 0.2s linear;
    -o-transition: all 0.2s linear;
    transition: all 0.2s linear;
}

.exit:hover {
    background: #EAEAEA;
    text-decoration: none;
}

#modal_form .button {
    display: block;
    background-color: #ffd400;
    border: 1px solid #ccc;
    border-radius: 15px;
    color: #000;
    cursor: pointer;
    font-size: 17px;
    font-weight: bold;
    height: 50px;
    margin: 10px 0;
    padding: 2px 16px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    -webkit-transition: all 0.12s ease-in;
    -o-transition: all 0.12s ease-in;
    -moz-transition: all 0.12s ease-in;
    transition: all 0.12s ease-in;
    -webkit-appearance: none;
    touch-action: manipulation; /* Улучшает обработку касаний */
}

#modal_form .button:hover {
    background-color: #44C8F5;
    border: 1px solid #44C8F5;
    color: #fff;
}

#modal_form .error {
    border: 1px solid red;
}

/* Для очень маленьких экранов (до 375px) */
@media (max-width: 375px) {
    #modal_form {
        padding: 25px 15px;
        border-radius: 25px;
        width: calc(100% - 30px);
    }
    
    #modal_form h3 {
        font-size: 1.1rem;
    }
    
    #modal_form .comment {
        font-size: 13px;
    }
    
    #modal_form input {
        height: 46px;
        font-size: 15px;
        padding: 10px 14px;
    }
    
    #modal_form .button {
        height: 46px;
        font-size: 16px;
    }
    
    .exit {
        right: -10px;
        top: -10px;
        width: 35px;
        height: 35px;
        line-height: 32px;
    }
    
    .exit:after {
        font-size: 18px;
        line-height: 31px;
    }
}

/* Для планшетов (от 768px до 974px) */
@media (min-width: 768px) and (max-width: 974px) {
    #modal_form {
        padding: 50px 60px;
        width: 600px;
        border-radius: 40px;
        max-width: 90%;
    }
    
    #modal_form .warning {
        padding: 0 30px;
    }
    
    .exit {
        right: -20px;
        top: -20px;
    }
}

/* Для десктопов (975px и больше) */
@media (min-width: 975px) {
    #modal_form {
        padding: 80px 150px;
        width: 980px;
        border-radius: 50px;
        transform: translate(-50%, -45%);
        top: 45%;
    }
    
    #modal_form .warning {
        padding: 0 50px;
    }
    
    .exit {
        right: -30px;
        top: -20px;
    }
}

/* Для предотвращения zoom при фокусе на iOS */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px; /* Предотвращает масштабирование на iOS */
    }
}

/* Для улучшения скролла на мобильных */
#modal_form::-webkit-scrollbar {
    width: 5px;
}

#modal_form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#modal_form::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#modal_form::-webkit-scrollbar-thumb:hover {
    background: #555;
}



.modal {
	position: relative !important;
	display: block;
	overflow-x: visible;
}