/* ==========================================================================
   LeadPro – Premium Frontend Styles  v2.0
   "WOW-factor" redesign: glassmorphism header, animated trigger,
   micro-interactions, full heading + sub-heading visibility.
   ========================================================================== */

/* ── Google Font import (Outfit – modern, professional) ───────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── Root variables (overridden per-form via inline style) ────────────── */
.lp-widget {
    --lp-primary:      #6366f1;
    --lp-secondary:    #4f46e5;
    --lp-btn-text:     #ffffff;
    --lp-bg:           #ffffff;
    --lp-font:         'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Derived — do NOT override these via inline style */
    --lp-radius-xl:    20px;
    --lp-radius-lg:    14px;
    --lp-radius-md:    10px;
    --lp-radius-sm:    8px;
    --lp-shadow-float: 0 24px 80px rgba(0,0,0,.22), 0 8px 24px rgba(0,0,0,.12);
    --lp-shadow-card:  0 4px 32px rgba(0,0,0,.14);
    --lp-ease:         cubic-bezier(.4, 0, .2, 1);
    --lp-dur:          .26s;
}

.lp-widget *, .lp-widget *::before, .lp-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   TRIGGER BUTTON
══════════════════════════════════════════════════════════════════════════ */
.lp-widget.lp-mode-floating .lp-trigger,
.lp-widget.lp-mode-slidein  .lp-trigger {
    position: fixed;
    z-index: 99990;
    bottom: 28px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 22px 13px 16px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--lp-font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #fff;
    background: linear-gradient(135deg, var(--lp-primary) 0%, var(--lp-secondary) 100%);
    box-shadow: 0 6px 28px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.14);
    transition: transform var(--lp-dur) var(--lp-ease),
                box-shadow var(--lp-dur) var(--lp-ease);
    white-space: nowrap;
    position: fixed;
}
.lp-widget.lp-pos-bottom-right .lp-trigger { right: 28px; }
.lp-widget.lp-pos-bottom-left  .lp-trigger { left: 28px; }

.lp-trigger:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,.32), 0 4px 12px rgba(0,0,0,.16);
}
.lp-trigger:active { transform: translateY(-1px) scale(1); }

/* Live green dot */
.lp-trigger-pulse {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74,222,128,.6);
    animation: lpPing 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes lpPing {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.7); }
    70%  { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.lp-trigger-icon { display: flex; align-items: center; opacity: .9; }
.lp-trigger-label { font-weight: 700; }
.lp-trigger-stars { font-size: 10px; letter-spacing: 1px; opacity: .8; }

/* ══════════════════════════════════════════════════════════════════════════
   PANEL / CARD
══════════════════════════════════════════════════════════════════════════ */
.lp-panel {
    width: 100%;
    max-width: 400px;
    background: var(--lp-bg);
    border-radius: var(--lp-radius-xl);
    overflow: hidden;
    font-family: var(--lp-font);
}

/* Floating mode: fixed centered popup */
.lp-mode-floating .lp-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 99992;
    transform: translate(-50%, -46%) scale(.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--lp-shadow-float);
    transition:
        opacity var(--lp-dur) var(--lp-ease),
        transform var(--lp-dur) var(--lp-ease),
        visibility var(--lp-dur);
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.15) transparent;
}
.lp-mode-floating.lp-open .lp-panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Slide-in mode: slides from corner */
.lp-mode-slidein .lp-panel {
    position: fixed;
    z-index: 99992;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    box-shadow: var(--lp-shadow-float);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    scrollbar-width: thin;
    transition:
        opacity var(--lp-dur) var(--lp-ease),
        transform var(--lp-dur) var(--lp-ease),
        visibility var(--lp-dur);
}
.lp-mode-slidein.lp-pos-bottom-right .lp-panel { right: 28px; bottom: 90px; transform: translateY(20px); }
.lp-mode-slidein.lp-pos-bottom-left  .lp-panel { left: 28px;  bottom: 90px; transform: translateY(20px); }
.lp-mode-slidein.lp-open .lp-panel {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Inline mode: always visible */
.lp-mode-inline .lp-panel {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: var(--lp-shadow-card);
}

/* ══════════════════════════════════════════════════════════════════════════
   HEADER  ← where heading + subheading live
══════════════════════════════════════════════════════════════════════════ */
.lp-panel-header {
    position: relative;
    padding: 32px 28px 28px;
    background: linear-gradient(135deg, var(--lp-primary) 0%, var(--lp-secondary) 100%);
    overflow: hidden;
    /* Ensure text is always on top of decorative blobs */
    isolation: isolate;
}

/* Decorative blobs */
.lp-header-blob {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    pointer-events: none;
    z-index: 0;
}
.lp-header-blob--1 { width: 160px; height: 160px; top: -60px; right: -50px; }
.lp-header-blob--2 { width: 100px; height: 100px; bottom: -40px; left: -30px; background: rgba(255,255,255,.05); }
.lp-header-blob--3 { width: 60px;  height: 60px;  top: 20px; left: 50%; background: rgba(255,255,255,.06); }

/* Badge / logo */
.lp-header-badge {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
    color: #fff;
    margin-bottom: 16px;
}
.lp-logo {
    position: relative; z-index: 1;
    height: 40px; max-width: 160px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 14px;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.2));
}

