/*
 * Поп-ап формы — Figma AlphaPegas-2025 node 32-284
 *
 * Specs (desktop, Figma / макет):
 * - Overlay: rgba(0,0,0,0.8) на весь экран
 * - Панель: 850 × 756 px, фон img/ap-popup-bg.png, radius 15px
 * - Intro (слой): 594×137, top 75px, left 129px — Manrope 300, 16px, #FFFFFF
 * - Label «Имя*»: 51×27, top 196px, left 220px — Manrope 700, 18px, #FFFFFF
 * - Label «Телефон*»: 98×27, top 270px, left 173px — Manrope 700, 18px, #FFFFFF
 * - Поле «Имя» (Rectangle 53): 426×56, top 201px, left 284px, radius 3px, border 1px
 * - Поле «Телефон» (Rectangle 54): 426×56, top 276px, left 284px, radius 3px, border 1px
 * - Label «Сообщение»: 118×27, top 340px, left 153px — Manrope 700, 18px, #FFFFFF
 * - Поле «Сообщение» (Rectangle 55): 426×193, top 351px, left 284px, radius 3px, border 1px
 * - Label (остальные): Manrope 700, 18px, right-aligned
 * - Input/textarea: 480px, h 55px / textarea 140px, radius 6px, fill #d4d4d4 → #ececec
 * - Gap label–field: 24px; row margin-bottom: 16px
 * - Кнопка «Отправить»: 415×74, top 604px, left 284px, radius 11.25px, border 0.75px
 * - Close: 44px, top 24px right 40px, #FFFFFF
 */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;500;700&display=swap');

body.no-scroll {
    overflow: hidden;
}

/* Сброс legacy main.css внутри ap-popup */
footer.ap-footer .ap-popup.b-popup,
footer.ap-footer .ap-popup.b-popup .b-popup-content {
    width: auto;
    height: auto;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    align-items: stretch;
    justify-content: flex-start;
    flex-flow: column nowrap;
}

footer.ap-footer .ap-popup.b-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: transparent;
    font-family: 'Manrope', 'Noto Sans Display', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
}

footer.ap-footer .ap-popup.b-popup.is-open {
    display: flex;
}

footer.ap-footer .ap-popup .ap-popup__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

