@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* =============================================================
   LX Notes — Popup Manager  (Professional UI v3)
   ============================================================= */

#lx-popup-root * { box-sizing: border-box; }
#lx-popup-root a { text-decoration: none; }

/* ── Overlay backdrop ──────────────────────────────────────── */
.lx-popup-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.58);
    z-index: 99998;
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
    animation: lxFadeIn .25s ease;
}

/* ── Card ──────────────────────────────────────────────────── */
.lx-popup-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.18), 0 24px 64px rgba(0,0,0,.28);
    max-width: 480px; min-width: 320px; width: 100%;
    margin: 0; padding: 0;
    font-family: 'Bitter', Georgia, serif;
}
.lx-popup-card::before {
    content: '';
    display: block; height: 4px; width: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #d946ef);
}

/* ── Entrance animations ───────────────────────────────────── */
.lx-anim-slide-up    { animation: lxSlideUp    .35s cubic-bezier(.16,1,.3,1); }
.lx-anim-fade        { animation: lxFadeIn     .4s ease; }
.lx-anim-scale       { animation: lxScaleIn    .35s cubic-bezier(.16,1,.3,1); }
.lx-anim-slide-right { animation: lxSlideFromRight .35s cubic-bezier(.16,1,.3,1); }

/* ── Close button ──────────────────────────────────────────── */
.lx-popup-close {
    position: absolute; top: .85rem; right: .85rem; z-index: 10;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255,255,255,.22);
    border-radius: 50%; width: 30px; height: 30px;
    padding: 0; margin: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    color: inherit; opacity: .85;
    transition: opacity .15s, background .15s, transform .15s;
}
.lx-popup-close:hover { opacity: 1; background: rgba(255,255,255,.3); transform: scale(1.08); }

/* ── Image with skeleton loader ────────────────────────────── */
.lx-popup-img-wrap {
    position: relative; width: 100%;
    aspect-ratio: 16/9; overflow: hidden;
    background: #e2e8f0;
}
.lx-img-skeleton {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: lxShimmer 1.4s infinite;
}
.lx-popup-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    margin: 0; padding: 0;
    opacity: 0; transition: opacity .3s ease;
}
.lx-popup-img.lx-img-loaded { opacity: 1; }

/* ── Body ──────────────────────────────────────────────────── */
.lx-popup-body { padding: 1.6rem 1.75rem 1.75rem; }
.lx-no-img .lx-popup-body { padding-top: 2.4rem; }

.lx-popup-title {
    font-size: 1.3rem; font-weight: 800; line-height: 1.25;
    margin: 0 0 .4rem; padding-right: 2.2rem;
    letter-spacing: -.02em; display: flex; align-items: center; gap: .4rem;
}
.lx-popup-icon { font-style: normal; flex-shrink: 0; }

.lx-popup-subtitle {
    font-size: .9rem; opacity: .78; margin: 0 0 .85rem;
    line-height: 1.5; font-weight: 500; padding: 0;
}
.lx-popup-text {
    font-size: .875rem; line-height: 1.7; opacity: .75;
    margin: 0 0 1.1rem; padding: 0;
}

/* ── CTA Button with arrow ─────────────────────────────────── */
.lx-popup-btn {
    display: block; width: 100%; text-align: center;
    padding: .8rem 1.5rem; margin: 1.2rem 0 0;
    border-radius: 50px; font-size: .9rem; font-weight: 700;
    font-family: 'Bitter', Georgia, serif;
    text-decoration: none; border: none; cursor: pointer;
    letter-spacing: .02em; line-height: 1.4;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
    transition: opacity .2s, transform .2s, box-shadow .2s, letter-spacing .2s;
    position: relative; overflow: hidden;
}
.lx-popup-btn .lx-btn-arrow {
    display: inline-flex;
    align-items: center;
    transition: transform .2s;
    margin-left: .3rem;
}
.lx-popup-btn:hover { opacity: .9; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.lx-popup-btn:hover .lx-btn-arrow { transform: translateX(4px); }

/* ── Trust signals ─────────────────────────────────────────── */
.lx-popup-trust {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    justify-content: center;
    font-size: .75rem;
    color: #888;
    margin-top: .75rem;
}
.lx-popup-trust span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.lx-popup-trust svg {
    color: #22c55e;
    flex-shrink: 0;
}
[data-theme="dark"] .lx-popup-trust {
    color: #aaa;
}

/* ── Progress dots (multi-step) ────────────────────────────── */
.lx-step-dots {
    display: flex; justify-content: center; gap: .4rem;
    margin: 0 0 1rem; padding: 0;
}
.lx-step-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; opacity: .25;
    transition: opacity .2s, transform .2s;
}
.lx-step-dot.active { opacity: 1; transform: scale(1.3); }