/* ─── HEADING ─── the main title – was missing styles, now always visible */
.lp-heading {
    position: relative; z-index: 1;
    font-family: var(--lp-font);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;            /* always white on gradient */
    letter-spacing: -.01em;
    margin: 0 0 8px 0;
    text-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ─── SUB HEADING ─── the description line – was missing styles */
.lp-subheading {
    position: relative; z-index: 1;
    font-family: var(--lp-font);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(255,255,255,.88);  /* slightly transparent white */
    margin: 0 0 16px 0;
}

/* Trust row */
.lp-header-trust {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.2);
}
.lp-trust-stars { font-size: 11px; color: #fbbf24; letter-spacing: 1px; }
.lp-trust-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.9); }

/* Close button */
.lp-close {
    position: absolute; z-index: 2;
    top: 14px; right: 14px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.25);
    cursor: pointer;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--lp-dur);
}
.lp-close:hover { background: rgba(255,255,255,.32); }

/* ══════════════════════════════════════════════════════════════════════════
   FORM BODY
══════════════════════════════════════════════════════════════════════════ */
.lp-form-body { background: var(--lp-bg); }
.lp-form {
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Field ──────────────────────────────────────────────────────────────── */
.lp-field { display: flex; flex-direction: column; gap: 6px; }

.lp-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--lp-font);
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.lp-label-icon { opacity: .55; flex-shrink: 0; }
.lp-req { color: #ef4444; margin-left: 1px; font-weight: 700; }

/* Input wrapper — hosts the focus ring pseudo */
.lp-input-wrap {
    position: relative;
}

.lp-input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-family: var(--lp-font);
    font-size: 14px;
    font-weight: 400;
    color: #111827;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--lp-radius-md);
    outline: none;
    transition:
        border-color var(--lp-dur) var(--lp-ease),
        background var(--lp-dur) var(--lp-ease),
        box-shadow var(--lp-dur) var(--lp-ease);
    -webkit-appearance: none;
}
.lp-input::placeholder { color: #9ca3af; }
.lp-input:hover:not(:focus) { border-color: #d1d5db; background: #f3f4f6; }
.lp-input:focus {
    border-color: var(--lp-primary);
    background: #fff;
    box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--lp-primary) 16%, transparent);
}
.lp-input.lp-error-input {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
.lp-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.lp-select { cursor: pointer; }

.lp-error {
    font-family: var(--lp-font);
    font-size: 11.5px;
    font-weight: 500;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 16px;
    animation: lpErrIn .18s ease;
}
@keyframes lpErrIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

/* ── Submit button ──────────────────────────────────────────────────────── */
.lp-submit {
    position: relative;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--lp-radius-md);
    cursor: pointer;
    font-family: var(--lp-font);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--lp-btn-text);
    background: linear-gradient(135deg, var(--lp-primary) 0%, var(--lp-secondary) 100%);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--lp-primary) 45%, transparent),
                0 1px 4px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    transition:
        transform var(--lp-dur) var(--lp-ease),
        box-shadow var(--lp-dur) var(--lp-ease),
        opacity var(--lp-dur);
    margin-top: 4px;
}
.lp-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--lp-dur);
}
.lp-submit:hover:not(:disabled)  {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px color-mix(in srgb, var(--lp-primary) 55%, transparent),
                0 2px 8px rgba(0,0,0,.16);
}
.lp-submit:hover:not(:disabled)::after { background: rgba(255,255,255,.06); }
.lp-submit:active:not(:disabled)  { transform: translateY(0); }
.lp-submit:disabled { opacity: .55; cursor: not-allowed; }

