/* =========================================================================
   WEMA WEALTH AFRICA — LEAD GEN POPUP STYLES
   Brand: #49121a deep wine (primary) · #f8991d warm orange (accent)
   ========================================================================= */

:root {
    --wema-primary:        #49121a;
    --wema-primary-deep:   #2a0a0e;
    --wema-accent:         #f8991d;
    --wema-accent-deep:    #d6800f;
    --wema-ink:            #122F2A;
    --wema-soft:           #5A6F6A;
    --wema-cream:          #F6F7F4;
    --wema-line:           #E2E5E0;
    --wema-white:          #FFFFFF;
    --wema-shadow-sm:      0 4px 16px rgba(73,18,26,0.10);
    --wema-shadow-md:      0 18px 56px rgba(73,18,26,0.22);
    --wema-shadow-lg:      0 28px 80px rgba(73,18,26,0.30);
    --wema-radius-card:    20px;
    --wema-radius-input:   12px;
    --wema-radius-pill:    999px;
    --wema-font-stack:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------------------------------------------
   TRIGGER BUTTONS
   -------------------------------------------------------------- */
.wema-leadgen-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wema-primary);
    color: var(--wema-white);
    border: none;
    border-radius: var(--wema-radius-pill);
    padding: 14px 28px;
    font-family: var(--wema-font-stack);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background-color .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 8px 24px rgba(73,18,26,0.25);
    text-decoration: none;
    line-height: 1;
}

.wema-leadgen-trigger:hover {
    background: var(--wema-primary-deep);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(73,18,26,0.35);
}

.wema-leadgen-trigger:focus-visible {
    outline: 3px solid var(--wema-accent);
    outline-offset: 3px;
}

/* --------------------------------------------------------------
   FLOATING DOCK — 3 stacked actions (WhatsApp / Get Involved / Donate)
   Always-visible labels · responsive across breakpoints
   -------------------------------------------------------------- */
.wema-lg-dock {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.wema-lg-dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 22px 0 18px;
    background: var(--wema-primary);
    color: var(--wema-white);
    border: none;
    border-radius: var(--wema-radius-pill);
    font-family: var(--wema-font-stack);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    transition: transform .18s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow .2s, background-color .2s;
    white-space: nowrap;
    line-height: 1;
}

.wema-lg-dock-btn:hover,
.wema-lg-dock-btn:focus-visible {
    transform: translateX(-3px);
    box-shadow: 0 16px 36px rgba(0,0,0,0.25);
    outline: none;
}

.wema-lg-dock-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.wema-lg-dock-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

/* Three per-button colours */
.wema-lg-dock-whatsapp { background: #25D366; }
.wema-lg-dock-whatsapp:hover { background: #1da851; }

.wema-lg-dock-partner { background: var(--wema-primary); }
.wema-lg-dock-partner:hover { background: var(--wema-primary-deep); }

.wema-lg-dock-donate { background: var(--wema-accent); color: var(--wema-ink); }
.wema-lg-dock-donate:hover { background: var(--wema-accent-deep); color: var(--wema-white); }

/* Pulse halo on the Get Involved button to draw the eye */
.wema-lg-dock-partner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--wema-radius-pill);
    box-shadow: 0 0 0 0 rgba(73,18,26,0.55);
    animation: wemaPulse 2.4s infinite;
    pointer-events: none;
}
.wema-lg-dock-partner { position: relative; }

@keyframes wemaPulse {
    0%   { box-shadow: 0 0 0 0   rgba(73,18,26,0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(73,18,26,0); }
    100% { box-shadow: 0 0 0 0   rgba(73,18,26,0); }
}

/* Legacy single-button fallback (kept so old shortcodes keep working) */
.wema-leadgen-fab {
    position: fixed !important;
    bottom: 28px;
    right: 28px;
    z-index: 99998;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: var(--wema-radius-pill);
    background: var(--wema-accent);
    box-shadow: 0 12px 32px rgba(248,153,29,0.45);
    justify-content: center;
}

.wema-leadgen-fab:hover {
    background: var(--wema-accent-deep);
}

/* --------------------------------------------------------------
   OVERLAY  (full-screen darkening behind the modal)
   -------------------------------------------------------------- */
.wema-lg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 12, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .25s ease;
    overflow-y: auto;
}

