/* ===== LeadSpark Popup ===== */

:root {
    --ls-primary: #8b5cf6;
    --ls-secondary: #6366f1;
}

/* Reset within popup scope */
.ls-popup *,
.ls-popup *::before,
.ls-popup *::after,
.ls-trigger {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---------- Trigger Button ---------- */

.ls-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--ls-primary), var(--ls-secondary));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
}
.ls-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,.25);
}
.ls-trigger.ls-open .ls-icon-open { display: none; }
.ls-trigger.ls-open .ls-icon-close { display: block; }
.ls-trigger .ls-icon-close { display: none; }

/* ---------- Popup Container ---------- */

.ls-popup {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 9999;
    width: 380px;
    max-height: calc(100dvh - 7rem);
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 60px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: ls-slide-up .25s ease-out;
}

.ls-hidden {
    display: none !important;
}

@keyframes ls-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Header ---------- */

.ls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 8px;
    background: linear-gradient(135deg, rgba(139,92,246,.08), rgba(99,102,241,.08));
    flex-shrink: 0;
}
.ls-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}
.ls-logo-text {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
}
#ls-popup .ls-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
#ls-popup .ls-close:hover {
    background: rgba(0,0,0,.06);
}

/* ---------- Body ---------- */

#ls-popup .ls-body {
    padding: 0 20px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}
#ls-popup .ls-heading {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 12px 0 4px;
    line-height: 1.2;
}
#ls-popup .ls-subtitle {
    font-size: 13px;
    color: #4e4e4e;
    margin-bottom: 16px;
    line-height: normal;
}

#ls-view-form, #ls-view-main {
    overflow: auto;
}

/* ---------- CTA Buttons ---------- */

#ls-popup .ls-cta-primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 16px 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--ls-primary), var(--ls-secondary));
    color: #fff;
    cursor: pointer;
    transition: opacity .15s;
    margin-bottom: 8px;
}
#ls-popup .ls-cta-primary:hover { opacity: .9; }
#ls-popup .ls-cta-secondary, 
#ls-popup .ls-cta-label {
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}
span.ls-cta-desc:empty {
    display: none;
}
.ls-cta-desc {
    font-size: 14px;
    opacity: .85;
    text-transform: initial;
    line-height: 1;
}

.ls-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}
#ls-popup .ls-cta-secondary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
        padding: 12px 12px;
    border-radius: 8px;
    border: 2px solid var(--ls-primary);
    background: linear-gradient(135deg, var(--ls-primary), var(--ls-secondary));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    font-family: 'Poppins';
}
#ls-popup .ls-cta-secondary:hover { opacity: .9; }
#ls-popup .ls-cta-primary span,
#ls-popup .ls-cta-secondary span {
    line-height: 1;
}
#ls-popup .ls-cta-primary svg{
    width: 20px;
    height: 20px;
}
#ls-popup .ls-cta-secondary svg {
    width: 18px;
    height: 18px;
}
/* ---------- Service Tags ---------- */

#ls-popup .ls-services-section {
    margin-bottom: 16px;
}
#ls-popup .ls-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
#ls-popup .ls-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    white-space: nowrap;
    text-transform: inherit;
        font-family: 'Poppins';
    font-weight: 400;
}
#ls-popup .ls-tag:hover {
    border-color: var(--ls-primary);
    background: rgba(139,92,246,.04);
}
#ls-popup .ls-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ls-primary);
    flex-shrink: 0;
    display: none !important;
}

/* ---------- Chat Input ---------- */

#ls-popup .ls-chat-section {
    margin-top: 4px;
}
#ls-popup .ls-services-label, #ls-popup .ls-chat-label {
    font-size: 12px;
    color: #4e4e4e;
    margin-bottom: 6px;
    line-height: normal;
    font-weight: 400;
}
#ls-popup .ls-chat-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s;
}
#ls-popup .ls-chat-input-wrap:focus-within {
    border-color: var(--ls-primary);
    box-shadow: 0 0 0 3px rgba(139,92,246,.1);
}
#ls-popup .ls-chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 13px;
    color: #1f2937;
    background: transparent;
}
#ls-popup .ls-chat-input::placeholder {
    color: #9ca3af;
}
#ls-popup .ls-chat-send {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--ls-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
    flex-shrink: 0;
}
#ls-popup .ls-chat-send:hover {
    color: var(--ls-secondary);
}

