/* Lead Form Modal */
.lead-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.lead-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(2px);
    animation: lm-fadeIn .2s ease;
}
.lead-modal-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: lm-slideUp .3s ease;
}
.lead-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.lead-modal-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}
.lead-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 6px;
    transition: background .2s;
}
.lead-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}
.lead-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Loading */
.lead-modal-loading {
    text-align: center;
    padding: 40px 0;
    color: #666;
}
.lead-modal-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8f5e8;
    border-top-color: #38812f;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: lm-spin .7s linear infinite;
}
.lead-modal-spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lm-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* Form Fields */
.lead-field {
    margin-bottom: 18px;
}
.lead-field-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.lead-field-label .lead-field-required {
    color: #e53e3e;
    margin-left: 2px;
}
.lead-field input[type="text"],
.lead-field input[type="number"],
.lead-field textarea,
.lead-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.lead-field input:focus,
.lead-field textarea:focus,
.lead-field select:focus {
    border-color: #38812f;
    box-shadow: 0 0 0 3px rgba(56,129,47,.1);
}
.lead-field textarea {
    resize: vertical;
    min-height: 80px;
}
.lead-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.lead-field-invalid input,
.lead-field-invalid textarea,
.lead-field-invalid select {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229,62,62,.1);
}
.lead-field-error {
    font-size: 0.78rem;
    color: #e53e3e;
    margin-top: 4px;
}

/* Radio & Checkbox groups */
.lead-field-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.lead-field-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    color: #333;
}
.lead-field-option input {
    width: 18px;
    height: 18px;
    accent-color: #38812f;
    cursor: pointer;
}

/* Error banner */
.lead-modal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #b91c1c;
    margin-bottom: 16px;
}

/* Submit button */
.lead-modal-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #38812f, #2d6b26);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    margin-top: 8px;
}
.lead-modal-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56,129,47,.3);
}
.lead-modal-submit:active {
    transform: translateY(0);
}
.lead-modal-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success state */
.lead-modal-success {
    text-align: center;
    padding: 30px 0;
}
.lead-modal-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e8f5e8;
    color: #38812f;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: lm-scaleIn .3s ease;
}
.lead-modal-success p {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px;
}
.lead-modal-success-sub {
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: #666 !important;
}

/* Animations */
@keyframes lm-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes lm-slideUp {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lm-spin {
    to { transform: rotate(360deg); }
}
@keyframes lm-scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .lead-modal {
        padding: 0;
        align-items: flex-end;
    }
    .lead-modal-container {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        animation: lm-slideUpMobile .3s ease;
    }
    .lead-modal-body {
        padding: 20px 16px;
    }
    .lead-modal-header {
        padding: 16px 16px 12px;
    }
}
@keyframes lm-slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
