/**
 * СТИЛИ МОДАЛЬНЫХ ФОРМ (БЭМ)
 *
 * Автономный CSS для системы форм обратной связи.
 * Методология: БЭМ (Блок-Элемент-Модификатор)
 *
 * БЛОКИ:
 * - .modal — модальное окно (фон + контейнер)
 * - .form — форма обратной связи
 *
 * МОДИФИКАТОРЫ:
 * - .modal--message — окно подтверждения отправки
 * - .modal--open — на body при открытом окне (блокирует прокрутку)
 *
 * ЗАВИСИМОСТИ: нет (полностью автономный)
 */

/* ========================================
   КНОПКА - аналогично кнопке btn-primary из global.css 
   ======================================== */

/* Красная */
.form__button {
    background-color: #cc0000;
    color: #ffffff;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.form__button:hover {
    background-color: #bb0000;
    color: #ffffff;
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form__button:active {
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* ========================================
   БЛОК: modal (модальное окно)
   ======================================== */

.modal {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: none;
    overflow: visible;
    flex-direction: row;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.modal__overlay {
    display: flex;
    width: 100%;
    height: auto;
    min-height: 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.modal__overlay p {
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 24px;
}

.modal__overlay a {
    color: #000;
    text-decoration: underline;
    background-color: transparent;
    cursor: pointer;
}

.modal__window {
    display: flex;
    position: relative;
    padding: 40px;
    max-width: 940px;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal__close-wrapper {
    display: flex;
    width: 100%;
    min-width: 350px;
    justify-content: flex-end;
    position: absolute;
    top: 0;
    right: 0;
}

.modal__close {
    padding: 15px;
    max-width: 100%;
}

.modal__close img {
    width: 20px;
    height: 20px;
    display: block;
}

.modal__title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.modal__subtitle {
    font-size: 16px;
    text-align: center;
}

.modal__form-wrapper {
    width: 70%;
}

/* Модификатор: окно подтверждения */
.modal--message .modal__overlay {
    position: relative;
    overflow: visible;
    height: auto;
    min-height: auto;
}

/* Модификатор: на body при открытом окне */
.modal--open {
    overflow: hidden;
}

/* ========================================
   БЛОК: form (форма обратной связи)
   ======================================== */

.form {
    margin: 0 0 15px;
}

.form__input {
    display: block;
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.428571429;
    color: #333333;
    vertical-align: middle;
    background-color: #ffffff;
    border: 1px solid #cccccc;
}

.form textarea.form__input {
    height: 150px;
    color: inherit;
    font: inherit;
    margin: 0;
}

.form__checkbox {
    display: block;
    margin-bottom: 5px;
    padding-left: 20px;
}

.form__checkbox-input {
    float: left;
    margin-bottom: 0;
    margin-left: -20px;
    margin-right: 0;
    margin-top: 4px;
    line-height: normal;
    box-sizing: border-box;
    padding: 0;
}

.form__label {
    display: inline-block;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.form__submit {
    display: flex;
    justify-content: center;
}

.form__spacer {
    height: 20px;
}


/* ========================================
   ВСПОМОГАТЕЛЬНЫЕ СТИЛИ
   ======================================== */

img {
    max-width: 100%;
    vertical-align: middle;
    display: inline-block;
    border: 0;
}

/* ========================================
   АДАПТИВНЫЕ СТИЛИ: мобильные (< 576px)
   ======================================== */
@media (max-width: 575.98px) {

    .modal__window {
        width: 100%;
        box-sizing: border-box;
    }

    .modal__title {
        font-size: 16px;
    }

    .modal__subtitle {
        font-size: 16px;
    }

    .modal__form-wrapper {
        width: 90%;
        display: flex;
    }

    .form__input {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .form textarea.form__input {
        height: 100px;
        font-size: 16px;
    }

    .form__label {
        font-size: 11px;
    }

    .form__checkbox {
        padding-left: 35px;
    }

    .form__checkbox-input {
        margin-left: -30px;
        width: 20px;
        height: 20px;
        margin-top: 5px;
    }


    .modal--message .modal__overlay {
        padding: 20px;
    }

    .modal--message .modal__window {
        width: 100%;
        max-width: 90%;
        padding: 30px 20px;
    }
}

/* ========================================
   АДАПТИВНЫЕ СТИЛИ: планшеты и десктоп (>= 576px)
   ======================================== */
@media (min-width: 576px) {

    .modal__window {
        max-width: 940px;
    }

    .form textarea.form__input {
        height: 150px;
        font-size: 14px;
    }
}
