/* ============================================================
   Global Lead Capture Popup - Ecom Launchers
   Design tokens mirror the site: #F4A530 accent, #212121 text,
   #FCFCFC surfaces, #C3C3C5 borders, Montserrat + Raleway.
   ============================================================ */

.lead-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 16, 32, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lead-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.lead-popup-card {
    position: relative;
    width: min(560px, 100%);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    transform: scale(0.92) translateY(14px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.lead-popup-overlay.is-open .lead-popup-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.lead-popup-card.is-closing {
    transform: scale(0.94) translateY(10px);
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .lead-popup-overlay,
    .lead-popup-card,
    .lead-popup-card.is-closing {
        transition: none;
    }
}

/* ---------- Header ---------- */
.lead-popup-head {
    padding: 28px 28px 0;
    text-align: center;
}

.lead-popup-logo {
    height: 84px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 18px;
}

.lead-popup-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.25em;
    color: #212121;
    margin: 0 0 8px;
}

.lead-popup-desc {
    font-family: 'Raleway', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5em;
    color: rgba(60, 66, 75, 0.72);
    margin: 0;
}

.lead-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FCFCFC;
    color: #C3C3C5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.lead-popup-close:hover {
    color: #FFFFFF;
    background: #212121;
}

.lead-popup-close:focus-visible {
    outline: 2px solid #F4A530;
    outline-offset: 2px;
}

/* ---------- Body / Form ---------- */
.lead-popup-body {
    padding: 22px 28px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.lead-popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lead-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.lead-field-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2em;
    color: #212121;
    text-align: start;
}

.lead-field-label .lead-req {
    color: #F4A530;
}

.lead-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4em;
    color: #212121;
    background: #FCFCFC;
    border: 1px solid #C3C3C5;
    border-radius: 8px;
    padding: 8px 16px;
    min-height: 47px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lead-input::placeholder {
    color: #C3C3C5;
    opacity: 1;
}

.lead-input:focus {
    border-color: #F4A530;
    box-shadow: 0 0 0 3px rgba(244, 165, 48, 0.18);
}

.lead-input.has-error {
    border-color: #E5484D;
}

.lead-input.has-error:focus {
    box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.15);
}

.lead-error-msg {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3em;
    color: #E5484D;
    margin: 0;
    display: none;
}

.lead-error-msg.is-visible {
    display: block;
}

/* ---------- Searchable grouped combobox ---------- */
.lead-cbx {
    position: relative;
    width: 100%;
    min-width: 0;
}

.lead-cbx-input-wrap {
    position: relative;
}

.lead-cbx-input {
    padding-right: 44px;
    cursor: text;
}

.lead-cbx-caret {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #C3C3C5;
    font-size: 13px;
    pointer-events: none;
    transition: transform 0.3s ease, color 0.3s ease;
}

.lead-cbx.is-open .lead-cbx-caret {
    transform: translateY(-50%) rotate(180deg);
    color: #F4A530;
}

.lead-cbx-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 230px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #FFFFFF;
    border: 1px solid #C3C3C5;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    display: none;
}

.lead-cbx.is-open .lead-cbx-list {
    display: block;
}

.lead-cbx-group {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #F4A530;
    padding: 10px 16px 5px;
    cursor: default;
}

.lead-cbx-option {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35em;
    color: #212121;
    padding: 9px 16px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.lead-cbx-option:hover {
    background: #FCFCFC;
}

.lead-cbx-option.is-highlighted {
    background: #FCFCFC;
}

.lead-cbx-option.is-selected {
    background: #F4A530;
    color: #FFFFFF;
}

.lead-cbx-empty {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    color: #C3C3C5;
    padding: 12px 16px;
    text-align: center;
    cursor: default;
}

/* Conditional custom-service field */
.lead-custom-field {
    display: none;
}

.lead-custom-field.is-visible {
    display: flex;
}

/* ---------- Submit button ---------- */
.lead-popup-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 16px;
    color: #FFFFFF;
    background: #F4A530;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    min-height: 50px;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s ease;
    gap: 10px;
}

.lead-popup-submit:hover {
    background: #212121;
}

.lead-popup-submit:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.lead-spinner {
    display: none;
    font-size: 16px;
}

.lead-popup-submit.is-loading .lead-spinner {
    display: inline-block;
}

/* ---------- Status messages ---------- */
.lead-status {
    display: none;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45em;
    text-align: center;
    padding: 12px 16px;
    border-radius: 8px;
}

.lead-status.is-visible {
    display: block;
}

.lead-status-error {
    color: #A12932;
    background: #FDECEC;
    border: 1px solid #F5C6C9;
}

/* ---------- Success state ---------- */
.lead-success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 34px 10px 26px;
    gap: 14px;
}

.lead-success.is-visible {
    display: flex;
}

.lead-success-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4A530;
    color: #FFFFFF;
    border-radius: 50%;
    font-size: 28px;
}

.lead-success-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3em;
    color: #212121;
    margin: 0;
}

.lead-success-desc {
    font-family: 'Raleway', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5em;
    color: rgba(60, 66, 75, 0.72);
    margin: 0;
}

/* ---------- Scroll lock ---------- */
body.lead-popup-locked {
    overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 576px) {
    .lead-popup-card {
        border-radius: 16px;
    }

    .lead-popup-head {
        padding: 24px 18px 0;
    }

    .lead-popup-logo {
        height: 64px;
        margin-bottom: 14px;
    }

    .lead-popup-title {
        font-size: 20px;
    }

    .lead-popup-desc {
        font-size: 14px;
    }

    .lead-popup-body {
        padding: 18px 18px 22px;
    }

    .lead-popup-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }
}
