/* ========================================
   Lead Capture Popup Styles
   ======================================== */

/* Overlay */
.lead-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.lead-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container - Full screen approach */
.lead-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 700px;
    max-width: 95%;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
}
.lead-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Header */
.lead-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    padding: 28px 32px 24px;
    position: relative;
    overflow: hidden;
}
.lead-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}
.lead-header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 20%;
    width: 120px;
    height: 120px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
}

.lead-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.lead-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}
.lead-close svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.lead-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.lead-badge-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: lead-pulse 2s infinite;
}
@keyframes lead-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

.lead-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

/* Title Row with Inline Logo */
.lead-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.lead-title-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
}
.lead-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

/* Progress */
.lead-progress {
    height: 3px;
    background: #e2e8f0;
}
.lead-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #10b981);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Step Indicators */
.lead-step-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 32px 0;
}
.lead-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s;
}
.lead-step-dot.active {
    background: #6366f1;
    width: 24px;
    border-radius: 4px;
}
.lead-step-dot.done {
    background: #10b981;
}

/* Body */
.lead-body {
    padding: 28px 32px 32px;
}

/* Steps */
.lead-step {
    display: none;
    animation: lead-fadeUp 0.35s ease;
}
.lead-step.active {
    display: block;
}
@keyframes lead-fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.lead-step-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}
.lead-step-sub {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

/* Choice Cards */
.lead-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.lead-choice-grid.three {
    grid-template-columns: repeat(3, 1fr);
}
.lead-choice-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
    background: #f8fafc;
}
.lead-choice-card:hover {
    border-color: #6366f1;
    background: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}
.lead-choice-card.selected {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.lead-choice-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    color: #6366f1;
    font-size: 12px;
    font-weight: 700;
}
.lead-choice-icon {
    font-size: 26px;
    margin-bottom: 6px;
    display: block;
}
.lead-choice-label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}
.lead-choice-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* Chips */
.lead-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.lead-chip {
    border: 2px solid #e2e8f0;
    border-radius: 100px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    transition: all 0.2s;
    white-space: nowrap;
}
.lead-chip:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}
.lead-chip.selected {
    border-color: #6366f1;
    background: #6366f1;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Form */
.lead-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.lead-form-row.full {
    grid-template-columns: 1fr;
}
.lead-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lead-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.lead-form-group input {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 15px;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.lead-form-group input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.lead-form-group input.error {
    border-color: #ef4444;
}
.lead-field-error {
    font-size: 11px;
    color: #ef4444;
    min-height: 14px;
}

/* Navigation */
.lead-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    gap: 12px;
}
.lead-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}
.lead-btn-back {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #64748b;
}
.lead-btn-back:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}
.lead-btn-next {
    background: #6366f1;
    color: #fff;
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.lead-btn-next:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.lead-btn-next:disabled,
.lead-btn-submit:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}
.lead-btn-submit {
    background: linear-gradient(135deg, #6366f1, #10b981);
    color: #fff;
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.lead-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
}
.lead-step-counter {
    font-size: 12px;
    color: #94a3b8;
    font-family: monospace;
}

/* Success Screen */
.lead-success {
    text-align: center;
    padding: 40px 20px;
}
.lead-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366f1, #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
}
.lead-success h3 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}
.lead-success p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

