/* ==========================================================================
   Conversion popup (qp-*): desktop two-column dialog, phone bottom sheet
   ========================================================================== */

.qp {
    position: fixed;
    inset: 0;
    z-index: 100000001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qp[hidden] {
    display: none;
}

html.qp-lock,
html.qp-lock body {
    overflow: hidden !important;
}

.qp__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 6, 30, 0.66);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.qp--open .qp__backdrop {
    opacity: 1;
}

.qp__dialog {
    position: relative;
    width: min(940px, 100%);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.qp--open .qp__dialog {
    opacity: 1;
    transform: none;
}

.qp__close {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 16px;
    color: #421f61;
    background: #f3eef6;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.qp__close:hover {
    background: #e8def0;
    transform: rotate(90deg);
}

/* ---------- visual (project slideshow) ---------- */

.qp__visual {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    background: linear-gradient(160deg, #4a1f6e, #2a1140);
}

.qp__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(42, 17, 64, 0.85) 0%, rgba(42, 17, 64, 0) 45%);
    pointer-events: none;
}

.qp__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.9s ease;
}

.qp__slide.is-active {
    opacity: 1;
}

.qp__visual-badge {
    position: absolute;
    z-index: 2;
    bottom: 22px;
    inset-inline-start: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.qp__visual-badge strong {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: #dea8e4;
}

.qp__visual-badge span {
    font-size: 14px;
    font-weight: 700;
}

/* ---------- content ---------- */

.qp__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 44px 40px 36px;
    overflow-y: auto;
}

.qp__logo {
    height: 34px;
    width: auto;
    margin-bottom: 2px;
}

.qp__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    color: #421f61;
    background: #f3dcf6;
}

.qp__title {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 31px);
    font-weight: 800;
    line-height: 1.4;
    color: #2a1140;
}

.qp__lead {
    margin: 0;
    font-size: 16px;
    line-height: 1.8;
    color: #5f4b70;
}

.qp__points {
    list-style: none;
    margin: 2px 0 6px;
    padding: 0;
    display: grid;
    gap: 9px;
    width: 100%;
}

.qp__points li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #421f61;
}

.qp__points i {
    font-size: 17px;
    color: #25d366;
}

.qp__cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px 22px;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 800;
    color: #fff !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #2fe07a, #25d366 45%, #128c4b);
    box-shadow: 0 16px 30px -14px rgba(18, 140, 75, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: qp-pulse 2.6s ease-in-out infinite;
}

.qp__cta i {
    font-size: 24px;
}

.qp__cta:hover {
    transform: translateY(-2px);
}

.qp__secondary {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 14.5px;
    font-weight: 700;
    color: #7a5d90 !important;
    text-decoration: none !important;
}

.qp__secondary:hover {
    color: #421f61 !important;
}

.qp__secondary i {
    font-size: 12px;
}

[dir="rtl"] .qp__flip {
    transform: scaleX(-1);
}

@keyframes qp-pulse {
    0%, 100% { box-shadow: 0 16px 30px -14px rgba(18, 140, 75, 0.8), 0 0 0 0 rgba(37, 211, 102, 0.35); }
    50% { box-shadow: 0 16px 30px -14px rgba(18, 140, 75, 0.8), 0 0 0 10px rgba(37, 211, 102, 0); }
}

/* ---------- tablets & phones: bottom sheet ---------- */

@media (max-width: 767px) {
    .qp {
        align-items: flex-end;
        padding: 0;
    }

    .qp__dialog {
        width: 100%;
        max-height: 92vh;
        grid-template-columns: 1fr;
        border-radius: 26px 26px 0 0;
        transform: translateY(100%);
    }

    .qp--open .qp__dialog {
        transform: none;
    }

    /* image becomes a slim banner on top */
    .qp__visual {
        height: 130px;
        min-height: 0;
    }

    .qp__visual-badge {
        bottom: 12px;
        padding: 7px 12px;
    }

    .qp__visual-badge strong {
        font-size: 21px;
    }

    .qp__content {
        padding: 22px 22px calc(24px + env(safe-area-inset-bottom));
        gap: 12px;
    }

    .qp__logo {
        display: none;
    }

    .qp__title {
        font-size: 22px;
    }

    .qp__lead {
        font-size: 14.5px;
        line-height: 1.7;
    }

    .qp__points {
        gap: 7px;
    }

    .qp__points li {
        font-size: 14px;
    }

    .qp__close {
        top: 10px;
        background: rgba(255, 255, 255, 0.92);
    }
}

@media (prefers-reduced-motion: reduce) {
    .qp__cta {
        animation: none;
    }

    .qp__dialog,
    .qp__backdrop {
        transition: none;
    }
}
