/* ============ EMAIL SYSTEM STYLES ============ */
.email-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.email-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.email-modal-overlay.active .email-modal {
    transform: scale(1) translateY(0);
}

.email-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.email-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.email-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.email-modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.email-form-group {
    margin-bottom: 1.25rem;
}

.email-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.email-form-group .required {
    color: var(--accent-red);
}

.email-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    -webkit-text-fill-color: var(--text-primary);
    box-sizing: border-box;
}

.email-form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.email-form-input::placeholder {
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
}

.email-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.email-quote-preview {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.email-quote-preview-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.email-quote-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.email-quote-item:last-child {
    margin-bottom: 0;
}

.email-quote-carrier {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.email-quote-carrier-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.email-quote-premium {
    font-weight: 700;
    color: var(--accent-green);
    font-size: 1rem;
}

.email-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-input);
    border-top: 1px solid var(--border-color);
}

.email-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.email-btn-cancel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.email-btn-cancel:hover {
    background: var(--bg-input);
}

.email-btn-send {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    color: white;
}

.email-btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.email-btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.email-btn-send .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.email-success-animation {
    text-align: center;
    padding: 2rem;
}

.email-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-green), #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: success-pop 0.5s ease;
}

.email-success-icon i {
    font-size: 2.5rem;
    color: white;
}

@keyframes success-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.email-success-message {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.email-success-sub {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.btn-email-quote {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.btn-email-quote:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.email-agent-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.email-agent-info .email-form-group {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .email-modal {
        width: 95%;
        margin: 1rem;
    }
    .email-agent-info {
        grid-template-columns: 1fr;
    }
    .email-modal-footer {
        flex-direction: column;
    }
}