/* =========================================================
   МОДАЛЬНОЕ ОКНО ЗАЯВКИ
   Стили вынесены из inc/zayavka_popup.php
========================================================= */

/* =====================================================
       ОСНОВА POPUP
    ===================================================== */

    .nzp,
    .nzp *,
    .ns,
    .ns * {
        box-sizing: border-box;
    }

    .nzp,
    .ns {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        font-family: "Lora", Georgia, serif;
        transition: opacity .22s ease, visibility .22s ease;
    }

    .ns {
        z-index: 100000;
    }

    .nzp.on,
    .ns.on {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .nzp-o {
        position: absolute;
        inset: 0;
        background: rgba(2, 27, 48, .72);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .nzp-d,
    .ns-d {
        position: relative;
        z-index: 2;
        border: 1px solid rgba(8, 120, 183, .14);
        border-radius: 24px;
        background:
            radial-gradient(
                circle at 100% 0,
                rgba(22, 184, 228, .12),
                transparent 35%
            ),
            linear-gradient(#fff, #fbfdfe);
        color: #17364c;
        box-shadow:
            0 30px 90px rgba(0, 35, 60, .27),
            0 8px 28px rgba(8, 120, 183, .08);
        transform: translateY(16px) scale(.97);
        transition: transform .22s ease;
    }

    .nzp.on .nzp-d,
    .ns.on .ns-d {
        transform: none;
    }

    body.nzp-lock {
        overflow: hidden;
    }

    /* =====================================================
       ОСНОВНОЕ ОКНО
    ===================================================== */

    .nzp-d {
        display: flex;
        flex-direction: column;
        width: min(700px, 100%);
        max-height: calc(100dvh - 36px);
        padding: 26px 8px 8px 26px;
        overflow: hidden;
    }

    .nzp-h {
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        align-items: center;
        flex: 0 0 auto;
        gap: 20px;
        margin-right: 18px;
        padding: 0 44px 22px 0;
        border-bottom: 1px solid #dceaf2;
    }

    .nzp-logo {
        width: 108px;
        height: 116px;
    }

    .nzp-logo img,
    .ns-logo img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .nzp-title {
        margin: 0;
        color: #102d43;
        font-size: clamp(28px, 4vw, 38px);
        font-weight: 700;
        line-height: 1.1;
    }

    .nzp-sub {
        max-width: 430px;
        margin: 10px 0 0;
        color: #607383;
        font-size: 15px;
        line-height: 1.55;
    }

    /*
     * Прокрутка перенесена сюда.
     * Заголовок и кнопка закрытия остаются на месте.
     */
    .nzp-b {
        min-height: 0;
        padding: 22px 18px 18px 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #16b8e4 transparent;
    }

    .nzp-b::-webkit-scrollbar,
    .nz-directions__scroll::-webkit-scrollbar {
        width: 6px;
    }

    .nzp-b::-webkit-scrollbar-track,
    .nz-directions__scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .nzp-b::-webkit-scrollbar-thumb,
    .nz-directions__scroll::-webkit-scrollbar-thumb {
        border-radius: 10px;
        background: #16b8e4;
    }

    .nzp-b form,
    .nzp-b p {
        margin: 0;
    }

    /* =====================================================
       ЗАКРЫТИЕ
    ===================================================== */

    .nzp-x {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 5;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #0878b7;
        color: #fff;
        cursor: pointer;
        transition: background .2s ease, transform .2s ease;
    }

    .nzp-x:hover {
        background: #005f95;
        transform: rotate(6deg);
    }

    .nzp-x span {
        position: absolute;
        top: 19px;
        left: 10px;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
    }

    .nzp-x span:first-child {
        transform: rotate(45deg);
    }

    .nzp-x span:last-child {
        transform: rotate(-45deg);
    }

    /* =====================================================
       CONTACT FORM 7
    ===================================================== */

    .nz-form {
        width: 100%;
    }

    .nz-form .wpcf7-spinner {
        display: none;
    }

    .nz-form__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 14px 16px;
    }

    .nz-field {
        display: block;
        min-width: 0;
        margin: 0;
    }

    .nz-field--name {
        grid-column: 1;
        grid-row: 1;
    }

    .nz-field--email {
        grid-column: 2;
        grid-row: 1;
    }

    .nz-field--phone {
        grid-column: 1;
        grid-row: 2;
    }

    .nz-field--directions {
        grid-column: 2;
        grid-row: 2;
    }

    .nz-field--message {
        margin-top: 15px;
    }

    .nz-field .wpcf7-form-control-wrap {
        display: block;
    }

    .nz-form input[type="text"],
    .nz-form input[type="email"],
    .nz-form input[type="tel"],
    .nz-form textarea,
    .nz-directions__trigger {
        width: 100%;
        min-height: 50px;
        margin: 0;
        border: 1px solid #dbe6ec;
        border-radius: 12px;
        outline: 0;
        background: #f7fafc;
        color: #17364c;
        font: 500 14px/1.4 inherit;
        box-shadow: inset 0 1px 2px rgba(25, 55, 75, .025);
        transition:
            border-color .2s ease,
            background .2s ease,
            box-shadow .2s ease;
    }

    .nz-form input[type="text"],
    .nz-form input[type="email"],
    .nz-form input[type="tel"],
    .nz-form textarea {
        padding: 12px 15px;
    }

    .nz-form textarea {
        height: 74px;
        min-height: 74px;
        max-height: 150px;
        padding-top: 13px;
        resize: vertical;
    }

    .nz-form input:hover,
    .nz-form textarea:hover,
    .nz-directions__trigger:hover {
        border-color: #bcd7e5;
        background: #fff;
    }

    .nz-form input:focus,
    .nz-form textarea:focus,
    .nz-directions.is-open .nz-directions__trigger {
        border-color: #16b8e4;
        background: #fff;
        box-shadow:
            0 0 0 4px rgba(22, 184, 228, .11),
            0 8px 20px rgba(8, 120, 183, .07);
    }

    .nz-form input::placeholder,
    .nz-form textarea::placeholder {
        color: #8c9ba7;
    }

    .nz-field__hint {
        margin: 7px 2px 0;
        color: #617786;
        font-size: 11.5px;
        font-weight: 500;
        line-height: 1.4;
    }

    .nz-field__hint span {
        color: #0878b7;
        font-weight: 700;
    }

    /* =====================================================
       ВЫБОР НАПРАВЛЕНИЙ
    ===================================================== */

    .nz-directions {
        position: relative;
        width: 100%;
    }

    .nz-directions__trigger {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 11px 44px 11px 15px;
        text-align: left;
        cursor: pointer;
    }

    .nz-directions__value {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nz-directions__arrow {
        position: absolute;
        top: 50%;
        right: 18px;
        width: 10px;
        height: 10px;
        border-right: 2px solid #0878b7;
        border-bottom: 2px solid #0878b7;
        transform: translateY(-70%) rotate(45deg);
        transition: transform .2s ease;
    }

    .nz-directions.is-open .nz-directions__arrow {
        transform: translateY(-25%) rotate(225deg);
    }

    .nz-directions__menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        z-index: 20;
        width: 100%;
        padding: 8px;
        border: 1px solid #dce8ee;
        border-radius: 14px;
        background: #fff;
        box-shadow:
            0 24px 55px rgba(10, 45, 70, .18),
            0 6px 18px rgba(10, 45, 70, .07);
    }

    .nz-directions__menu[hidden] {
        display: none;
    }

    .nz-directions__scroll {
        max-height: 180px;
        padding-right: 3px;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #16b8e4 transparent;
    }

    .nz-directions .wpcf7-form-control {
        display: grid;
        gap: 2px;
    }

    .nz-directions .wpcf7-list-item {
        display: block;
        margin: 0;
    }

    .nz-directions .wpcf7-list-item label {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 40px;
        margin: 0;
        padding: 9px 10px;
        border-radius: 9px;
        color: #26465b;
        font-size: 12.5px;
        font-weight: 600;
        line-height: 1.35;
        cursor: pointer;
        transition: background .18s ease, color .18s ease;
    }

    .nz-directions .wpcf7-list-item label:hover {
        background: #eef9fd;
        color: #0878b7;
    }

    .nz-directions .wpcf7-list-item input {
        flex: 0 0 18px;
        width: 18px;
        height: 18px;
        margin: 0;
        accent-color: #0878b7;
        cursor: pointer;
    }

    .nz-directions__confirm {
        width: 100%;
        min-height: 42px;
        margin-top: 9px;
        padding: 10px 15px;
        border: 0;
        border-radius: 10px;
        background: linear-gradient(135deg, #16b8e4, #0878b7);
        color: #fff;
        font: 700 14px inherit;
        cursor: pointer;
        box-shadow: 0 9px 20px rgba(8, 120, 183, .18);
        transition: transform .2s ease, box-shadow .2s ease;
    }

    .nz-directions__confirm:hover {
        transform: translateY(-1px);
        box-shadow: 0 11px 24px rgba(8, 120, 183, .24);
    }

    /* =====================================================
       НИЗ ФОРМЫ
    ===================================================== */

    .nz-form__bottom {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 205px;
        align-items: center;
        gap: 18px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #e5eef3;
    }

    .nz-form__policy {
        padding: 11px 12px;
        border-radius: 11px;
        background: #f5f9fb;
        color: #637987;
        font-size: 11.5px;
        line-height: 1.5;
    }

    .nz-form__policy .wpcf7-list-item {
        margin: 0;
    }

    .nz-form__policy label {
        display: flex;
        align-items: center;
        gap: 9px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
    }

    .nz-form__policy input {
        flex: 0 0 17px;
        width: 17px;
        height: 17px;
        margin: 1px 0 0;
        accent-color: #0878b7;
    }

    .nz-form__policy a {
        color: #0878b7;
        text-decoration: underline;
    }

    .nz-form__submit-btn,
    .nz-form input[type="submit"],
    .ns-btn {
        width: 100%;
        min-height: 50px;
        padding: 12px 20px;
        border: 0;
        border-radius: 11px;
        background: linear-gradient(135deg, #ffd94f, #ffc928);
        color: #151515;
        font: 700 15px inherit;
        cursor: pointer;
        box-shadow:
            0 12px 25px rgba(255, 201, 40, .24),
            inset 0 1px 0 rgba(255, 255, 255, .55);
        transition:
            color .2s ease,
            background .2s ease,
            transform .2s ease,
            box-shadow .2s ease;
    }

    .nz-form__submit-btn:hover,
    .nz-form input[type="submit"]:hover,
    .ns-btn:hover {
        background: linear-gradient(135deg, #16b8e4, #0878b7);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 13px 28px rgba(8, 120, 183, .24);
    }

    .nz-form .wpcf7-not-valid-tip {
        margin-top: 5px;
        color: #d32f2f;
        font-size: 12px;
    }

    .nz-form .wpcf7-response-output {
        margin: 14px 0 0;
        padding: 11px 13px;
        border-radius: 9px;
        font-size: 13px;
        line-height: 1.45;
    }

    /* =====================================================
       ОКНО СПАСИБО
    ===================================================== */

    .ns-d {
        width: min(440px, 100%);
        padding: 30px 30px 32px;
        text-align: center;
    }

    .ns-logo {
        width: 112px;
        height: 118px;
        margin: 0 auto 12px;
    }

    .ns-title {
        margin: 0 0 10px;
        color: #102d43;
        font-size: 38px;
        font-weight: 700;
        line-height: 1.1;
    }

    .ns-text {
        margin: 0;
        color: #607383;
        font-size: 15px;
        line-height: 1.6;
    }

    .ns-text + .ns-text {
        margin-top: 2px;
    }

    .ns-btn {
        margin-top: 24px;
    }

    /* =====================================================
       МОБИЛЬНАЯ ВЕРСИЯ
    ===================================================== */

    @media (max-width: 767px) {
        .nzp {
            align-items: flex-start;
            padding: 8px;
        }

        .nzp-d {
            width: 100%;
            max-height: calc(100dvh - 16px);
            padding: 18px 5px 5px 14px;
            border-radius: 20px;
        }

        .nzp-h {
            grid-template-columns: 74px minmax(0, 1fr);
            gap: 12px;
            margin-right: 9px;
            padding: 0 36px 16px 0;
        }

        .nzp-logo {
            width: 74px;
            height: 82px;
        }

        .nzp-title {
            font-size: 24px;
        }

        .nzp-sub {
            margin-top: 7px;
            font-size: 13px;
            line-height: 1.4;
        }

        .nzp-b {
            padding: 18px 9px 9px 0;
        }

        .nzp-x {
            top: 10px;
            right: 10px;
            width: 38px;
            height: 38px;
        }

        .nzp-x span {
            top: 18px;
            left: 10px;
            width: 18px;
        }

        .nz-form__grid,
        .nz-form__bottom {
            grid-template-columns: 1fr;
        }

        .nz-field--name,
        .nz-field--email,
        .nz-field--phone,
        .nz-field--directions {
            grid-column: 1;
            grid-row: auto;
        }

        .nz-form__grid,
        .nz-form__bottom {
            gap: 14px;
        }

        .nz-form__bottom {
            padding-top: 14px;
        }

        .nz-directions__menu {
            top: calc(100% + 6px);
            padding: 8px;
        }

        .nz-directions__scroll {
            max-height: 220px;
        }

        .ns {
            padding: 10px;
        }

        .ns-d {
            padding: 24px 18px 22px;
            border-radius: 20px;
        }

        .ns-logo {
            width: 90px;
            height: 96px;
            margin-bottom: 10px;
        }

        .ns-title {
            font-size: 31px;
        }

        .ns-text {
            font-size: 14px;
        }
    }

    @media (max-width: 380px) {
        .nzp-h {
            grid-template-columns: 66px minmax(0, 1fr);
        }

        .nzp-logo {
            width: 66px;
            height: 76px;
        }

        .nzp-title {
            font-size: 21px;
        }
    }