.wema-lg-overlay[hidden] {
    display: none;
}

.wema-lg-overlay.wema-lg-open {
    opacity: 1;
}

/* Lock body scroll while popup is open (added by JS) */
body.wema-lg-locked {
    overflow: hidden !important;
}

/* --------------------------------------------------------------
   MODAL CONTAINER
   -------------------------------------------------------------- */
.wema-lg-modal {
    background: var(--wema-white);
    border-radius: var(--wema-radius-card);
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: var(--wema-shadow-lg);
    display: flex;
    flex-direction: column;
    font-family: var(--wema-font-stack);
    color: var(--wema-ink);
    transform: translateY(20px) scale(0.97);
    transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wema-lg-overlay.wema-lg-open .wema-lg-modal {
    transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------
   HERO STRIP (top of modal)
   -------------------------------------------------------------- */
.wema-lg-hero {
    position: relative;
    background: linear-gradient(135deg, var(--wema-primary) 0%, var(--wema-primary-deep) 100%);
    color: var(--wema-white);
    padding: 36px 32px 28px;
}

.wema-lg-hero-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--wema-white);
    line-height: 1.2;
}

.wema-lg-hero-sub {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    font-weight: 400;
    line-height: 1.5;
}

.wema-lg-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: var(--wema-radius-pill);
    background: rgba(255,255,255,0.18);
    color: var(--wema-white);
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wema-lg-close:hover {
    background: rgba(255,255,255,0.32);
}

/* Progress bar */
.wema-lg-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.18);
}

.wema-lg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--wema-accent) 0%, #ffb957 100%);
    transition: width .35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------
   FORM BODY — scrolls when content exceeds viewport
   -------------------------------------------------------------- */
.wema-lg-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px;
    background: var(--wema-white);
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--wema-primary) transparent;
}

.wema-lg-body::-webkit-scrollbar {
    width: 6px;
    height: 0 !important;
}
.wema-lg-body::-webkit-scrollbar-thumb {
    background: var(--wema-primary);
    border-radius: var(--wema-radius-pill);
}

.wema-lg-form {
    margin: 0;
}

/* --------------------------------------------------------------
   STEPS
   -------------------------------------------------------------- */
.wema-lg-step {
    animation: wemaStepIn .35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wema-lg-step[hidden] {
    display: none;
}

@keyframes wemaStepIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wema-lg-step-label {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--wema-accent-deep);
}

.wema-lg-step-title {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 800;
    color: var(--wema-ink);
    line-height: 1.25;
    letter-spacing: -0.3px;
}

/* --------------------------------------------------------------
   STEP 1 — PATH SELECTION CARDS
   -------------------------------------------------------------- */
.wema-lg-path-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.wema-lg-path-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
    border: 2px solid var(--wema-line);
    border-radius: var(--wema-radius-card);
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s, background-color .2s;
    background: var(--wema-white);
}

.wema-lg-path-card:hover {
    border-color: var(--wema-primary);
    box-shadow: var(--wema-shadow-sm);
    transform: translateY(-2px);
}

.wema-lg-path-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wema-lg-path-card:has(input:checked),
.wema-lg-path-card.is-selected {
    border-color: var(--wema-primary);
    background: linear-gradient(135deg, rgba(73,18,26,0.04) 0%, rgba(248,153,29,0.04) 100%);
    box-shadow: var(--wema-shadow-sm);
}

.wema-lg-path-icon {
    font-size: 28px;
    margin-bottom: 8px;
    line-height: 1;
}

.wema-lg-path-name {
    font-weight: 800;
    font-size: 16px;
    color: var(--wema-ink);
    margin-bottom: 4px;
}

