/* ============================================
   Lead Capture Form Modal
   ============================================ */

@keyframes lead-fade-in {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lead-spin {
    to { transform: rotate(360deg); }
}

/* Modal overlay */
.lead-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lead-modal--open {
    display: flex;
}

.lead-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Card */
.lead-modal__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    background: var(--bg-card, rgba(20, 20, 30, 0.97));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    padding: 36px 32px 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: lead-fade-in 0.25s ease forwards;
    max-height: 90vh;
    overflow-y: auto;
}

/* Close button */
.lead-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.lead-modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Header */
.lead-modal__header {
    margin-bottom: 24px;
}

.lead-modal__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 6px;
}

.lead-modal__subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.55));
    margin: 0;
}

/* Form groups */
.lead-form__group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.lead-form__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 6px;
}

.lead-form__required {
    color: #FF4D4D;
}

/* Inputs */
.lead-form__input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary, #fff);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.lead-form__input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.lead-form__input:focus {
    border-color: var(--accent-light, rgba(87, 243, 87, 0.6));
}

.lead-form__input--error {
    border-color: #FF4D4D !important;
}

/* Textarea */
.lead-form__textarea {
    resize: vertical;
    min-height: 100px;
}

/* Error messages */
.lead-form__error {
    font-size: 0.75rem;
    color: #FF4D4D;
    margin-top: 4px;
    min-height: 16px;
    display: block;
}

/* Global error */
.lead-form__global-error {
    background: rgba(255, 77, 77, 0.12);
    border: 1px solid rgba(255, 77, 77, 0.35);
    color: #FF4D4D;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-top: 12px;
    text-align: center;
}

/* Submit button */
.lead-form__submit {
    width: 100%;
    padding: 14px;
    background: var(--gradient-main, linear-gradient(135deg, #57f357, #3dd68c));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    margin-top: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lead-form__submit:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lead-form__submit:active:not(:disabled) {
    transform: translateY(0);
}

.lead-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner in button */
.lead-form__spinner {
    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;
    flex-shrink: 0;
}

/* Light theme overrides */
.light-theme .lead-modal__card {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.light-theme .lead-modal__close {
    color: rgba(0, 0, 0, 0.45);
}

.light-theme .lead-modal__close:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.06);
}

.light-theme .lead-form__input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary, #1a1a1a);
}

.light-theme .lead-form__input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.light-theme .lead-form__input:focus {
    border-color: var(--accent-light, #22c55e);
}

/* Responsive */
@media (max-width: 520px) {
    .lead-modal__card {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }

    .lead-modal__title {
        font-size: 1.2rem;
    }
}

/* Cooldown state */
.lead-form__submit--cooldown {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed !important;
}