.lp-submit-text   { position: relative; z-index: 1; }
.lp-submit-arrow  {
    position: relative; z-index: 1;
    display: flex; align-items: center;
    transition: transform var(--lp-dur) var(--lp-ease);
}
.lp-submit:hover .lp-submit-arrow { transform: translateX(3px); }

/* Spinner (replaces text + arrow while loading) */
.lp-submit-spinner {
    display: none;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lpSpin .55s linear infinite;
}
.lp-submit.lp-loading .lp-submit-text,
.lp-submit.lp-loading .lp-submit-arrow  { display: none; }
.lp-submit.lp-loading .lp-submit-spinner { display: block; }

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

/* ── Messages ───────────────────────────────────────────────────────────── */
.lp-form-message {
    display: none;
    padding: 11px 14px;
    border-radius: var(--lp-radius-sm);
    font-family: var(--lp-font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}
.lp-form-message.lp-msg-error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    animation: lpErrIn .2s ease;
}

/* Privacy note */
.lp-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: var(--lp-font);
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    padding-top: 4px;
}
.lp-privacy svg { opacity: .6; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   THANK YOU SCREEN
══════════════════════════════════════════════════════════════════════════ */
.lp-thankyou {
    padding: 48px 28px 44px;
    text-align: center;
    background: var(--lp-bg);
    position: relative;
    overflow: hidden;
    animation: lpFadeUp .4s var(--lp-ease) both;
}
.lp-thankyou-glow {
    position: absolute;
    top: -60px; left: 50%; transform: translateX(-50%);
    width: 200px; height: 200px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--lp-primary) 10%, transparent);
    filter: blur(40px);
    pointer-events: none;
}
.lp-thankyou-check {
    width: 68px; height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 28px rgba(34,197,94,.38);
    animation: lpBounceIn .5s var(--lp-ease) .1s both;
}
.lp-thankyou-title {
    font-family: var(--lp-font);
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}
.lp-thankyou-msg {
    font-family: var(--lp-font);
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
    max-width: 280px;
    margin: 0 auto;
}

@keyframes lpFadeUp   { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes lpBounceIn { 0% { transform:scale(.5); opacity:0; } 70% { transform:scale(1.1); } 100% { transform:scale(1); opacity:1; } }

/* ══════════════════════════════════════════════════════════════════════════
   OVERLAY (backdrop)
══════════════════════════════════════════════════════════════════════════ */
.lp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99991;
    background: rgba(15,15,30,.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--lp-dur), visibility var(--lp-dur);
    cursor: pointer;
}
.lp-mode-floating.lp-open .lp-overlay { opacity: 1; visibility: visible; }

/* ══════════════════════════════════════════════════════════════════════════
   STANDALONE PAGE  (QR code landing)
══════════════════════════════════════════════════════════════════════════ */
.lp-standalone-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    font-family: var(--lp-font);
    background: radial-gradient(ellipse at 60% 0%, rgba(99,102,241,.18) 0%, transparent 60%),
                radial-gradient(ellipse at 10% 80%, rgba(79,70,229,.12) 0%, transparent 50%),
                #f5f5fa;
}
.lp-standalone-page .lp-widget { width: 100%; max-width: 460px; }
.lp-standalone-page .lp-mode-inline .lp-panel {
    max-width: 100%;
    box-shadow: 0 16px 60px rgba(0,0,0,.18);
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 520px) {
    /* Floating: sheet from bottom */
    .lp-mode-floating .lp-panel {
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: translateY(100%) scale(1) !important;
        max-width: 100% !important;
        border-radius: var(--lp-radius-xl) var(--lp-radius-xl) 0 0 !important;
        max-height: 92vh;
    }
    .lp-mode-floating.lp-open .lp-panel { transform: translateY(0) !important; }

    /* Slide-in: also full-width */
    .lp-mode-slidein .lp-panel { left: 8px !important; right: 8px !important; max-width: calc(100% - 16px) !important; }

    .lp-trigger-stars { display: none; }
    .lp-panel-header { padding: 24px 20px 20px; }
    .lp-form { padding: 18px 16px 16px; }
    .lp-heading { font-size: 18px; }
}