/* ── Sticky bottom bar ─────────────────────────────────────── */
.lx-popup-sticky {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99998;
    display: flex; align-items: center; justify-content: center;
    gap: 1rem; padding: .9rem 1.5rem; margin: 0; flex-wrap: wrap;
    box-shadow: 0 -4px 24px rgba(0,0,0,.22);
    animation: lxSlideFromBottom .3s cubic-bezier(.16,1,.3,1);
    font-family: 'Bitter', Georgia, serif;
    border-top: 1px solid rgba(255,255,255,.1);
}
.lx-popup-sticky .lx-popup-title { font-size: 1rem; font-weight: 700; flex: 1; min-width: 160px; margin: 0; padding: 0; }
.lx-popup-sticky .lx-popup-btn {
    display: inline-block; width: auto; padding: .5rem 1.4rem; margin: 0;
    border-radius: 50px; font-size: .875rem; font-weight: 700;
    text-decoration: none; border: none; cursor: pointer; white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0,0,0,.2); transition: opacity .15s, transform .15s;
}
.lx-popup-sticky .lx-popup-btn:hover { opacity: .88; transform: translateY(-1px); }
.lx-popup-sticky .lx-popup-close {
    position: static; background: rgba(255,255,255,.15);
    border: 1.5px solid rgba(255,255,255,.2); flex-shrink: 0;
}

/* ── Corner widget ─────────────────────────────────────────── */
.lx-popup-corner {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 99998;
    border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 8px 32px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.12);
    max-width: 300px; min-width: 260px; width: calc(100vw - 3rem);
    animation: lxSlideFromRight .3s cubic-bezier(.16,1,.3,1);
    font-family: 'Bitter', Georgia, serif;
}
.lx-popup-corner::before { content: ''; display: block; height: 3px; background: linear-gradient(90deg, #6366f1, #8b5cf6, #d946ef); }
.lx-popup-corner .lx-popup-img-wrap { aspect-ratio: 16/9; }
.lx-popup-corner .lx-popup-body { padding: 2.2rem 1.1rem 1.1rem; }
.lx-popup-corner .lx-popup-title { font-size: 1rem; font-weight: 800; margin: 0 0 .28rem; padding-right: 2rem; letter-spacing: -.01em; }
.lx-popup-corner .lx-popup-subtitle { font-size: .82rem; opacity: .78; margin: 0 0 .65rem; padding: 0; }
.lx-popup-corner .lx-popup-text { font-size: .82rem; opacity: .75; margin: 0 0 .85rem; padding: 0; }
.lx-popup-corner .lx-popup-btn { display: block; width: 100%; text-align: center; padding: .55rem; margin: 0; border-radius: 50px; font-size: .85rem; font-weight: 700; text-decoration: none; border: none; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.2); transition: opacity .15s, transform .15s; }
.lx-popup-corner .lx-popup-btn:hover { opacity: .88; transform: translateY(-1px); }

/* ── Animations ────────────────────────────────────────────── */
@keyframes lxFadeIn          { from { opacity: 0 }                              to { opacity: 1 } }
@keyframes lxSlideUp         { from { transform: translateY(28px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes lxScaleIn         { from { transform: scale(.85); opacity: 0 }       to { transform: none; opacity: 1 } }
@keyframes lxSlideFromBottom { from { transform: translateY(100%) }             to { transform: none } }
@keyframes lxSlideFromRight  { from { transform: translateX(120%) }             to { transform: none } }
@keyframes lxShimmer         { from { background-position: 200% 0 }             to { background-position: -200% 0 } }

/* ── Dark mode (data-theme) ────────────────────────────────── */
[data-theme="dark"] .lx-popup-backdrop { background: rgba(0,0,0,.72); }
[data-theme="dark"] .lx-popup-close { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.15); }
[data-theme="dark"] .lx-popup-close:hover { background: rgba(0,0,0,.6); }
[data-theme="dark"] .lx-img-skeleton { background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%); background-size: 200% 100%; }

/* ── Dark mode (prefers-color-scheme) ─────────────────────── */
@media (prefers-color-scheme: dark) {
    .lx-popup-backdrop { background: rgba(0,0,0,.72); }
    .lx-popup-close { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.15); }
    .lx-popup-close:hover { background: rgba(0,0,0,.6); }
    .lx-img-skeleton { background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%); background-size: 200% 100%; }
}