/* ---------- Form View ---------- */

.ls-form-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

#ls-gf-wrap {
    margin-bottom: 12px;
}
#ls-gf-wrap .gform_wrapper {
    margin: 0 !important;
    padding: 0 !important;
}
#ls-gf-wrap .gform_wrapper input[type="text"],
#ls-gf-wrap .gform_wrapper input[type="email"],
#ls-gf-wrap .gform_wrapper input[type="tel"],
#ls-gf-wrap .gform_wrapper select,
#ls-gf-wrap .gform_wrapper textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #1f2937 !important;
    background-color: #fff !important;
    transition: border-color .15s, box-shadow .15s !important;
    line-height: 16px;
}
#ls-gf-wrap .gform_wrapper input[type="text"]::placeholder,
#ls-gf-wrap .gform_wrapper input[type="email"]::placeholder,
#ls-gf-wrap .gform_wrapper input[type="tel"]::placeholder,
#ls-gf-wrap .gform_wrapper select::placeholder,
#ls-gf-wrap .gform_wrapper textarea::placeholder{
    color: #9ca3af;
}
#ls-gf-wrap .gform_wrapper input:focus,
#ls-gf-wrap .gform_wrapper select:focus,
#ls-gf-wrap .gform_wrapper textarea:focus {
    border-color: #868686 !important;
    box-shadow: 0 0 5px 3px rgba(139,92,246,.1) !important;
    outline: none !important;
}
#ls-gf-wrap .gform_wrapper .gfield_error input, 
#ls-gf-wrap .gform_wrapper .gfield_error select, #ls-gf-wrap .gform_wrapper .gfield_error textarea {
    border-color: #c02b0a !important;
    background: #c02b0a0f !important;
}
#ls-gf-wrap .gform_wrapper textarea {
    min-height: 80px !important;
    resize: vertical !important;
    height: 80px;
}
#ls-gf-wrap .gform_wrapper .gform_footer,
#ls-gf-wrap .gform_wrapper .gform_page_footer {
    padding: 0 !important;
    margin: 8px 0 0 !important;
}
#ls-gf-wrap .gform_wrapper .gform_button, #ls-gf-wrap .gform_wrapper input[type="submit"] {
    width: 100% !important;
    padding: 12px !important;
    border-radius: 8px !important;
    border: none !important;
    background: linear-gradient(135deg, var(--ls-primary), var(--ls-secondary)) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: opacity .15s !important;
    line-height: normal;
    padding: 10px 12px !important;
}
#ls-gf-wrap .gform_wrapper .gform_button:hover {
    opacity: .9 !important;
}
#ls-gf-wrap .gform_wrapper .gfield_label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 4px !important;
}
#ls-gf-wrap .gform_wrapper .gfield_description,
#ls-gf-wrap .gform_wrapper .gform_title,
#ls-gf-wrap .gform_wrapper .gform_description {
    display: none !important;
}
#ls-gf-wrap .gform_confirmation_message {
    text-align: center;
    padding: 24px 16px;
    color: #adc5c4;
    font-weight: 600;
    font-size: 15px;
}

.ls-gf-placeholder {
    text-align: center;
    padding: 32px 16px;
    color: #9ca3af;
    font-size: 14px;
}

#ls-popup .ls-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    line-height: normal;
    border-radius: 8px;
    transition: background .15s, color .15s;
    width: calc(50% - 6px);
    justify-content: center;
    text-transform: capitalize;
    font-weight: 600;
}
#ls-popup .ls-back:hover {
    background: var(--ls-primary);
    color: #fff;
    opacity: .9 !important;
}

/* ---------- Bottom Bar ---------- */

#ls-popup .ls-bottom-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}
#ls-popup .ls-bottom-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
    border: none;
    background: transparent;
    text-transform: inherit;
    font-family: 'Poppins';
}
#ls-popup .ls-bottom-tab:hover {
    background: #f3f4f6;
}
#ls-popup .ls-bottom-tab + .ls-bottom-tab {
    border-left: 1px solid #e5e7eb;
}
#ls-popup .ls-bottom-tab svg {
    color: var(--ls-primary);
    flex-shrink: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
    .ls-popup {
        left: 12px;
        right: 12px;
        bottom: 88px;
        width: auto;
        max-height: calc(100dvh - 6rem);
    }
    .ls-trigger {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}