.wema-lg-path-desc {
    font-size: 13px;
    color: var(--wema-soft);
    line-height: 1.45;
}

/* --------------------------------------------------------------
   FIELD GRID (Steps 2–4)
   -------------------------------------------------------------- */
.wema-lg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.wema-lg-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wema-lg-field-full {
    grid-column: 1 / -1;
}

.wema-lg-field label {
    display: block;
    color: var(--wema-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.wema-lg-field input,
.wema-lg-field select,
.wema-lg-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    border: 2px solid var(--wema-line);
    border-radius: var(--wema-radius-input);
    background: var(--wema-white);
    color: var(--wema-ink);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
}

.wema-lg-field textarea {
    resize: vertical;
    min-height: 110px;
}

.wema-lg-field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2349121a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 46px;
    cursor: pointer;
}

.wema-lg-field input:focus,
.wema-lg-field select:focus,
.wema-lg-field textarea:focus {
    border-color: var(--wema-primary);
    box-shadow: 0 0 0 4px rgba(73,18,26,0.10);
    outline: none;
}

.wema-lg-field input::placeholder,
.wema-lg-field textarea::placeholder {
    color: #A8B0AA;
}

.wema-lg-field.has-error input,
.wema-lg-field.has-error select,
.wema-lg-field.has-error textarea {
    border-color: #C44C3A;
    box-shadow: 0 0 0 4px rgba(196,76,58,0.12);
}

/* Radio pills (preferred contact) — fully custom, native input hidden */
.wema-lg-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wema-lg-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 14px;
    border: 2px solid var(--wema-line);
    border-radius: var(--wema-radius-pill);
    cursor: pointer;
    font-size: 14px;
    color: var(--wema-ink);
    font-weight: 600;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    background: var(--wema-white);
    user-select: none;
}

.wema-lg-radio:hover {
    border-color: var(--wema-primary);
    box-shadow: 0 4px 14px rgba(73,18,26,0.10);
}

/* Visually hide native radio input but keep accessible */
.wema-lg-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

/* Custom radio circle */
.wema-lg-radio-mark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--wema-line);
    background: var(--wema-white);
    flex-shrink: 0;
    transition: border-color .2s, background-color .2s;
    position: relative;
}

.wema-lg-radio:hover .wema-lg-radio-mark {
    border-color: var(--wema-primary);
}

.wema-lg-radio:has(input:checked) {
    border-color: var(--wema-primary);
    background: rgba(73,18,26,0.06);
}

.wema-lg-radio:has(input:checked) .wema-lg-radio-mark {
    border-color: var(--wema-primary);
    background: var(--wema-primary);
}

.wema-lg-radio:has(input:checked) .wema-lg-radio-mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--wema-white);
}

.wema-lg-radio-text {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

/* Keyboard focus ring */
.wema-lg-radio:has(input:focus-visible) {
    box-shadow: 0 0 0 4px rgba(248,153,29,0.30);
}

/* ----- CHECKBOX (newsletter opt-in) ----- */
.wema-lg-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid var(--wema-line);
    border-radius: var(--wema-radius-input);
    cursor: pointer;
    background: var(--wema-white);
    transition: border-color .2s, background-color .2s;
}

.wema-lg-checkbox:hover {
    border-color: var(--wema-primary);
    background: rgba(73,18,26,0.03);
}

.wema-lg-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

.wema-lg-checkbox-mark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--wema-line);
    border-radius: 6px;
    background: var(--wema-white);
    flex-shrink: 0;
    margin-top: 1px;
    position: relative;
    transition: border-color .2s, background-color .2s;
}

.wema-lg-checkbox:has(input:checked) {
    border-color: var(--wema-primary);
    background: rgba(73,18,26,0.04);
}

.wema-lg-checkbox:has(input:checked) .wema-lg-checkbox-mark {
    border-color: var(--wema-primary);
    background: var(--wema-primary);
}

