/* ================================================================
   BoothCRM v3 — Demo Popup
   Desktop: 960px, two-column (40 navy / 60 white)
   Mobile: bottom-sheet, single column
   ================================================================ */

/* ── Overlay ──────────────────────────────────────────────────── */
.demo-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 12, 24, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.demo-popup-overlay[hidden] { display: none !important; }
.demo-popup-overlay.is-open { opacity: 1; }

/* ── Dialog shell ─────────────────────────────────────────────── */
.demo-popup-dialog {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 960px;
    max-height: calc(100dvh - 32px);
    max-height: calc(100svh - 32px); /* safe area aware */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07);
    transform: translateY(28px) scale(.97);
    transition: transform .38s cubic-bezier(.16,.84,.44,1);
}
.demo-popup-overlay.is-open .demo-popup-dialog { transform: none; }

/* ── Close button ─────────────────────────────────────────────── */
.demo-popup-close {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 20;
    width: 34px; height: 34px;
    display: flex;
    align-items: center; justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.1);
    color: #fff;
    cursor: pointer;
    transition: background .2s;
    padding: 0;
}
.demo-popup-close:hover { background: rgba(255,255,255,.2); }
.demo-popup-close svg {
    width: 16px; height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
}

/* ================================================================
   LEFT PANEL  (40%)
   ================================================================ */
.demo-popup-left {
    position: relative;
    flex: 0 0 40%;
    overflow: hidden;
    background: linear-gradient(155deg, #111827 0%, #0F172A 45%, #0c1728 100%);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 44px 32px 36px;
}

/* Grid pattern */
.demo-popup-left::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(249,115,22,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249,115,22,.05) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* Orange ambient glow */
.demo-popup-left::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -60px;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(249,115,22,.16) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Left: decorative SVG art ─────────────────────────────────── */
.popup-art {
    position: absolute;
    top: 0; right: 0;
    bottom: 0; left: 0;
    pointer-events: none;
    overflow: hidden;
}

.popup-art-qr {
    position: absolute;
    top: 24px; right: 20px;
    opacity: .13;
}

.popup-art-card {
    position: absolute;
    bottom: 80px; right: 16px;
    opacity: .11;
}

.popup-art-wave {
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
    opacity: .06;
}

/* ── Left: content ────────────────────────────────────────────── */
.popup-left-inner { position: relative; z-index: 1; }

.popup-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(249,115,22,.12);
    border: 1px solid rgba(249,115,22,.25);
    color: #fb923c;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 100px;
    margin-bottom: 18px;
}

.demo-popup-left h2 {
    font-size: clamp(19px, 2.1vw, 24px);
    font-weight: 800;
    color: #fff;
    line-height: 1.22;
    letter-spacing: -.025em;
    margin-bottom: 12px;
}
.demo-popup-left h2 span { color: #F97316; }

.demo-popup-left .popup-sub {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.65;
    margin-bottom: 26px;
}

/* Checklist */
.popup-checklist {
    list-style: none;
    padding: 0; margin: 0 0 28px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.popup-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.45;
}
.popup-check-icon {
    flex-shrink: 0;
    width: 17px; height: 17px;
    margin-top: 1px;
    background: rgba(249,115,22,.18);
    border-radius: 50%;
    display: flex;
    align-items: center; justify-content: center;
}
.popup-check-icon svg {
    width: 9px; height: 9px;
    stroke: #F97316;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Trust note */
.popup-trust {
    margin-top: auto;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 14px 16px;
    position: relative;
    z-index: 1;
}
.popup-trust-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 5px;
}
.popup-trust-heading svg {
    width: 14px; height: 14px;
    stroke: #22c55e;
    stroke-width: 2;
    fill: none;
}
.popup-trust p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
}

/* ================================================================
   RIGHT PANEL  (60%)
   ================================================================ */
.demo-popup-right {
    flex: 1;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0; /* allow flex child to shrink and scroll */
    -webkit-overflow-scrolling: touch;
}

