/* Kollecta Popups — exit intent
   Colors come from CSS custom properties printed inline by kp_inline_css(). */

.kp-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--kp-overlay, rgba(0, 0, 0, .7));
    opacity: 0;
    transition: opacity .25s ease;
}

.kp-popup-overlay[hidden] { display: none; }
.kp-popup-overlay.is-visible { opacity: 1; }

.kp-popup-overlay[data-position="bottom-right"] {
    align-items: flex-end;
    justify-content: flex-end;
    background: transparent;
    pointer-events: none;
}

.kp-popup-overlay[data-position="bottom-right"] .kp-popup {
    pointer-events: auto;
    max-width: 420px;
}

/* ---------- Shell ---------- */
.kp-popup {
    position: relative;
    width: 100%;
    max-width: var(--kp-width, 900px);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--kp-bg, #1c1c1c);
    color: var(--kp-text, #f2f1ef);
    border-radius: var(--kp-radius, 16px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    transition: transform .3s ease, opacity .3s ease;
    -webkit-font-smoothing: antialiased;
}

.kp-popup-overlay[data-animation="fade-up"] .kp-popup { transform: translateY(24px); opacity: 0; }
.kp-popup-overlay[data-animation="zoom"]    .kp-popup { transform: scale(.94);      opacity: 0; }
.kp-popup-overlay[data-animation="fade"]    .kp-popup { opacity: 0; }

.kp-popup-overlay.is-visible .kp-popup {
    transform: none;
    opacity: 1;
}

/* ---------- Split grid ---------- */
.kp-popup__grid {
    display: grid;
    grid-template-columns: 1fr;
}

.kp-popup-overlay[data-layout="split"] .kp-popup__grid {
    grid-template-columns: 1fr 1fr;
}

/* ---------- Close ---------- */
.kp-popup__close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 6px;
    background: transparent;
    color: var(--kp-muted, #a09d98);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    line-height: 0;
}

.kp-popup__close svg { width: 100%; height: 100%; display: block; }
.kp-popup__close:hover { color: var(--kp-text, #fff); background: rgba(255, 255, 255, .08); }

/* ---------- Left panel ---------- */
.kp-popup__content {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
}

.kp-popup__badge {
    align-self: flex-start;
    display: inline-block;
    margin-bottom: 28px;
    padding: 8px 16px;
    font-size: 13px;
    line-height: 1;
    font-weight: 500;
    color: var(--kp-text, #f2f1ef);
    border: 1px solid var(--kp-border, #3d3d3d);
    border-radius: 999px;
}

.kp-popup__media { margin-bottom: 22px; }

.kp-popup__media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.kp-popup__title {
    margin: 0 0 16px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--kp-text, #f2f1ef);
}

.kp-popup__text {
    color: var(--kp-muted, #a09d98);
    font-size: 15px;
    line-height: 1.6;
}

.kp-popup__text p { margin: 0 0 14px; }
.kp-popup__text p:last-child { margin-bottom: 0; }

.kp-popup__subtitle {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--kp-muted, #a09d98);
}

/* Bullet lists coming from the SCF Description (wysiwyg) get the same
   checkmark treatment as the manual checklist. */
.kp-popup__list,
.kp-popup__text ul {
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.kp-popup__text ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--kp-text, #f2f1ef);
}

.kp-popup__text ul li:last-child { margin-bottom: 0; }

/* The tick inherits the list item's text color, so it can never end up
   invisible against the panel behind it. */
.kp-popup__text ul li::before {
    content: "";
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 3px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Nested lists keep the same treatment. */
.kp-popup__text ul ul {
    margin: 12px 0 0 4px;
}

.kp-popup__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--kp-text, #f2f1ef);
}

.kp-popup__list li:last-child { margin-bottom: 0; }

.kp-popup__check {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 3px;
    color: currentColor;
}

.kp-popup__btn {
    align-self: flex-start;
    display: inline-block;
    margin-top: 26px;
    padding: 13px 26px;
    background: var(--kp-btn-bg, #fff);
    color: var(--kp-btn-text, #1c1c1c);
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
}

.kp-popup__btn:hover,
.kp-popup__btn:focus { opacity: .9; color: var(--kp-btn-text, #1c1c1c); }

/* ---------- Right panel ---------- */
.kp-popup__form {
    padding: 40px 36px;
    background: var(--kp-panel, #2a2a2a);
}

.kp-popup__form-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--kp-text, #f2f1ef);
}

.kp-popup__form-subtitle {
    margin: 0 0 24px;
    font-size: 13px;
    color: var(--kp-muted, #a09d98);
}

.kp-popup__form-body--inline { padding: 0 36px 36px; }

/* ---------- Contact Form 7 inside the popup ---------- */
.kp-popup__form-body .wpcf7-form > p,
.kp-popup__form-body .wpcf7-form > div > p { margin: 0 0 16px; }

.kp-popup__form-body label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--kp-text, #f2f1ef);
}

.kp-popup__form-body input[type="text"],
.kp-popup__form-body input[type="email"],
.kp-popup__form-body input[type="tel"],
.kp-popup__form-body input[type="url"],
.kp-popup__form-body input[type="number"],
.kp-popup__form-body input[type="date"],
.kp-popup__form-body select,
.kp-popup__form-body textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 14px;
    background: transparent;
    color: var(--kp-text, #f2f1ef);
    border: 1px solid var(--kp-border, #3d3d3d);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    font-family: inherit;
    outline: none;
    transition: border-color .15s ease;
}

.kp-popup__form-body textarea { min-height: 96px; resize: vertical; }

.kp-popup__form-body input::placeholder,
.kp-popup__form-body textarea::placeholder {
    color: var(--kp-muted, #a09d98);
    opacity: .75;
}

.kp-popup__form-body input:focus,
.kp-popup__form-body select:focus,
.kp-popup__form-body textarea:focus {
    border-color: var(--kp-accent, #fff);
}

/* Consent / acceptance checkbox */
.kp-popup__form-body .wpcf7-acceptance .wpcf7-list-item,
.kp-popup__form-body .wpcf7-checkbox .wpcf7-list-item {
    margin: 0 0 6px;
    display: block;
}

.kp-popup__form-body .wpcf7-list-item-label,
.kp-popup__form-body .wpcf7-acceptance label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--kp-muted, #a09d98);
    margin: 0;
}

.kp-popup__form-body input[type="checkbox"],
.kp-popup__form-body input[type="radio"] {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    accent-color: var(--kp-accent, #fff);
}

.kp-popup__form-body a {
    color: var(--kp-text, #f2f1ef);
    text-decoration: underline;
}

/* Submit */
.kp-popup__form-body input[type="submit"],
.kp-popup__form-body button[type="submit"] {
    width: 100%;
    margin-top: 8px;
    padding: 14px 20px;
    background: var(--kp-btn-bg, #fff);
    color: var(--kp-btn-text, #1c1c1c);
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    transition: opacity .15s ease;
}

.kp-popup__form-body input[type="submit"]:hover,
.kp-popup__form-body button[type="submit"]:hover { opacity: .88; }

/* CF7 messages */
.kp-popup__form-body .wpcf7-not-valid-tip {
    margin-top: 6px;
    font-size: 12px;
    color: #ff6b6b;
}

.kp-popup__form-body .wpcf7-response-output {
    margin: 16px 0 0 !important;
    padding: 10px 14px !important;
    border-width: 1px !important;
    border-radius: 8px;
    font-size: 13px;
}

.kp-popup__form-body .wpcf7-spinner { margin: 0 auto; display: block; }
.kp-popup__form-body .wpcf7 form .wpcf7-response-output { color: var(--kp-text, #f2f1ef); }

/* ---------- Responsive ---------- */
@media (max-width: 782px) {
    .kp-popup-overlay { padding: 12px; }

    .kp-popup-overlay[data-layout="split"] .kp-popup__grid {
        grid-template-columns: 1fr;
    }

    .kp-popup__content { padding: 34px 24px 26px; }
    .kp-popup__form    { padding: 26px 24px 32px; }
    .kp-popup__title   { font-size: 24px; }
    .kp-popup__badge   { margin-bottom: 20px; }
    .kp-popup__form-body--inline { padding: 0 24px 28px; }

    .kp-popup-overlay[data-position="bottom-right"] {
        align-items: flex-end;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kp-popup-overlay,
    .kp-popup { transition: none; }
}