/* ── Countdown ─────────────────────────────────────────────── */
.lx-popup-countdown { font-size: .82rem; margin: 0 0 .85rem; padding: .4rem .85rem; background: rgba(0,0,0,.2); border-radius: 50px; display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
.lx-cd-timer { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .06em; }

/* ── Email capture ─────────────────────────────────────────── */
.lx-popup-email-form { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0 0; padding: 0; }
.lx-popup-input { width: 100%; padding: .65rem .9rem; margin: 0; border-radius: 50px; border: 1.5px solid rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: inherit; font-size: .875rem; font-family: inherit; outline: none; transition: border-color .15s, background .15s; }
.lx-popup-input::placeholder { opacity: .55; }
.lx-popup-input:focus { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.18); }
.lx-email-success { font-size: .9rem; padding: .6rem; margin: 0; text-align: center; font-weight: 700; }
@media (prefers-color-scheme: dark) { .lx-popup-input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); } }
[data-theme="dark"] .lx-popup-input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }

/* ── Video ─────────────────────────────────────────────────── */
.lx-popup-video-wrap { position: relative; width: 100%; padding-top: 56.25%; margin: 0; background: #000; }
.lx-popup-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; }

/* ── Multi-step ────────────────────────────────────────────── */
.lx-next-btn { display: block; width: 100%; text-align: center; margin: .9rem 0 0; padding: .72rem; border-radius: 50px; font-size: .9rem; font-weight: 700; border: none; cursor: pointer; font-family: inherit; box-shadow: 0 3px 10px rgba(0,0,0,.2); transition: opacity .15s, transform .15s; }
.lx-next-btn:hover { opacity: .88; transform: translateY(-1px); }
.lx-step-2 { animation: lxSlideUp .3s cubic-bezier(.16,1,.3,1); }

/* ── A/B winner badge ──────────────────────────────────────── */
.lx-ab-winner-badge { position: absolute; top: .75rem; left: .9rem; background: #22c55e; color: #fff; font-size: .68rem; font-weight: 800; padding: .18rem .5rem; margin: 0; border-radius: 50px; text-transform: uppercase; letter-spacing: .06em; z-index: 10; }

/* ── Background image ──────────────────────────────────────── */
.lx-popup-has-bg { background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; }
.lx-popup-bg-overlay { position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none; }
.lx-popup-has-bg .lx-popup-close, .lx-popup-has-bg .lx-popup-body { position: relative; z-index: 1; }
.lx-popup-has-bg .lx-popup-img-wrap { display: none; }
.lx-popup-has-bg .lx-popup-title { text-shadow: 0 1px 6px rgba(0,0,0,.55); }
.lx-popup-has-bg .lx-popup-subtitle, .lx-popup-has-bg .lx-popup-text { text-shadow: 0 1px 4px rgba(0,0,0,.45); }

/* ── Print ─────────────────────────────────────────────────── */
@media print { #lx-popup-root { display: none !important; } }

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .lx-popup-card { border-radius: 14px; min-width: 0; }
    .lx-popup-body { padding: 1.4rem 1.25rem 1.5rem; }
    .lx-no-img .lx-popup-body { padding-top: 2.2rem; }
    .lx-popup-title { font-size: 1.15rem; }
    .lx-popup-corner { bottom: 1rem; right: 1rem; max-width: calc(100vw - 2rem); }
    .lx-popup-sticky .lx-popup-title { font-size: .9rem; }
    .lx-popup-countdown { font-size: .78rem; }
    .lx-popup-input { font-size: .84rem; }
    .lx-popup-trust { font-size: .72rem; }
}
