/* Lead Modal Overlay */
.lead-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 35, 64, 0.65);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    padding: 1rem;
    box-sizing: border-box;
}

.lead-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container - Slides up from bottom */
.lead-modal {
    background: #ffffff;
    width: 100%;
    max-width: 530px;
    border-radius: 22px;
    box-shadow: 0 30px 65px -12px rgba(12, 35, 64, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.9);
    transform: translateY(140px) scale(0.95);
    opacity: 0;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.lead-modal-overlay.active .lead-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: slideUpPopup 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUpPopup {
    0% {
        transform: translateY(140px) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Mobile Drag Handle Bar */
.lead-modal-drag-bar {
    width: 44px;
    height: 4px;
    background: #CBD5E1;
    border-radius: 9999px;
    margin: 8px auto 2px auto;
    display: none;
}

/* Modal Header */
.lead-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.85rem 1.25rem 0.5rem 1.25rem;
    background: linear-gradient(to right, #F8FAFC, #FFFFFF);
    border-bottom: 1px solid #E2E8F0;
    position: relative;
}

.lead-modal-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 1.5rem;
}

.lead-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 0.15rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #DBEAFE;
    border-radius: 9999px;
}

.lead-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #0C2340;
    font-weight: 800;
    line-height: 1.3;
}

.lead-modal-subtext {
    margin: 0;
    font-size: 0.78rem;
    color: #64748B;
    line-height: 1.35;
}

.lead-modal-close {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #64748B;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
    flex-shrink: 0;
}

.lead-modal-close:hover {
    color: #E11D48;
    background: #FFE4E6;
    border-color: #FECDD3;
}

/* Progress Indicator */
.lead-modal-progress-wrap {
    padding: 0.4rem 1.25rem 0.25rem 1.25rem;
    background: #FFFFFF;
}

.lead-step-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    margin-bottom: 0.35rem;
}

#stepCounterText {
    color: #2563EB;
    font-weight: 800;
}

.lead-progress-track {
    height: 4px;
    background: #E2E8F0;
    border-radius: 9999px;
    overflow: hidden;
}

.lead-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #3B82F6);
    border-radius: 9999px;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modal Body */
.lead-modal-body {
    padding: 0.75rem 1.25rem 0.85rem 1.25rem;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
    max-height: calc(88vh - 120px);
}

/* Selected Course Banner */
.selected-course-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    margin-bottom: 0.65rem;
}

.banner-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #2563EB;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.banner-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.banner-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1E40AF;
    letter-spacing: 0.5px;
}

.banner-title {
    font-size: 0.95rem;
    font-weight: 850;
    color: #0C2340;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-meta {
    font-size: 0.72rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Form Questions */
.form-question-group {
    display: flex;
    flex-direction: column;
}

.question-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0C2340;
    margin-bottom: 0.25rem;
}

.question-sub {
    font-size: 0.78rem;
    color: #64748B;
    margin: 0 0 0.85rem 0;
}

/* Radio Card Grid & List */
.radio-card-grid, .lead-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.lead-option-card {
    cursor: pointer;
    position: relative;
    display: block;
    margin: 0;
}

.lead-option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lead-option-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.52rem 0.85rem;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 9px;
    transition: all 0.16s ease;
    min-height: 40px;
    box-sizing: border-box;
}

.lead-option-card:hover .lead-option-box {
    background: #EFF6FF;
    border-color: #93C5FD;
}

.option-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #CBD5E1;
    background: #FFFFFF;
    flex-shrink: 0;
    transition: all 0.16s ease;
    position: relative;
}

.lead-option-card input:checked + .lead-option-box {
    border-color: #2563EB;
    background: #EFF6FF;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.lead-option-card input:checked + .lead-option-box .option-dot {
    border-color: #2563EB;
    background: #2563EB;
    box-shadow: inset 0 0 0 3px #FFFFFF;
}

.option-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.35;
}

.lead-option-card input:checked + .lead-option-box .option-title {
    color: #1E40AF;
}

