/* ===== Модалка «Оформить заявку» (PP по Figma) ===== */
.request {
    border: none;
    padding: 0;
    max-width: 496px;
    width: calc(100% - 32px);
    border-radius: 14px;
    background: white;
    overflow: clip;            /* для оранжевой линии со скруглением */
    color: var(--primary-text-1000);
}

/* бэкдроп как у бургер-меню */
.request::backdrop {
    background: rgba(0, 0, 0, 0.2);
}

html:has(.request[open]) {
    overflow: hidden;
}

.request__box {
    position: relative;
    padding: 40px 32px 32px;
}

/* оранжевая линия сверху */
.request__box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color-1000);
}

.request__close {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: var(--primary-text-1000);
    transition: color var(--primary-transition-config);
}

.request__close:hover {
    color: var(--primary-color-900);
}

.request__close .icon {
    width: 20px;
    height: 20px;
    fill: none;
}

/* шапка: на десктопе только заголовок, «назад» скрыта */
.request__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.request__back {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: var(--primary-text-1000);
}

.request__back .icon {
    width: 20px;
    height: 20px;
    fill: none;
}

.request__title {
    font-size: 24px;
    font-weight: bold;
    line-height: 110%;
    color: var(--primary-text-1000);
}

.request__subtitle {
    margin-top: 12px;
    font-size: 16px;
    line-height: 135%;
    color: var(--primary-text-1000);
}

.request__form {
    margin-top: 32px;
    display: flex;
    flex-flow: column;
    gap: 32px;
}

.request__fields {
    display: flex;
    flex-flow: column;
    gap: 16px;
}

.request__input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid #DFDFDF;
    background: #F5F5F5;
    font-size: 14px;
    line-height: 135%;
    color: var(--primary-text-1000);
    transition: border-color var(--primary-transition-config),
                background-color var(--primary-transition-config);
}

.request__input--area {
    height: 108px;
    padding: 16px;
    resize: none;
    font-family: inherit;
}

.request__input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.request__input:focus {
    outline: none;
    border-color: var(--primary-color-900);
    background: white;
}

.request__footer {
    display: flex;
    flex-flow: column;
    gap: 16px;
}

.request__submit {
    width: 100%;
}

.request__agreement {
    font-size: 14px;
    line-height: 135%;
    text-align: center;
    color: var(--primary-text-900);
}

.request__agreement a {
    color: var(--primary-color-900);
    font-weight: bold;
}

/* невалидное поле */
.request__input--invalid {
    border-color: #e23b3b;
    background: white;
}

/* статус отправки */
.request__status {
    font-size: 14px;
    line-height: 135%;
    text-align: center;
}

.request__status--ok {
    color: #2e8b57;
}

.request__status--error {
    color: #e23b3b;
}

/* ===== Мобилка: полноэкранный лист ===== */
@media screen and (max-width: 767px) {
    .request {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }

    .request__box {
        min-height: 100%;
        box-sizing: border-box;
        display: flex;
        flex-flow: column;
        padding: calc(20px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    /* у листа-формы нет оранжевой полосы */
    .request__box::before {
        content: none;
    }

    .request__back {
        display: flex;
    }

    .request__title {
        font-size: 18px;
    }

    .request__subtitle {
        font-size: 14px;
    }

    /* поля сверху, кнопка с дисклеймером прижаты вниз */
    .request__form {
        flex: 1;
    }

    .request__footer {
        margin-top: auto;
        flex-flow: column-reverse;   /* дисклеймер над кнопкой */
        gap: 12px;
    }

    .request__agreement {
        font-size: 12px;
    }
}