.wema-lg-checkbox:has(input:checked) .wema-lg-checkbox-mark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--wema-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wema-lg-checkbox-text {
    flex: 1;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--wema-ink);
    line-height: 1.5;
    margin-bottom: 0;
}

/* --------------------------------------------------------------
   THANK YOU
   -------------------------------------------------------------- */
.wema-lg-thanks {
    text-align: center;
    padding: 40px 20px 20px;
}

.wema-lg-thanks-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: var(--wema-radius-pill);
    background: linear-gradient(135deg, var(--wema-primary) 0%, var(--wema-accent) 100%);
    color: var(--wema-white);
    margin-bottom: 24px;
}

.wema-lg-thanks-msg {
    font-size: 16px;
    color: var(--wema-soft);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

.wema-lg-thanks .wema-lg-step-title {
    margin-bottom: 12px;
}

/* --------------------------------------------------------------
   ACTION ROW (Back / Continue / Submit)
   -------------------------------------------------------------- */
.wema-lg-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--wema-line);
}

.wema-lg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background-color .2s, color .2s, transform .15s, box-shadow .2s;
    line-height: 1;
}

.wema-lg-btn-back {
    background: transparent;
    color: var(--wema-soft);
    padding: 12px 18px;
    border-radius: var(--wema-radius-pill);
}

.wema-lg-btn-back:hover {
    background: rgba(0,0,0,0.04);
    color: var(--wema-ink);
}

.wema-lg-btn-primary {
    background: var(--wema-primary);
    color: var(--wema-white);
    padding: 16px 32px;
    border-radius: var(--wema-radius-pill);
    box-shadow: 0 8px 24px rgba(73,18,26,0.25);
    margin-left: auto;
}

.wema-lg-btn-primary:hover {
    background: var(--wema-primary-deep);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(73,18,26,0.35);
}

.wema-lg-btn-primary[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wema-lg-btn-primary.is-submitting {
    pointer-events: none;
    opacity: 0.7;
}

.wema-lg-btn-primary.is-submitting::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: var(--wema-white);
    border-radius: 50%;
    animation: wemaSpin .7s linear infinite;
}

@keyframes wemaSpin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------
   ERROR BAR
   -------------------------------------------------------------- */
.wema-lg-error {
    margin-top: 16px;
    padding: 14px 18px;
    background: #FDEEEC;
    border-left: 4px solid #C44C3A;
    border-radius: var(--wema-radius-input);
    color: #8B2C20;
    font-size: 14px;
    font-weight: 500;
}

/* --------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------- */
@media (max-width: 640px) {
    .wema-lg-overlay {
        padding: 0;
        align-items: stretch;
    }

    .wema-lg-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .wema-lg-hero {
        padding: 28px 22px 22px;
    }

    .wema-lg-hero-title {
        font-size: 22px;
    }

    .wema-lg-body {
        padding: 24px 20px;
    }

    .wema-lg-path-grid {
        grid-template-columns: 1fr;
    }

    .wema-lg-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .wema-lg-step-title {
        font-size: 20px;
    }

    .wema-lg-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .wema-lg-btn-primary,
    .wema-lg-btn-back {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .wema-leadgen-fab {
        bottom: 18px;
        right: 18px;
        width: 54px;
        height: 54px;
    }

    .wema-lg-dock {
        bottom: 14px;
        right: 14px;
        gap: 10px;
    }

    .wema-lg-dock-btn {
        height: 46px;
        padding: 0 18px 0 16px;
        gap: 8px;
        font-size: 13px;
    }

    .wema-lg-dock-btn svg {
        width: 18px;
        height: 18px;
    }

    .wema-lg-dock-label {
        font-size: 13px;
    }
}

/* Very narrow phones — keep icon + short label but tighter */
@media (max-width: 380px) {
    .wema-lg-dock-btn {
        height: 44px;
        padding: 0 14px 0 13px;
        font-size: 12px;
    }

    .wema-lg-dock-label {
        font-size: 12px;
    }
}
