/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal__container {
    position: relative;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    background: #F6F5F3;
    border-radius: 30px;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease forwards;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Скрытие скроллбара для красоты (опционально) */
.modal__container::-webkit-scrollbar {
    width: 6px;
}

.modal__container::-webkit-scrollbar-track {
    background: rgba(40, 38, 36, 0.1);
    border-radius: 10px;
}

.modal__container::-webkit-scrollbar-thumb {
    background: rgba(40, 38, 36, 0.3);
    border-radius: 10px;
}

.modal__container::-webkit-scrollbar-thumb:hover {
    background: rgba(40, 38, 36, 0.5);
}

/* Кнопка закрытия */
.modal__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 38, 36, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #282624;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal__close:hover {
    background: rgba(40, 38, 36, 0.2);
    transform: rotate(90deg);
}

/* Контент модального окна */
.modal__content {
    padding: 20px;
}

/* Заголовок */
.modal__header {
    text-align: center;
    margin-bottom: 32px;
}

.modal__title-modal {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 115%;
    color: #282624;
    margin: 0 0 12px 0;
}

.modal__subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 145%;
    color: #5a5a5a;
    margin: 0;
}

/* Форма */
.modal__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.form-group--checkbox {
    flex-direction: row;
    align-items: flex-start;
}

.form-label-modal {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 145%;
    color: #282624;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: #FFFFFF;
    border: 1px solid #E2E1DF;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 145%;
    color: #282624;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #907A71;
    box-shadow: 0 0 0 3px rgba(243, 191, 130, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #B8B5B2;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/*!* Чекбокс *!*/
/*.checkbox-label {*/
/*    display: flex;*/
/*    align-items: flex-start;*/
/*    gap: 12px;*/
/*    cursor: pointer;*/
/*}*/

/*.checkbox-input {*/
/*    position: absolute;*/
/*    opacity: 0;*/
/*    width: 0;*/
/*    height: 0;*/
/*}*/

/*.checkbox-custom {*/
/*    flex-shrink: 0;*/
/*    width: 20px;*/
/*    height: 20px;*/
/*    background: #FFFFFF;*/
/*    border: 2px solid #E2E1DF;*/
/*    border-radius: 4px;*/
/*    transition: all 0.2s ease;*/
/*}*/

/*.checkbox-input:checked + .checkbox-custom {*/
/*    background: #907A71;*/
/*    border-color: #907A71;*/
/*    position: relative;*/
/*}*/

/*.checkbox-input:checked + .checkbox-custom::after {*/
/*    content: '';*/
/*    position: absolute;*/
/*    left: 6px;*/
/*    top: 2px;*/
/*    width: 6px;*/
/*    height: 10px;*/
/*    border: solid #282624;*/
/*    border-width: 0 2px 2px 0;*/
/*    transform: rotate(45deg);*/
/*}*/

/*.checkbox-input:focus + .checkbox-custom {*/
/*    box-shadow: 0 0 0 3px rgba(243, 191, 130, 0.2);*/
/*}*/

/*.checkbox-text {*/
/*    font-family: 'Inter', sans-serif;*/
/*    font-weight: 400;*/
/*    font-size: 12px;*/
/*    line-height: 140%;*/
/*    color: #5a5a5a;*/
/*}*/

/*.checkbox-text a {*/
/*    color: #907A71;*/
/*    text-decoration: none;*/
/*    transition: opacity 0.3s ease;*/
/*}*/

/*.checkbox-text a:hover {*/
/*    opacity: 0.8;*/
/*    text-decoration: underline;*/
/*}*/

/* Кнопка отправки */
.btn-submit-modal {
    width: 100%;
    padding: 16px 24px;
    background: #282624;
    border: none;
    border-radius: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 145%;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-submit-modal:hover {
    transform: translateY(-2px);
    background: #3a3633;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-submit-modal:active {
    transform: translateY(0);
}

/* Футер модального окна */
.modal__footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #E2E1DF;
}

.modal__note {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 145%;
    color: #5a5a5a;
    margin: 0 0 16px 0;
}

.modal__contacts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.modal__phone {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 110%;
    color: #282624;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.modal__phone:hover {
    opacity: 0.8;
}

.modal__messengers .social-networks--modal .social-networks__link img {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    margin: 0;
    border-radius: 8px;
    object-fit: contain;
}

.modal__messengers {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal__messengers .messenger-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(40, 38, 36, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.modal__messengers .messenger-link:hover {
    transform: scale(1.05);
    background: rgba(40, 38, 36, 0.15);
}

.modal__messengers .messenger-link img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Сообщения об ошибках и успехе */
.error-message {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
}

.form-input.error,
.form-textarea.error {
    border-color: #e74c3c;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.alert-hidden {
    display: none;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Анимации */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .modal__container {
        width: 95%;
        border-radius: 24px;
    }

    .modal__content {
        padding: 20px;
    }

    .modal__title-modal {
        font-size: 28px;
    }

    .modal__subtitle {
        font-size: 14px;
    }

    .modal__close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }

    .btn-submit {
        padding: 14px 20px;
        font-size: 16px;
    }

    .modal__phone {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .modal__content {
        padding: 20px;
    }

    .modal__title-modal {
        font-size: 24px;
    }

    .form-input,
    .form-textarea {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-submit {
        padding: 12px 18px;
        font-size: 14px;
    }

    .modal__phone {
        font-size: 16px;
    }

    .modal__messengers .messenger-link {
        width: 36px;
        height: 36px;
    }

    .modal__messengers .messenger-link img {
        width: 20px;
        height: 20px;
    }
}