/* Form view */
.demo-popup-form-view {
    padding: 36px 36px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.demo-popup-form-view[hidden] { display: none; }

.demo-popup-right h3 {
    font-size: clamp(17px, 1.9vw, 21px);
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -.025em;
    margin-bottom: 5px;
}
.popup-form-intro {
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 22px;
}

/* ── Fluent Forms global overrides (scoped to popup) ──────────── */
.demo-popup-form-view .ff-el-group {
    margin-bottom: 14px !important;
}
.demo-popup-form-view .ff-el-input--label label,
.demo-popup-form-view label {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 5px !important;
    display: block;
}
.demo-popup-form-view .ff-el-form-control,
.demo-popup-form-view input[type="text"],
.demo-popup-form-view input[type="email"],
.demo-popup-form-view input[type="tel"],
.demo-popup-form-view input[type="number"],
.demo-popup-form-view select,
.demo-popup-form-view textarea {
    width: 100% !important;
    padding: 0 13px !important;
    height: 42px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    color: #0F172A !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    transition: border-color .2s, box-shadow .2s, background .2s !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    -webkit-appearance: none;
    appearance: none;
}
.demo-popup-form-view textarea {
    height: 88px !important;
    padding: 10px 13px !important;
    resize: vertical !important;
}
.demo-popup-form-view .ff-el-form-control:focus,
.demo-popup-form-view input:focus,
.demo-popup-form-view select:focus,
.demo-popup-form-view textarea:focus {
    outline: none !important;
    border-color: #F97316 !important;
    box-shadow: 0 0 0 3px rgba(249,115,22,.11) !important;
    background: #fff !important;
}
.demo-popup-form-view select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 36px !important;
    cursor: pointer !important;
}

/* Submit button */
.demo-popup-form-view .ff_submit_btn_container { margin-top: 6px; }
.demo-popup-form-view .ff-btn-submit,
.demo-popup-form-view button[type="submit"] {
    width: 100% !important;
    height: 48px !important;
    background: #F97316 !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    letter-spacing: -.01em !important;
    box-shadow: 0 4px 16px rgba(249,115,22,.38) !important;
    transition: background .2s, transform .15s, box-shadow .2s !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}
.demo-popup-form-view .ff-btn-submit:hover,
.demo-popup-form-view button[type="submit"]:hover {
    background: #ea580c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 22px rgba(249,115,22,.46) !important;
}
.demo-popup-form-view .ff-btn-submit:active,
.demo-popup-form-view button[type="submit"]:active {
    transform: none !important;
}

/* Validation errors */
.demo-popup-form-view .error,
.demo-popup-form-view .ff-el-is-error .ff-el-form-control {
    border-color: #ef4444 !important;
}
.demo-popup-form-view .error { color: #ef4444; font-size: 11.5px; margin-top: 3px; }

/* ── Response text below submit ───────────────────────────────── */
.popup-response-note {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
}

/* ── Conversion enhancers ─────────────────────────────────────── */
.popup-enhancers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}
.popup-enhancers span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}
.popup-enhancers span::before {
    content: '✓';
    flex-shrink: 0;
    color: #22c55e;
    font-weight: 800;
    font-size: 12px;
}

/* ── Popup footer ─────────────────────────────────────────────── */
.popup-legal {
    margin-top: 14px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.5;
}
.popup-legal a { color: #F97316; text-decoration: none; }
.popup-legal a:hover { text-decoration: underline; }

/* ================================================================
   SUCCESS SCREEN
   ================================================================ */
.demo-popup-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 36px;
    flex: 1;
}
.demo-popup-success[hidden] { display: none; }

