/* =====================================================================
   Entry Popup v2.1 – All colors via CSS custom properties
   ===================================================================== */

/* ── Overlay ── */

.entrypopup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    background-color: var(--ep-overlay-color, rgba(0, 0, 0, .6));
}

.entrypopup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ── Modal ── */

.entrypopup-modal {
    position: relative;
    width: 100%;
    max-width: var(--ep-width, 600px);
    background-color: var(--ep-bg-color, #fff);
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
    overflow: hidden;
}

/* ── Animations — initial ── */

.entrypopup-anim-fadeIn {
    opacity: 0;
    transition: opacity .4s ease;
}

.entrypopup-anim-slideDown {
    opacity: 0;
    transform: translateY(-80px);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
}

.entrypopup-anim-slideUp {
    opacity: 0;
    transform: translateY(80px);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
}

.entrypopup-anim-zoomIn {
    opacity: 0;
    transform: scale(.7);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
}

.entrypopup-anim-bounceIn {
    opacity: 0;
    transform: scale(.3);
    transition: transform .5s cubic-bezier(.68, -.55, .265, 1.55), opacity .3s ease;
}

/* ── Animations — visible ── */

.entrypopup-overlay.is-visible .entrypopup-anim-fadeIn {
    opacity: 1;
}

.entrypopup-overlay.is-visible .entrypopup-anim-slideDown,
.entrypopup-overlay.is-visible .entrypopup-anim-slideUp {
    opacity: 1;
    transform: translateY(0);
}

.entrypopup-overlay.is-visible .entrypopup-anim-zoomIn,
.entrypopup-overlay.is-visible .entrypopup-anim-bounceIn {
    opacity: 1;
    transform: scale(1);
}

/* ── Animations — closing ── */

.entrypopup-overlay.is-closing {
    opacity: 0;
}

.entrypopup-overlay.is-closing .entrypopup-anim-slideDown {
    transform: translateY(-50px);
    opacity: 0;
}

.entrypopup-overlay.is-closing .entrypopup-anim-slideUp {
    transform: translateY(50px);
    opacity: 0;
}

.entrypopup-overlay.is-closing .entrypopup-anim-zoomIn {
    transform: scale(.8);
    opacity: 0;
}

.entrypopup-overlay.is-closing .entrypopup-anim-bounceIn {
    transform: scale(.5);
    opacity: 0;
}

/* ── Close button ── */

.entrypopup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, .08);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    color: #555;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.entrypopup-close:hover {
    background: rgba(0, 0, 0, .15);
    color: #000;
    transform: rotate(90deg);
}

.entrypopup-close svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* ── Body ── */

.entrypopup-body {
    padding: 30px 35px 35px;
}

/* ── Title ── */

.entrypopup-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #222;
    line-height: 1.3;
    padding-right: 30px;
}

/* ── Content (WYSIWYG output) ── */

.entrypopup-content {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
}

.entrypopup-content p {
    margin: 0 0 10px;
}

.entrypopup-content p:last-child {
    margin-bottom: 0;
}

.entrypopup-content strong {
    color: #333;
}

.entrypopup-content a {
    color: inherit;
    text-decoration: underline;
}

.entrypopup-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 6px;
}

.entrypopup-content ul,
.entrypopup-content ol {
    margin: 0 0 10px 20px;
    padding: 0;
}

.entrypopup-content blockquote {
    border-left: 3px solid var(--ep-btn-color, #2fb5d2);
    margin: 10px 0;
    padding: 8px 16px;
    color: #666;
    font-style: italic;
}

/* ── Actions ── */

.entrypopup-actions {
    text-align: center;
    margin-top: 25px;
}

/* ── Button ── */

.entrypopup-btn {
    display: inline-block;
    padding: 12px 40px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: .3px;
    line-height: 1.4;
    background-color: var(--ep-btn-color, #2fb5d2);
    transition: filter .2s ease, transform .15s ease, box-shadow .2s ease;
}

.entrypopup-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
    color: #fff;
    text-decoration: none;
}

.entrypopup-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* ── Scroll lock ── */

body.entrypopup-no-scroll {
    overflow: hidden;
}

/* ── Focus (a11y) ── */

.entrypopup-close:focus-visible,
.entrypopup-btn:focus-visible {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .entrypopup-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .entrypopup-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .entrypopup-body {
        padding: 25px 20px 30px;
    }

    .entrypopup-title {
        font-size: 20px;
    }

    .entrypopup-content {
        font-size: 14px;
    }

    .entrypopup-btn {
        width: 100%;
        padding: 14px 30px;
    }
}

@media (max-width: 480px) {
    .entrypopup-body {
        padding: 20px 15px 25px;
    }

    .entrypopup-title {
        font-size: 18px;
    }
}

/* ── Print ── */

@media print {
    .entrypopup-overlay {
        display: none;
    }
}