.np-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    font-family: inherit;
}

.np-popup.is-open {
    display: flex;
}

.np-popup__overlay {
    position: absolute;
    inset: 0;
    background: var(--np-overlay);
    backdrop-filter: blur(3px);
}

.np-popup__dialog {
    position: relative;
    width: min(100%, var(--np-max-width));
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: var(--np-bg);
    color: var(--np-text);
    border-radius: var(--np-radius);
    box-shadow: 0 20px 60px var(--np-shadow);
    outline: none;
    transform: translateY(12px) scale(.98);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
}

.np-popup.is-open .np-popup__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.np-popup__dialog {
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 45, 163, .42) transparent;
    overscroll-behavior: contain;
}

.np-popup__dialog::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.np-popup__dialog::-webkit-scrollbar-track {
    background: transparent;
    margin: 14px 0;
}

.np-popup__dialog::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(79, 45, 163, .38);
    background-clip: padding-box;
}

.np-popup__dialog::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 45, 163, .62);
    background-clip: padding-box;
}

.np-popup__dialog::-webkit-scrollbar-corner {
    background: transparent;
}

.np-popup__gradient {
    display: var(--np-bar-display);
    height: 6px;
    width: 100%;
    background: linear-gradient(90deg, var(--np-accent-2) 0%, var(--np-accent) 50%, var(--np-accent-3) 100%);
}

.np-popup__content {
    padding: 26px 30px 30px;
}

.np-popup__close {
    position: absolute;
    top: 11px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(79,45,163,.08);
    color: var(--np-accent);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, transform .18s ease;
}

.np-popup__close:hover,
.np-popup__close:focus {
    background: rgba(79,45,163,.14);
    transform: rotate(90deg);
}

.np-popup__title {
    margin: 0 38px 8px 0;
    color: var(--np-text);
    font-size: clamp(21px, 2.5vw, 28px);
    line-height: 1.15;
    font-weight: 700;
}

.np-popup__subtitle {
    margin: 0 0 18px;
    color: var(--np-muted);
    font-size: 14px;
    line-height: 1.45;
}

.np-popup__form {
    font-size: 15px;
    line-height: 1.42;
}

.np-popup__form .wpcf7-form p {
    margin: 0 0 10px !important;
}

.np-popup__form label,
.np-popup__form p,
.np-popup__form .wpcf7-list-item-label,
.np-popup__form .wpcf7-form-control-wrap,
.np-popup__form a {
    font-size: 15px !important;
    line-height: 1.42 !important;
}

.np-popup__form label {
    color: var(--np-text);
    font-weight: 500;
}

.np-popup__form input[type="text"],
.np-popup__form input[type="email"],
.np-popup__form input[type="tel"],
.np-popup__form input[type="url"],
.np-popup__form input[type="number"],
.np-popup__form select,
.np-popup__form textarea {
    width: 100% !important;
    min-height: 42px !important;
    border: 1px solid var(--np-field-border) !important;
    border-radius: 11px !important;
    padding: 8px 12px !important;
    background: #fff !important;
    color: var(--np-text) !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.np-popup__form input[type="text"],
.np-popup__form input[type="email"],
.np-popup__form input[type="tel"],
.np-popup__form input[type="url"],
.np-popup__form input[type="number"],
.np-popup__form select {
    height: 42px !important;
}

.np-popup__form textarea {
    height: 118px !important;
    min-height: 98px !important;
    max-height: 150px;
    resize: vertical;
}

.np-popup__form input:focus,
.np-popup__form select:focus,
.np-popup__form textarea:focus {
    border-color: var(--np-accent) !important;
    box-shadow: 0 0 0 3px rgba(79,45,163,.14) !important;
    outline: none;
}

.np-popup__form input[type="submit"],
.np-popup__form button[type="submit"],
.np-popup__form .wpcf7-submit {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 44px !important;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 9px !important;
    background: var(--np-button) !important;
    color: var(--np-button-text) !important;
    padding: 10px 20px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    cursor: pointer;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.np-popup__form input[type="submit"]:hover,
.np-popup__form button[type="submit"]:hover,
.np-popup__form .wpcf7-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(79,45,163,.22);
}

.np-popup__form input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 18px;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px !important;
    margin: 1px 8px 0 0 !important;
    border: 1.5px solid var(--np-field-border) !important;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(79,45,163,.08);
    cursor: pointer;
    vertical-align: -3px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.np-popup__form input[type="checkbox"]:checked {
    border-color: var(--np-accent) !important;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.25 9.05L7.45 12.1L13.85 5.9' stroke='%234f2da3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    box-shadow: 0 5px 13px rgba(79,45,163,.18);
}

.np-popup__form input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--np-accent) !important;
    box-shadow: 0 0 0 3px rgba(79,45,163,.14);
}

.np-popup__form .wpcf7-list-item {
    margin: 0 !important;
}

.np-popup__form .wpcf7-list-item label {
    display: inline-flex !important;
    align-items: flex-start;
    gap: 0;
    font-weight: 400;
}

.np-popup__form .wpcf7-spinner {
    margin: 8px auto 0;
    display: block;
}

.np-popup__form .wpcf7-not-valid-tip {
    color: #d63638;
    font-size: 12.5px !important;
    line-height: 1.25 !important;
    margin-top: 4px;
}

.np-popup__form .wpcf7-response-output {
    margin: 12px 0 0 !important;
    border-radius: 10px;
    padding: 9px 11px !important;
    font-size: 14px !important;
}

body.np-popup-lock {
    overflow: hidden;
}

@media (max-width: 600px) {
    .np-popup {
        padding: 10px;
        align-items: flex-end;
    }

    .np-popup__dialog {
        max-height: calc(100vh - 20px);
        border-radius: var(--np-radius);
    }

    .np-popup__content {
        padding: 24px 18px 22px;
    }

    .np-popup__title {
        margin-right: 34px;
        font-size: 21px;
    }

    .np-popup__subtitle,
    .np-popup__form,
    .np-popup__form label,
    .np-popup__form p,
    .np-popup__form .wpcf7-list-item-label,
    .np-popup__form .wpcf7-form-control-wrap,
    .np-popup__form a {
        font-size: 14px !important;
    }

    .np-popup__form input[type="text"],
    .np-popup__form input[type="email"],
    .np-popup__form input[type="tel"],
    .np-popup__form input[type="url"],
    .np-popup__form input[type="number"],
    .np-popup__form select,
    .np-popup__form textarea,
    .np-popup__form input[type="submit"],
    .np-popup__form button[type="submit"],
    .np-popup__form .wpcf7-submit {
        font-size: 14px !important;
    }
}
