/* File: inc/fsjp-popup.css */

/* ── Box-sizing reset (scoped) ──
   Fixes the horizontal scrollbar: buttons with width:100% + padding
   were overflowing because they weren't border-box. */
.fsjpOverlay,
.fsjpOverlay * {
    box-sizing: border-box;
}

/* ── Lock background scroll while the popup is open ──
   :has() watches for the overlay being shown (JS sets inline display:flex).
   Freezes both html and body so the page behind cannot scroll. */
html:has(.fsjpOverlay[style="flex"]),
body:has(.fsjpOverlay[style*="flex"]) {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}

/* ── Overlay ── */
.fsjpOverlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overscroll-behavior: contain;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* ── Loader (spinner card) ── */
.fsjpLoader {
    background: #fff;
    width: 480px;
    max-width: 94vw;
    padding: 60px 32px;
    border-radius: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
}

.fsjpSpinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e8eaf0;
    border-top: 5px solid #6c7ee1;
    border-radius: 50%;
    animation: fsjpSpin 0.85s linear infinite;
}

@keyframes fsjpSpin {
    0% { transform: rotate(0) }
    100% { transform: rotate(360deg) }
}

/* ── Popup box ── */
.fsjpBox {
    background: #fff;
    width: 460px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding: 30px 30px 28px;
    border-radius: 22px;
    text-align: left;
    position: relative;
    box-shadow: 0 18px 60px rgba(13,27,62,0.28);
}

/* ── Step counter pill  e.g. "Step 1 of 3" ── */
.fsjpStepCounter {
    display: inline-block;
    background: linear-gradient(90deg,#5b6ef0,#8048f0);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 6px 15px;
    border-radius: 30px;
    margin-bottom: 16px;
    box-shadow: 0 5px 14px rgba(96,72,240,0.35);
}

/* ── Question heading + chevron ── */
.fsjpStep {
    display: none;
}

.fsjpStep h4 {
    font-size: 22px;
    font-weight: 800;
    color: #0d1b3e;
    margin: 0 0 4px;
    line-height: 1.32;
}

.fsjpStep h4::after {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    margin: 14px auto 22px;
    border-right: 4px solid #ff7a2b;
    border-bottom: 4px solid #6a5cff;
    border-radius: 2px;
    transform: rotate(45deg);
}

/* ── Option rows (gradient pills with play icon) ── */
.fsjpOptList {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fsjpOptList li {
    margin-bottom: 12px;
    list-style: none;
}

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

.fsjpOptList li button.fsjpBtn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 18px;
    border: none !important;
    border-radius: 13px !important;
    cursor: pointer;
    text-align: left;
    background: linear-gradient(90deg,#e81d8e 0%,#b3279d 52%,#7d2fd0 100%) !important;
    box-shadow: 0 7px 18px rgba(123,47,247,0.30) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    height: auto !important;
    letter-spacing: 0;
    text-transform: none;
}

.fsjpOptList li button.fsjpBtn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 12px 24px rgba(123,47,247,0.40);
}

.fsjpOptList li button.fsjpBtn:active {
    transform: translateY(0);
}

.fsjpOptList li button.fsjpBtn::before {
    content: "\25B6";
    flex: 0 0 auto;
    font-size: 16px;
    color: #fff;
    line-height: 1;
}

.fsjpOptLabel {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.fsjpOptSelect {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    margin-left: auto;
}

/* ── Button animations ── */
.fsjpOptList li button.fsjpBtn {
    position: relative;
    overflow: hidden;
}

.fsjpOptList li {
    animation: fsjpInUp 0.5s cubic-bezier(.2,.7,.3,1) both;
}

.fsjpOptList li:nth-child(1) { animation-delay: 0.06s; }
.fsjpOptList li:nth-child(2) { animation-delay: 0.16s; }
.fsjpOptList li:nth-child(3) { animation-delay: 0.26s; }
.fsjpOptList li:nth-child(4) { animation-delay: 0.36s; }
.fsjpOptList li:nth-child(5) { animation-delay: 0.46s; }

.fsjpOptList li button.fsjpBtn::before {
    animation: fsjpPulse 1.9s ease-in-out infinite;
}

.fsjpOptList li button.fsjpBtn::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -75%;
    width: 55%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.40), transparent);
    transform: skewX(-22deg);
    pointer-events: none;
    opacity: 0;
    z-index: 3;
}

