/* Enhanced styles for upfront lead capture */

/* Upfront Lead Capture Form */
.pcai-upfront-lead-form {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
    border: 1px solid #e2e8f0;
}

.pcai-welcome-header {
    text-align: center;
    margin-bottom: 25px;
}

.pcai-welcome-header h3 {
    color: #1a202c;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.pcai-welcome-header p {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.pcai-form-row {
    margin-bottom: 20px;
}

.pcai-form-group {
    position: relative;
}

.pcai-form-group label {
    display: block;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 6px;
    font-size: 14px;
}

.pcai-lead-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #2d3748;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pcai-lead-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    background: #ffffff;
}

.pcai-lead-input:hover {
    border-color: #cbd5e0;
}

.pcai-lead-input.pcai-valid {
    border-color: #48bb78;
    background: #f0fff4;
}

.pcai-lead-input.pcai-invalid {
    border-color: #f56565;
    background: #fffafa;
}

.pcai-lead-input:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.pcai-field-error {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}

.pcai-form-group.pcai-error .pcai-field-error {
    display: block;
}

.pcai-form-actions {
    margin-top: 25px;
    text-align: center;
}

.pcai-btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pcai-btn-large:hover:not(:disabled) {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.pcai-btn-large:active {
    transform: translateY(0);
}

.pcai-btn-large:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pcai-btn-large.pcai-loading {
    cursor: wait;
}

.pcai-btn-spinner {
    color: white;
    font-size: 14px;
    font-weight: normal;
}

.pcai-privacy-note {
    margin-top: 15px;
    text-align: center;
    padding: 12px;
    background: #edf2f7;
    border-radius: 6px;
    border-left: 3px solid #4299e1;
}

.pcai-privacy-note small {
    color: #4a5568;
    font-size: 12px;
    line-height: 1.4;
}

/* Success Message Styles */
.pcai-success-message {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    border: 1px solid #9ae6b4;
    border-radius: 12px;
    margin: 10px 0;
}

.pcai-success-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pcai-success-header h3 {
    color: #22543d;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.pcai-success-icon {
    font-size: 24px;
}

.pcai-success-message p {
    color: #2f855a;
    margin: 0;
    line-height: 1.5;
}

/* Error Message Styles */
.pcai-error-message {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    margin: 10px 0;
}

.pcai-error-message .pcai-message-content {
    color: #c53030;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcai-error-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Disabled Chat Input State */
.pcai-input:disabled,
.pcai-chat-input:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.pcai-send-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}

.pcai-send-btn:disabled svg {
    color: #a0aec0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .pcai-upfront-lead-form {
        padding: 16px;
        margin: 5px 0;
    }
    
    .pcai-welcome-header h3 {
        font-size: 18px;
    }
    
    .pcai-welcome-header p {
        font-size: 13px;
    }
    
    .pcai-lead-input {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .pcai-btn-large {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .pcai-form-row {
        margin-bottom: 16px;
    }
}

/* Animation for form appearance */
.pcai-upfront-lead-form {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state animation */
.pcai-btn-large.pcai-loading .pcai-btn-spinner {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Form validation states */
.pcai-form-group.pcai-error .pcai-lead-input {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px);
    }
}

/* Focus management */
.pcai-lead-input:focus + .pcai-field-error {
    display: none;
}

.pcai-form-group:not(.pcai-error) .pcai-field-error {
    display: none;
}

/* Accessibility improvements */
.pcai-lead-input:focus-visible {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

.pcai-btn-large:focus-visible {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pcai-lead-input {
        border-width: 2px;
    }
    
    .pcai-btn-large {
        border: 2px solid #2c5282;
    }
    
    .pcai-field-error {
        font-weight: 600;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pcai-upfront-lead-form,
    .pcai-btn-large,
    .pcai-lead-input {
        animation: none;
        transition: none;
    }
    
    .pcai-btn-large:hover {
        transform: none;
    }
}