footer.ap-footer .ap-popup .ap-popup__panel {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 850px;
    height: 756px;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #1a1d22;
    background-image: url('../img/ap-popup-bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    border-radius: 15px;
    pointer-events: auto;
}

footer.ap-footer .ap-popup .ap-popup__close {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-size: 44px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

footer.ap-footer .ap-popup .ap-popup__close:hover {
    opacity: 0.75;
}

footer.ap-footer .ap-popup .ap-popup__close:focus-visible {
    outline: 2px solid #07ac69;
    outline-offset: 4px;
}

footer.ap-footer .ap-popup .ap-popup__intro {
    position: absolute;
    top: 75px;
    left: 129px;
    z-index: 1;
    box-sizing: border-box;
    width: 594px;
    height: 137px;
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 300;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0;
    color: #ffffff;
}

footer.ap-footer .ap-popup .ap-popup__form {
    width: 100%;
    margin: 0;
    padding: 0;
}

footer.ap-footer .ap-popup .ap-popup__row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    margin-bottom: 12px;
}


footer.ap-footer .ap-popup .ap-popup__label {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0;
    color: #ffffff;
    text-align: right;
    white-space: nowrap;
}

footer.ap-footer .ap-popup .ap-popup__label--name {
    position: absolute;
    top: 196px;
    left: 220px;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 51px;
    height: 27px;
    text-align: left;
}

footer.ap-footer .ap-popup .ap-popup__label--phone {
    position: absolute;
    top: 270px;
    left: 173px;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 98px;
    height: 27px;
    text-align: left;
}

footer.ap-footer .ap-popup .ap-popup__label--message {
    position: absolute;
    top: 340px;
    left: 153px;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 118px;
    height: 27px;
    text-align: left;
}

footer.ap-footer .ap-popup .ap-popup__textarea--message {
    position: absolute;
    top: 351px;
    left: 284px;
    z-index: 1;
    width: 426px;
    max-width: none;
    height: 193px;
    min-height: 193px;
    margin: 0;
}

footer.ap-footer .ap-popup .ap-popup__input--name,
footer.ap-footer .ap-popup .ap-popup__input--phone {
    position: absolute;
    left: 284px;
    z-index: 1;
    width: 426px;
    max-width: none;
    height: 56px;
    margin: 0;
}

footer.ap-footer .ap-popup .ap-popup__input--name {
    top: 201px;
}

footer.ap-footer .ap-popup .ap-popup__input--phone {
    top: 276px;
}

footer.ap-footer .ap-popup .ap-popup__input,
footer.ap-footer .ap-popup .ap-popup__textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #a8a8a8;
    border-radius: 6px;
    background: linear-gradient(180deg, #c8c8c8 0%, #e8e8e8 50%, #f0f0f0 100%);
    color: #1a1a1a;
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

footer.ap-footer .ap-popup .ap-popup__input {
    height: 55px;
}

footer.ap-footer .ap-popup .ap-popup__input.ap-popup__input--name,
footer.ap-footer .ap-popup .ap-popup__input.ap-popup__input--phone {
    height: 56px;
    border-width: 1px;
    border-radius: 3px;
}

footer.ap-footer .ap-popup .ap-popup__textarea {
    min-height: 110px;
    height: 110px;
    padding-top: 14px;
    padding-bottom: 14px;
    resize: vertical;
}

footer.ap-footer .ap-popup .ap-popup__textarea.ap-popup__textarea--message {
    height: 193px;
    min-height: 193px;
    border-width: 1px;
    border-radius: 3px;
    resize: none;
}

footer.ap-footer .ap-popup .ap-popup__input::placeholder,
footer.ap-footer .ap-popup .ap-popup__textarea::placeholder {
    color: #8a8a8a;
    font-style: italic;
    font-weight: 400;
}

footer.ap-footer .ap-popup .ap-popup__input:focus,
footer.ap-footer .ap-popup .ap-popup__textarea:focus {
    outline: none;
    border-color: #07ac69;
    box-shadow: 0 0 0 2px rgba(7, 172, 105, 0.35);
}

footer.ap-footer .ap-popup .ap-popup__submit--send {
    position: absolute;
    top: 604px;
    left: 284px;
    z-index: 1;
    width: 415px;
    max-width: none;
    height: 74px;
    margin: 0;
}

footer.ap-footer .ap-popup .ap-popup__submit,
footer.ap-footer .ap-popup .ap-popup__submit.send-button {
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    height: 65px;
    font-size: 24px;
    margin: 0;
    padding: 0 24px;
    border: none;
    border-radius: 11.25px;
    background-color: #017344;
    background-image: linear-gradient(358.41deg, #12332d 0.9%, #017344 98.2%);
    box-shadow:
        0px 4px 4px 0px #00000040,
        0 3px 3px 0 rgba(0, 0, 0, 0.8),
        inset -6.75px 3.75px 1px 3px rgba(169, 248, 157, 0.26),
        inset -3px -3px 1px 0 rgba(0, 0, 0, 0.25);
    color: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    line-height: 100%;
    letter-spacing: 0;
    text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background-image 0.2s ease, filter 0.2s ease;
}

footer.ap-footer .ap-popup .ap-popup__submit:hover {
    background-image: linear-gradient(358.41deg, #282c35 0.9%, #596476 98.2%);
    filter: brightness(1.03);
}

footer.ap-footer .ap-popup .ap-popup__submit:active {
    background-image: linear-gradient(358.41deg, #017344 0.9%, #309b4d 98.2%);
}

footer.ap-footer .ap-popup .ap-popup__submit:focus-visible {
    outline: 2px solid #07ac69;
    outline-offset: 4px;
}

footer.ap-footer .ap-popup .ap-popup__submit.ap-popup__submit--send {
    height: 74px;
    border: 0.75px solid rgba(0, 0, 0, 0.35);
    border-radius: 11.25px;
}

/* Legacy selectors — не применять */
footer.ap-footer .ap-popup .flines,
footer.ap-footer .ap-popup .flines p,
footer.ap-footer .ap-popup .close {
    all: unset;
    display: none;
}

@media (max-width: 900px) {
    footer.ap-footer .ap-popup .ap-popup__panel {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: calc(100vh - 32px);
        padding: 32px 24px 24px;
    }

    footer.ap-footer .ap-popup .ap-popup__intro {
        position: static;
        width: auto;
        height: auto;
        margin: 0 0 20px;
        padding-right: 40px;
    }

    footer.ap-footer .ap-popup .ap-popup__label--name,
    footer.ap-footer .ap-popup .ap-popup__label--phone,
    footer.ap-footer .ap-popup .ap-popup__label--message {
        position: static;
        display: block;
        width: auto;
        height: auto;
        margin: 0 0 8px;
        text-align: left;
    }

    footer.ap-footer .ap-popup .ap-popup__input--name,
    footer.ap-footer .ap-popup .ap-popup__input--phone {
        position: static;
        width: 100%;
        max-width: none;
        height: 55px;
        margin: 0 0 16px;
        border-radius: 6px;
    }

    footer.ap-footer .ap-popup .ap-popup__textarea--message {
        position: static;
        width: 100%;
        max-width: none;
        height: 110px;
        min-height: 110px;
        margin: 0 0 16px;
        border-radius: 6px;
        resize: vertical;
    }

    footer.ap-footer .ap-popup .ap-popup__submit--send {
        position: static;
        display: block;
        width: 100%;
        max-width: none;
        height: 65px;
        margin: 16px 0 0;
        border-radius: 11.25px;
    }
}

@media (max-width: 767px) {
    footer.ap-footer .ap-popup .ap-popup__panel {
        padding: 28px 16px 20px;
    }

    footer.ap-footer .ap-popup .ap-popup__intro {
        padding-right: 36px;
    }

    footer.ap-footer .ap-popup .ap-popup__close {
        top: 4px;
        right: 8px;
        font-size: 36px;
    }

    footer.ap-footer .ap-popup .ap-popup__label {
        text-align: left;
    }

    footer.ap-footer .ap-popup .ap-popup__input,
    footer.ap-footer .ap-popup .ap-popup__textarea,
    footer.ap-footer .ap-popup .ap-popup__submit {
        max-width: none;
    }
}