.fsjpOptList li button.fsjpBtn:hover::after {
    animation: fsjpShine 0.75s ease;
}

.fsjpStep h4::after {
    animation: fsjpBounce 1.6s ease-in-out infinite;
}

@keyframes fsjpInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

@keyframes fsjpPulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

@keyframes fsjpShine {
    0% { left: -75%; opacity: 1; }
    100% { left: 130%; opacity: 1; }
}

@keyframes fsjpBounce {
    0%,100% { transform: rotate(45deg) translate(0,0); }
    50% { transform: rotate(45deg) translate(3px,3px); }
}

@media (prefers-reduced-motion: reduce) {
    .fsjpOptList li,
    .fsjpOptList li button.fsjpBtn::before,
    .fsjpStep h4::after,
    .fsjpOptList li button.fsjpBtn:hover::after {
        animation: none !important;
    }
}

/* ── "Continue" button for single-type steps ── */
.fsjpContinueBtn {
    display: block;
    width: 100%;
    padding: 16px;
    background: #0d1b3e;
    color: #fff;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s;
    box-shadow: none !important;
    height: auto !important;
    letter-spacing: 0;
    text-transform: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.fsjpContinueBtn:hover {
    opacity: 0.85;
}

/* ── Final step reward-ads UI ── */
.fsjpAdHint {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin: 0 0 20px;
}

.fsjpRewardBtn {
    display: block;
    width: 100%;
    background: #0d1b3e;
    color: #fff;
    border: none !important;
    border-radius: 14px !important;
    padding: 20px 32px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.18s, transform 0.1s;
    margin-top: 8px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    line-height: normal;
    box-shadow: none !important;
    height: auto !important;
    letter-spacing: 0;
    text-transform: none;
}

button.fsjpRewardBtn:hover,
button.fsjpRewardBtn:focus {
    color: #fff;
    text-decoration: none;
    border: none;
}

.fsjpRewardBtn:hover {
    background: #1a2f5e;
    transform: translateY(-1px);
}

/* progress gate shown after "See the Options" */
.fsjpOverlay.fsjpGateActive {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.fsjpGate {
    width: 480px;
    max-width: 90vw;
    text-align: center;
    padding: 20px;
}

.fsjpGate .fsjpPct {
    font-size: 42px;
    font-weight: 800;
    color: #0d1b3e;
    margin-bottom: 18px;
    line-height: 1;
}

.fsjpGate .fsjpBar {
    height: 8px;
    background: #e8eaf0;
    border-radius: 6px;
    overflow: hidden;
    max-width: 360px;
    margin: 0 auto;
}

.fsjpGate .fsjpBar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #0d1b3e;
    border-radius: 6px;
    transition: width .35s ease;
}

.fsjpGate .fsjpGateMsg {
    margin-top: 16px;
    color: #0d1b3e;
    font-size: 15px;
}

@media (max-width: 600px) {
    .fsjpOverlay {
        align-items: center;
        justify-content: center;
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .fsjpBox {
        margin: auto;
        width: 100%;
        max-width: 100%;
        max-height: none;
        padding: 24px 18px 20px;
        border-radius: 14px;
    }

    .fsjpLoader {
        max-width: 100%;
        padding: 40px 20px;
    }

    .fsjpOptList li button.fsjpBtn {
        padding: 14px 16px;
    }

    .fsjpStep h4 {
        font-size: 20px;
    }

    .fsjpContinueBtn {
        padding: 14px;
    }
}