/* Preference Pills Grid (Step 4) */
.lead-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.lead-pref-pill {
    cursor: pointer;
    position: relative;
    display: block;
    margin: 0;
}

.lead-pref-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lead-pref-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.6rem 0.65rem;
    min-height: 44px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    transition: all 0.16s ease;
    box-sizing: border-box;
}

.lead-pref-pill:hover span {
    background: #EFF6FF;
    border-color: #93C5FD;
}

.lead-pref-pill input:checked + span {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* Timeline Pills */
.timeline-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
}

.timeline-pill {
    cursor: pointer;
    position: relative;
    margin: 0;
}

.timeline-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.timeline-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: 40px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 650;
    color: #475569;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.timeline-pill:hover span {
    border-color: #BFDBFE;
}

.timeline-pill input:checked + span {
    background: #EFF6FF;
    border-color: #2563EB;
    color: #1E40AF;
    font-weight: 750;
}

/* Form Fields (Step 3 & 5) */
.form-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.input-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0C2340;
}

.lead-input, .lead-select {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    color: #0F172A;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lead-input:focus, .lead-select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.lead-input.error {
    border-color: #E11D48;
    background: #FFF1F2;
}

.phone-input-group {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.phone-input-group:focus-within {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.phone-prefix {
    background: #F1F5F9;
    border-right: 1px solid #CBD5E1;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
}

.lead-input.phone {
    border: none;
    border-radius: 0;
}

.lead-input.phone:focus {
    box-shadow: none;
}

.lead-input-error {
    font-size: 0.74rem;
    color: #E11D48;
    font-weight: 600;
    margin-top: 0.15rem;
}

/* Nav Actions - Elevated & Sticky so Next/Continue is always visible */
.lead-nav-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.75rem;
    position: sticky;
    bottom: 0;
    background: #ffffff;
    padding-top: 0.6rem;
    padding-bottom: 0.35rem;
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 -8px 16px #ffffff;
    z-index: 25;
}

.lead-nav-actions.dual {
    justify-content: space-between;
}

.btn-lead-primary {
    flex: 2;
    min-height: 42px;
    background: #2563EB;
    color: #FFFFFF;
    border: 1px solid #1D4ED8;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 750;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.18s ease;
}

.btn-lead-primary:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-lead-primary.submit {
    background: #10B981;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-lead-primary.submit:hover {
    background: #059669;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-lead-back {
    flex: 1;
    min-height: 42px;
    background: #F8FAFC;
    color: #475569;
    border: 1.5px solid #E2E8F0;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-lead-back:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* Success Screen Styles */
.lead-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ECFDF5;
    border: 2px solid #A7F3D0;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
}

.success-title {
    font-size: 1.35rem;
    font-weight: 850;
    color: #0C2340;
    margin-bottom: 0.5rem;
}

.success-msg {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-success-wa {
    min-height: 46px;
    background: #16A34A;
    color: #FFFFFF;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 750;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
    transition: background 0.18s ease;
}

.btn-success-wa:hover {
    background: #15803D;
    color: #FFFFFF;
}

/* Mobile Bottom Sheet Behavior (<= 640px) */
@media (max-width: 640px) {
    .lead-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .lead-modal {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 88vh;
        transform: translateY(100%);
    }

    .lead-modal-drag-bar {
        display: block;
    }

    .lead-modal-overlay.active .lead-modal {
        transform: translateY(0);
        animation: slideUpSheet 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .lead-options-grid {
        grid-template-columns: 1fr;
    }

    .lead-modal-body {
        padding: 0.75rem 1rem 0.5rem 1rem;
        max-height: calc(88vh - 100px);
    }

    .lead-nav-actions {
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
        margin-top: 0.65rem;
    }
}

@keyframes slideUpSheet {
    0% {
        transform: translateY(100%);
        opacity: 0.3;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Quick City Chips */
.quick-city-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.city-chip {
    padding: 0.22rem 0.65rem;
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.city-chip:hover, .city-chip.active {
    background: #EFF6FF;
    color: #2563EB;
    border-color: #BFDBFE;
    transform: translateY(-1px);
}