/* Privacy Note */
.lead-privacy {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Email Confirmation Dialog */
.lead-email-confirm {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0 0 20px 20px;
}
.lead-email-confirm-box {
    text-align: center;
    padding: 24px;
    max-width: 320px;
}
.lead-email-confirm-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.lead-email-confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.lead-email-confirm-text {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
}
.lead-email-confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.lead-email-confirm-btns .lead-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

/* ========================================
   Compact Mode (Step 5 - Contact Form)
   ======================================== */
.lead-modal-compact .lead-header {
    padding: 18px 32px 14px;
}
.lead-modal-compact .lead-title {
    font-size: 16px;
}
.lead-modal-compact .lead-title-logo {
    width: 36px;
    height: 36px;
}
.lead-modal-compact .lead-subtitle {
    display: none;
}
.lead-modal-compact .lead-badge {
    margin-bottom: 8px;
    padding: 4px 10px;
    font-size: 10px;
}
.lead-modal-compact .lead-step-dots {
    padding: 12px 32px 0;
}
.lead-modal-compact .lead-body {
    padding: 18px 32px 24px;
}
.lead-modal-compact .lead-step-title {
    font-size: 15px;
    margin-bottom: 4px;
}
.lead-modal-compact .lead-step-sub {
    font-size: 12px;
    margin-bottom: 16px;
}
.lead-modal-compact .lead-form-row {
    margin-bottom: 10px;
    gap: 10px;
}
.lead-modal-compact .lead-form-group input {
    padding: 10px 12px;
    font-size: 14px;
}
.lead-modal-compact .lead-form-group label {
    font-size: 11px;
}
.lead-modal-compact .lead-nav-row {
    margin-top: 16px;
}
.lead-modal-compact .lead-btn {
    padding: 12px 20px;
    font-size: 14px;
}
.lead-modal-compact .lead-privacy {
    margin-top: 12px;
    font-size: 11px;
}

@media (max-width: 640px) {
    .lead-modal-compact .lead-header {
        padding: 16px 20px 12px;
    }
    .lead-modal-compact .lead-body {
        padding: 16px 20px 20px;
    }
    .lead-modal-compact .lead-step-dots {
        padding: 10px 20px 0;
    }
    .lead-modal-compact .lead-title-logo {
        width: 32px;
        height: 32px;
    }
    .lead-modal-compact .lead-title {
        font-size: 15px;
    }
}

/* Loading Spinner */
.lead-btn .lead-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lead-spin 0.8s linear infinite;
}
.lead-btn.loading .lead-spinner {
    display: block;
}
.lead-btn.loading .lead-btn-text {
    display: none;
}
@keyframes lead-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Product Card CTA Buttons - Improved
   ======================================== */
.lead-cta-btns {
    display: flex;
    gap: 10px;
}
.lead-cta-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    min-width: 130px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    white-space: nowrap;
}
.lead-cta-btn.demo {
    background: #6366f1;
    color: #fff;
}
.lead-cta-btn.demo:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.lead-cta-btn.pricing {
    background: #fff;
    color: #475569;
    border: 2px solid #e2e8f0;
}
.lead-cta-btn.pricing:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}
.lead-cta-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========================================
   Category Header - Stats Row with Callback
   ======================================== */
.category-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.category-stats-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.category-stats-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Agent Avatars */
.agent-avatars {
    display: flex;
    align-items: center;
}
.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    margin-left: -12px;
}
.agent-avatar:first-child {
    margin-left: 0;
}

/* Request Callback Button */
.lead-callback-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #10b981;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}
.lead-callback-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.lead-callback-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 740px) {
    .lead-modal {
        width: 95%;
        max-width: 95%;
        border-radius: 16px;
    }
}

@media (max-width: 640px) {
    .lead-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        transform: translateY(100%);
        overflow-y: auto;
    }
    .lead-modal.active {
        transform: translateY(0);
    }
    .lead-header {
        padding: 24px 20px 20px;
    }
    .lead-title-logo {
        width: 38px;
        height: 38px;
    }
    .lead-title {
        font-size: 18px;
    }
    .lead-body {
        padding: 24px 20px 28px;
    }
    .lead-step-dots {
        padding: 16px 20px 0;
    }
    .lead-choice-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .lead-choice-grid.three {
        grid-template-columns: 1fr 1fr;
    }
    .lead-form-row {
        grid-template-columns: 1fr;
    }
    .lead-cta-btns {
        flex-direction: column;
    }
    .lead-cta-btn {
        width: 100%;
    }
    .category-stats-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .category-stats-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .lead-modal {
        max-width: 580px;
    }
}