/* ===== LeadSpark (Hager & Schwartz) ===== */
/* Styled to Figma: "Lead trapping pop-up" (file ty1Xl0uQhe8kkAIrpmSfpf, node 51:59) */

:root {
    --ls-primary: #B34D24;   /* orange */
    --ls-secondary: #00233D; /* navy */
    --ls-tertiary: #0E5C7E;  /* blue */
    --ls-bar: #0B4A68;
    --ls-font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

/* ---------- Trigger pill ---------- */
.ls-trigger {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    background: var(--ls-secondary);
    color: #fff;
    font-family: var(--ls-font);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0, 35, 61, .28);
    transition: transform .2s, background-color .2s;
}
.ls-trigger:hover { transform: translateY(-2px); }
.ls-trigger:focus-visible { outline: 3px solid var(--ls-primary); outline-offset: 3px; }
.ls-trigger > span { display: inline-flex; align-items: center; gap: 10px; }
.ls-trigger .ls-trigger-close { display: none; }
.ls-trigger.ls-open { background: var(--ls-tertiary); }
.ls-trigger.ls-open .ls-trigger-open { display: none; }
.ls-trigger.ls-open .ls-trigger-close { display: inline-flex; }

/* ---------- Popup ---------- */
.ls-popup {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 99999;
    width: 400px;
    max-height: calc(100dvh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 35, 61, .28), 0 0 0 1px rgba(0, 35, 61, .06);
    font-family: var(--ls-font);
    color: var(--ls-secondary);
    animation: ls-slide-up .22s ease-out;
}
@keyframes ls-slide-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

#ls-view-main, #ls-view-form { overflow: auto; overscroll-behavior: contain; flex: 1 1 auto; }

#ls-popup .ls-body { padding: 22px 22px 20px; }

#ls-popup .ls-heading {
    font-family: var(--ls-font);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ls-secondary);
    margin-bottom: 18px;
    letter-spacing: 0;
    text-transform: none;
}

/* ---------- CTA buttons ---------- */
#ls-popup .ls-cta-primary,
#ls-popup .ls-cta-secondary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-family: var(--ls-font);
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
    transition: filter .15s, transform .15s;
}
#ls-popup .ls-cta-primary:hover,
#ls-popup .ls-cta-secondary:hover { filter: brightness(1.08); }
#ls-popup .ls-cta-primary:focus-visible,
#ls-popup .ls-cta-secondary:focus-visible { outline: 3px solid var(--ls-secondary); outline-offset: 2px; }

#ls-popup .ls-cta-primary {
    min-height: 112px;
    margin-bottom: 12px;
    background: var(--ls-primary);
    font-size: 20px;
}
#ls-popup .ls-cta-primary svg { width: 30px; height: 30px; }

.ls-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
#ls-popup .ls-cta-secondary {
    min-height: 104px;
    font-size: 18px;
}
#ls-popup .ls-cta-secondary svg { width: 26px; height: 26px; }
#ls-popup .ls-cta-email { background: var(--ls-secondary); }
#ls-popup .ls-cta-contact { background: var(--ls-tertiary); }
#ls-popup .ls-cta-contact:hover { color: #fff; }

/* ---------- Message box ---------- */
#ls-popup .ls-chat-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 400;
    color: var(--ls-secondary);
    line-height: 1.3;
}
#ls-popup .ls-chat-label strong { color: var(--ls-primary); font-weight: 700; }
#ls-popup .ls-chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border: 1.5px solid var(--ls-primary);
    border-radius: 8px;
    background: #fff;
}
#ls-popup .ls-chat-input-wrap:focus-within { box-shadow: 0 0 0 3px rgba(179, 77, 36, .15); }
#ls-popup .ls-chat-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--ls-font);
    font-size: 15px;
    color: var(--ls-secondary);
    box-shadow: none;
}
#ls-popup .ls-chat-input::placeholder { color: #6b7780; }
#ls-popup .ls-chat-send {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5dbe0;
    border-radius: 6px;
    background: #fff;
    color: var(--ls-secondary);
    cursor: pointer;
}
#ls-popup .ls-chat-send:hover { color: var(--ls-primary); border-color: var(--ls-primary); }