.success-emoji {
    font-size: 54px;
    line-height: 1;
    margin-bottom: 18px;
    display: block;
    animation: popIn .45s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes popIn {
    from { transform: scale(.35); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.demo-popup-success h3 {
    font-size: 22px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -.025em;
    margin-bottom: 12px;
}
.demo-popup-success p {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.65;
    margin-bottom: 8px;
    max-width: 360px;
}
.demo-popup-success p a { color: #F97316; text-decoration: none; }
.demo-popup-success p a:hover { text-decoration: underline; }

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 290px;
    margin-top: 28px;
}
.success-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    background: #F97316;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(249,115,22,.35);
    transition: background .2s;
    font-family: inherit;
}
.success-btn-primary:hover { background: #ea580c; }
.success-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    background: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    font-family: inherit;
}
.success-btn-secondary:hover { border-color: #0F172A; color: #0F172A; }

/* ── Body lock ────────────────────────────────────────────────── */
body.popup-open { overflow: hidden; }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* ================================================================
   RESPONSIVE — single-column stacked below 900px
   ================================================================ */
@media (max-width: 900px) {

    /* ── Overlay: allow full scroll ─────────────────────────────── */
    .demo-popup-overlay {
        padding: 16px;
        align-items: flex-start;
        overflow-y: auto;
    }

    /* ── Dialog: single column, scrollable ──────────────────────── */
    .demo-popup-dialog {
        flex-direction: column;
        max-width: 560px;
        width: 100%;
        max-height: none;       /* let content define height */
        height: auto;
        border-radius: 20px;
        transform: translateY(20px) scale(.97);
        margin: auto;           /* center vertically when content is short */
    }
    .demo-popup-overlay.is-open .demo-popup-dialog {
        transform: none;
    }

    /* ── Left panel: full-width stacked section ─────────────────── */
    .demo-popup-left {
        flex: 0 0 auto;
        width: 100%;
        padding: 32px 28px 24px;
    }
    /* Show all left-panel content — nothing hidden */
    .popup-sub,
    .popup-checklist,
    .popup-trust {
        display: block !important;
    }
    .popup-checklist { display: flex !important; }
    .popup-art { display: none; } /* decorative only, hide to save space */

    .popup-eyebrow { margin-bottom: 14px; }
    .demo-popup-left h2 { font-size: clamp(18px, 4vw, 22px); margin-bottom: 10px; }
    .demo-popup-left .popup-sub { font-size: 13px; margin-bottom: 20px; }
    .popup-checklist { gap: 8px; margin-bottom: 20px; }
    .popup-checklist li { font-size: 12.5px; }

    /* Trust badge: horizontal layout to save space */
    .popup-trust { padding: 12px 14px; }
    .popup-trust-heading { font-size: 12px; }
    .popup-trust p { font-size: 11.5px; }

    /* ── Right panel: full-width form ───────────────────────────── */
    .demo-popup-right {
        overflow-y: visible; /* let page scroll, not inner panel */
    }
    .demo-popup-form-view { padding: 28px 28px 24px; }
    .demo-popup-right h3 { font-size: 19px; }
    .popup-form-intro { font-size: 13px; margin-bottom: 18px; }
    .popup-enhancers { grid-template-columns: 1fr 1fr; }

    /* ── Close button stays top-right of navy panel ─────────────── */
    .demo-popup-close {
        top: 12px; right: 12px;
        background: rgba(255,255,255,.15);
        color: #fff;
    }
    .demo-popup-close:hover { background: rgba(255,255,255,.25); }
}

/* ── Mobile: ≤ 600px ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .demo-popup-overlay { padding: 12px; }

    .demo-popup-dialog {
        max-width: 100%;
        border-radius: 18px;
    }

    .demo-popup-left { padding: 28px 20px 20px; }
    .demo-popup-left h2 { font-size: 18px; }
    .demo-popup-left .popup-sub { font-size: 12.5px; }
    .popup-checklist li { font-size: 12px; }

    .demo-popup-form-view { padding: 24px 20px 20px; }
    .demo-popup-right h3 { font-size: 17px; }
    .popup-form-intro { font-size: 12.5px; margin-bottom: 14px; }

    /* Prevent iOS zoom on input focus */
    .demo-popup-form-view .ff-el-form-control,
    .demo-popup-form-view input[type="text"],
    .demo-popup-form-view input[type="email"],
    .demo-popup-form-view input[type="tel"],
    .demo-popup-form-view input[type="number"],
    .demo-popup-form-view select,
    .demo-popup-form-view textarea {
        font-size: 16px !important;
    }

    .popup-enhancers { grid-template-columns: 1fr; gap: 6px; }
    .popup-enhancers span { white-space: normal; }
    .popup-response-note { font-size: 11px; }
    .popup-legal { font-size: 10.5px; }
}

/* ── Very small: ≤ 380px ─────────────────────────────────────── */
@media (max-width: 380px) {
    .demo-popup-overlay { padding: 8px; }
    .demo-popup-left { padding: 22px 16px 16px; }
    .demo-popup-form-view { padding: 20px 16px 18px; }
    .popup-enhancers { display: none; }
}