/* ---------- Spanish strip ---------- */
#ls-popup .ls-strip {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #f3f4f5;
    border-top: 1px solid #e3e6e8;
    flex-shrink: 0;
}
#ls-popup .ls-strip-menu {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--ls-secondary);
    cursor: pointer;
}
#ls-popup .ls-strip-text {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ls-secondary);
}
#ls-popup .ls-strip-badge { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; justify-self: end; }

/* ---------- Bottom bar ---------- */
#ls-popup .ls-bottom-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--ls-bar);
    flex-shrink: 0;
}
#ls-popup .ls-bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 64px;
    padding: 10px 4px;
    border: 0;
    background: transparent;
    color: #fff;
    font-family: var(--ls-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
    transition: background-color .15s;
}
#ls-popup .ls-bottom-tab:hover { background: rgba(255, 255, 255, .08); color: #fff; }
#ls-popup .ls-bottom-tab + .ls-bottom-tab { border-left: 1px solid rgba(255, 255, 255, .18); }
#ls-popup .ls-tab-badge { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* ---------- Form view ---------- */
#ls-popup .ls-form-desc {
    font-size: 15px;
    line-height: 1.45;
    color: #3c4a55;
    margin: -6px 0 14px;
}
#ls-gf-wrap { margin-bottom: 8px; }
#ls-gf-wrap .gform_wrapper { margin: 0 !important; padding: 0 !important; }
#ls-gf-wrap .gform_wrapper .gform_fields { row-gap: 12px !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 textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #cfd6db !important;
    border-radius: 8px !important;
    font-family: var(--ls-font) !important;
    font-size: 15px !important;
    color: var(--ls-secondary) !important;
    background: #fff !important;
    line-height: 1.3 !important;
}
#ls-gf-wrap .gform_wrapper input:focus,
#ls-gf-wrap .gform_wrapper textarea:focus {
    border-color: var(--ls-primary) !important;
    box-shadow: 0 0 0 3px rgba(179, 77, 36, .15) !important;
    outline: none !important;
}
#ls-gf-wrap .gform_wrapper textarea { min-height: 84px !important; height: 84px !important; resize: vertical !important; }
#ls-gf-wrap .gform_wrapper .gfield_label {
    font-family: var(--ls-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ls-secondary) !important;
    margin-bottom: 4px !important;
}
#ls-gf-wrap .gform_wrapper .gform_title,
#ls-gf-wrap .gform_wrapper .gform_description,
#ls-gf-wrap .gform_wrapper .gform_required_legend { display: none !important; }
#ls-gf-wrap .gform_wrapper .gform_footer { padding: 0 !important; margin: 12px 0 0 !important; }
#ls-gf-wrap .gform_wrapper .gform_button,
#ls-gf-wrap .gform_wrapper input[type="submit"] {
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--ls-primary) !important;
    color: #fff !important;
    font-family: var(--ls-font) !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}
#ls-gf-wrap .gform_wrapper .gfield_error input,
#ls-gf-wrap .gform_wrapper .gfield_error textarea { border-color: #c02b0a !important; }
#ls-gf-wrap .gform_confirmation_message {
    padding: 18px 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ls-secondary);
}
.ls-gf-placeholder { padding: 24px 8px; text-align: center; color: #6b7780; font-size: 14px; }

#ls-popup .ls-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ls-secondary);
    font-family: var(--ls-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
#ls-popup .ls-back:hover { background: #f0f2f4; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    .ls-trigger { right: 16px; bottom: 16px; min-height: 48px; padding: 0 20px; font-size: 16px; }
    .ls-popup {
        left: 10px;
        right: 10px;
        bottom: 76px;
        width: auto;
        max-height: calc(100dvh - 92px);
    }
    #ls-popup .ls-body { padding: 18px 16px 16px; }
    #ls-popup .ls-heading { font-size: 26px; margin-bottom: 14px; }
    #ls-popup .ls-cta-primary { min-height: 88px; }
    #ls-popup .ls-cta-secondary { min-height: 84px; font-size: 16px; }
    #ls-popup .ls-bottom-tab { min-height: 56px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .ls-popup { animation: none; }
    .ls-trigger, #ls-popup .ls-cta-primary, #ls-popup .ls-cta-secondary { transition: none; }
}
