/**
 * AI Chat Widget Styles - QCSMCSL Support Chatbot
 * Mobile-first, responsive design with fullscreen support
 * 
 * @version 1.0.0
 */

/* CSS Custom Properties */
:root {
    --ai-chat-primary: #502C97;
    --ai-chat-primary-light: rgba(80, 44, 151, 0.1);
    --ai-chat-primary-dark: #3d2173;
    --ai-chat-white: #ffffff;
    --ai-chat-gray-50: #f9fafb;
    --ai-chat-gray-100: #f3f4f6;
    --ai-chat-gray-200: #e5e7eb;
    --ai-chat-gray-300: #d1d5db;
    --ai-chat-gray-400: #9ca3af;
    --ai-chat-gray-500: #6b7280;
    --ai-chat-gray-600: #4b5563;
    --ai-chat-gray-700: #374151;
    --ai-chat-gray-800: #1f2937;
    --ai-chat-gray-900: #111827;
    --ai-chat-success: #10b981;
    --ai-chat-error: #ef4444;
    --ai-chat-warning: #f59e0b;
    --ai-chat-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    --ai-chat-shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.2);
    --ai-chat-radius: 16px;
    --ai-chat-radius-sm: 8px;
    --ai-chat-radius-full: 9999px;
    --ai-chat-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ai-chat-z-index: 9999;
}

/* Widget Container */
.ai-chat-widget {
    position: fixed;
    z-index: var(--ai-chat-z-index);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Position variants */
.ai-chat-widget--bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai-chat-widget--bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: var(--ai-chat-radius-full);
    background: linear-gradient(135deg, var(--ai-chat-primary), var(--ai-chat-primary-dark));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ai-chat-shadow);
    transition: var(--ai-chat-transition);
    position: relative;
    color: var(--ai-chat-white);
}

.ai-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--ai-chat-shadow-lg);
}

.ai-chat-toggle:active {
    transform: scale(0.95);
}

.ai-chat-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-toggle__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--ai-chat-radius-full);
    background: var(--ai-chat-error);
    color: var(--ai-chat-white);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ai-chat-pulse 2s infinite;
}

@keyframes ai-chat-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Chat Window */
.ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: var(--ai-chat-white);
    border-radius: var(--ai-chat-radius);
    box-shadow: var(--ai-chat-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ai-chat-slide-up 0.3s ease-out;
}

.ai-chat-widget--bottom-left .ai-chat-window {
    right: auto;
    left: 0;
}

@keyframes ai-chat-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.ai-chat-header {
    background: linear-gradient(135deg, var(--ai-chat-primary), var(--ai-chat-primary-dark));
    color: var(--ai-chat-white);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ai-chat-header__info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--ai-chat-radius-full);
    background: var(--ai-chat-white);
    object-fit: contain;
    padding: 4px;
}

.ai-chat-header__text {
    display: flex;
    flex-direction: column;
}

.ai-chat-header__title {
    font-weight: 600;
    font-size: 15px;
}

.ai-chat-header__status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.ai-chat-header__status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--ai-chat-radius-full);
    background: var(--ai-chat-success);
    animation: ai-chat-pulse 2s infinite;
}

.ai-chat-header__actions {
    display: flex;
    gap: 8px;
}

.ai-chat-header__btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--ai-chat-radius-sm);
    color: var(--ai-chat-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-chat-transition);
}

.ai-chat-header__btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--ai-chat-gray-50);
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--ai-chat-gray-300);
    border-radius: var(--ai-chat-radius-full);
}

/* Message */
.ai-chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: ai-chat-message-in 0.3s ease-out;
}

@keyframes ai-chat-message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-message--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-chat-message--assistant {
    align-self: flex-start;
}

.ai-chat-message__avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--ai-chat-radius-full);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--ai-chat-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-chat-message__avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.ai-chat-message__content {
    padding: 12px 16px;
    border-radius: var(--ai-chat-radius);
    background: var(--ai-chat-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-chat-message--user .ai-chat-message__content {
    background: var(--ai-chat-primary);
    color: var(--ai-chat-white);
}

.ai-chat-message__content--error {
    background: #fef2f2 !important;
    color: var(--ai-chat-error) !important;
    border: 1px solid #fee2e2;
}

.ai-chat-message__text {
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
}

.ai-chat-message__text strong {
    font-weight: 600;
    color: var(--ai-chat-gray-900);
}

.ai-chat-message--user .ai-chat-message__text strong {
    color: var(--ai-chat-white);
}

.ai-chat-message__text a,
.ai-chat-message__text .ai-chat-link {
    color: var(--ai-chat-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: var(--ai-chat-transition);
}

.ai-chat-message__text a:hover,
.ai-chat-message__text .ai-chat-link:hover {
    border-bottom-color: var(--ai-chat-primary);
}

.ai-chat-message--user .ai-chat-message__text a,
.ai-chat-message--user .ai-chat-message__text .ai-chat-link {
    color: var(--ai-chat-white);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.ai-chat-message__text .ai-chat-h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ai-chat-gray-900);
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--ai-chat-gray-200);
}

.ai-chat-message__text .ai-chat-h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ai-chat-gray-800);
    margin: 10px 0 6px 0;
}

.ai-chat-message__text .ai-chat-list {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-chat-message__text ul.ai-chat-list {
    list-style: none;
    padding-left: 0;
}

.ai-chat-message__text ul.ai-chat-list li {
    position: relative;
    padding-left: 16px;
    margin: 6px 0;
}

.ai-chat-message__text ul.ai-chat-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--ai-chat-primary);
    border-radius: 50%;
}

.ai-chat-message__text ol.ai-chat-list {
    padding-left: 24px;
}

.ai-chat-message__text ol.ai-chat-list li {
    margin: 6px 0;
}

.ai-chat-message__text .ai-chat-code {
    background: var(--ai-chat-gray-100);
    color: var(--ai-chat-primary);
    padding: 2px 6px;
    border-radius: var(--ai-chat-radius-sm);
    font-family: monospace;
    font-size: 13px;
}

.ai-chat-message--user .ai-chat-message__text .ai-chat-code {
    background: rgba(255, 255, 255, 0.2);
    color: var(--ai-chat-white);
}

.ai-chat-message__text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-chat-message__text li {
    margin: 4px 0;
}

.ai-chat-message__sources {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--ai-chat-gray-200);
    font-size: 12px;
}

.ai-chat-message__sources-label {
    color: var(--ai-chat-gray-500);
    margin-right: 4px;
}

.ai-chat-message__sources a {
    color: var(--ai-chat-primary);
    text-decoration: none;
}

.ai-chat-message__sources a:hover {
    text-decoration: underline;
}

.ai-chat-message__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--ai-chat-gray-400);
}

.ai-chat-message--user .ai-chat-message__meta {
    color: rgba(255, 255, 255, 0.7);
}

.ai-chat-message__feedback {
    display: flex;
    gap: 4px;
}

.ai-chat-feedback-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--ai-chat-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ai-chat-radius-sm);
    transition: var(--ai-chat-transition);
}

.ai-chat-feedback-btn:hover {
    background: var(--ai-chat-gray-100);
    color: var(--ai-chat-gray-600);
}

.ai-chat-feedback-btn.active {
    color: var(--ai-chat-primary);
}

/* Typing Indicator */
.ai-chat-typing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--ai-chat-white);
    margin: 0 16px;
    border-radius: var(--ai-chat-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-chat-typing__dots {
    display: flex;
    gap: 4px;
}

.ai-chat-typing__dots span {
    width: 8px;
    height: 8px;
    background: var(--ai-chat-primary);
    border-radius: var(--ai-chat-radius-full);
    animation: ai-chat-bounce 1.4s infinite ease-in-out;
}

.ai-chat-typing__dots span:nth-child(1) {
    animation-delay: 0s;
}

.ai-chat-typing__dots span:nth-child(2) {
    animation-delay: 0.16s;
}

.ai-chat-typing__dots span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes ai-chat-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.ai-chat-typing__text {
    font-size: 13px;
    color: var(--ai-chat-gray-500);
}

/* File Preview */
.ai-chat-file-preview {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--ai-chat-gray-100);
    border-top: 1px solid var(--ai-chat-gray-200);
}

.ai-chat-file-preview__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ai-chat-white);
    border-radius: var(--ai-chat-radius-sm);
    border: 1px solid var(--ai-chat-gray-200);
}

.ai-chat-file-preview__name {
    font-size: 13px;
    color: var(--ai-chat-gray-700);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-chat-file-preview__remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--ai-chat-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ai-chat-radius-sm);
    transition: var(--ai-chat-transition);
}

.ai-chat-file-preview__remove:hover {
    background: var(--ai-chat-gray-100);
    color: var(--ai-chat-error);
}

/* Input Area */
.ai-chat-input {
    padding: 12px 16px 16px;
    background: var(--ai-chat-white);
    border-top: 1px solid var(--ai-chat-gray-200);
}

.ai-chat-input__container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--ai-chat-gray-100);
    border-radius: var(--ai-chat-radius);
    padding: 8px 12px;
    border: 2px solid transparent;
    transition: var(--ai-chat-transition);
}

.ai-chat-input__container:focus-within {
    border-color: var(--ai-chat-primary);
    background: var(--ai-chat-white);
}

.ai-chat-input__textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ai-chat-gray-800);
    outline: none;
    min-height: 24px;
    max-height: 120px;
}

.ai-chat-input__textarea::placeholder {
    color: var(--ai-chat-gray-400);
}

.ai-chat-input__btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--ai-chat-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ai-chat-radius-sm);
    transition: var(--ai-chat-transition);
    flex-shrink: 0;
}

.ai-chat-input__btn:hover {
    color: var(--ai-chat-primary);
    background: var(--ai-chat-primary-light);
}

.ai-chat-input__btn--send {
    background: var(--ai-chat-primary);
    color: var(--ai-chat-white);
}

.ai-chat-input__btn--send:hover {
    background: var(--ai-chat-primary-dark);
    color: var(--ai-chat-white);
}

.ai-chat-input__btn--send:disabled {
    background: var(--ai-chat-gray-300);
    cursor: not-allowed;
}

.ai-chat-input__btn--voice.recording {
    color: var(--ai-chat-error);
    animation: ai-chat-pulse 1s infinite;
}

.ai-chat-input__btn--attach {
    position: relative;
}

.ai-chat-input__file {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ai-chat-input__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 4px;
}

.ai-chat-input__char-count {
    font-size: 11px;
    color: var(--ai-chat-gray-400);
}

.ai-chat-input__branding {
    font-size: 11px;
    color: var(--ai-chat-gray-400);
}

/* Quick Actions */
.ai-chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 16px;
    background: var(--ai-chat-white);
}

.ai-chat-quick-action {
    padding: 8px 16px;
    border: 1px solid var(--ai-chat-gray-200);
    background: var(--ai-chat-white);
    border-radius: var(--ai-chat-radius-full);
    font-size: 13px;
    color: var(--ai-chat-gray-700);
    cursor: pointer;
    transition: var(--ai-chat-transition);
}

.ai-chat-quick-action:hover {
    border-color: var(--ai-chat-primary);
    color: var(--ai-chat-primary);
    background: var(--ai-chat-primary-light);
}

/* Notifications */
.ai-chat-notifications {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1;
}

.ai-chat-notification {
    padding: 12px 16px;
    background: var(--ai-chat-gray-800);
    color: var(--ai-chat-white);
    border-radius: var(--ai-chat-radius-sm);
    font-size: 13px;
    box-shadow: var(--ai-chat-shadow);
    animation: ai-chat-slide-up 0.3s ease-out;
}

.ai-chat-notification--error {
    background: var(--ai-chat-error);
}

.ai-chat-notification--success {
    background: var(--ai-chat-success);
}

.ai-chat-notification--fade {
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--ai-chat-transition);
}

/* Fullscreen Mode */
.ai-chat-widget--fullscreen .ai-chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    z-index: calc(var(--ai-chat-z-index) + 1);
}

.ai-chat-widget--fullscreen .ai-chat-toggle {
    display: none;
}

.ai-chat-widget--fullscreen .ai-chat-messages {
    padding: 24px;
}

.ai-chat-widget--fullscreen .ai-chat-message {
    max-width: 600px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 15px;
        right: 15px;
    }

    .ai-chat-widget--bottom-left {
        left: 15px;
    }

    .ai-chat-toggle {
        width: 56px;
        height: 56px;
    }

    .ai-chat-window {
        bottom: 75px;
        right: -15px;
        width: calc(100vw - 30px);
        max-height: calc(100vh - 100px);
        border-radius: var(--ai-chat-radius);
    }

    .ai-chat-widget--bottom-left .ai-chat-window {
        left: -15px;
        right: auto;
    }

    .ai-chat-header {
        padding: 14px;
    }

    .ai-chat-header__avatar {
        width: 36px;
        height: 36px;
    }

    .ai-chat-header__title {
        font-size: 14px;
    }

    .ai-chat-messages {
        padding: 12px;
        gap: 12px;
    }

    .ai-chat-message {
        max-width: 90%;
    }

    .ai-chat-message__content {
        padding: 10px 14px;
    }

    .ai-chat-input {
        padding: 10px 12px 14px;
    }

    .ai-chat-input__container {
        padding: 6px 10px;
    }

    .ai-chat-quick-actions {
        padding: 0 12px 14px;
    }

    .ai-chat-quick-action {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .ai-chat-window {
        width: 360px;
        height: 500px;
    }
}

/* Desktop Large */
@media (min-width: 1200px) {
    .ai-chat-widget {
        bottom: 30px;
        right: 30px;
    }

    .ai-chat-widget--bottom-left {
        left: 30px;
    }

    .ai-chat-window {
        width: 400px;
        height: 600px;
        bottom: 90px;
    }
}

/* Print */
@media print {
    .ai-chat-widget {
        display: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .ai-chat-toggle,
    .ai-chat-window,
    .ai-chat-message,
    .ai-chat-notification {
        animation: none;
        transition: none;
    }

    .ai-chat-toggle__badge,
    .ai-chat-header__status-dot,
    .ai-chat-typing__dots span {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ai-chat-message__content {
        border: 2px solid var(--ai-chat-gray-800);
    }

    .ai-chat-input__container {
        border: 2px solid var(--ai-chat-gray-800);
    }
}

/* Dark Mode Support (optional - can be enabled) */
@media (prefers-color-scheme: dark) {
    .ai-chat-widget[data-theme="auto"] {
        --ai-chat-white: #1f2937;
        --ai-chat-gray-50: #111827;
        --ai-chat-gray-100: #1f2937;
        --ai-chat-gray-200: #374151;
        --ai-chat-gray-300: #4b5563;
        --ai-chat-gray-400: #6b7280;
        --ai-chat-gray-500: #9ca3af;
        --ai-chat-gray-600: #d1d5db;
        --ai-chat-gray-700: #e5e7eb;
        --ai-chat-gray-800: #f3f4f6;
        --ai-chat-gray-900: #f9fafb;
    }
}

/* ================================
   Lead Capture Modal
================================ */
.ai-chat-lead-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-lead-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.ai-chat-lead-modal__content {
    position: relative;
    background: var(--ai-chat-white);
    border-radius: var(--ai-chat-radius);
    width: calc(100% - 24px);
    max-width: 360px;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    box-shadow: var(--ai-chat-shadow-lg);
    animation: aiChatSlideUp 0.3s ease-out;
}

.ai-chat-lead-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ai-chat-gray-200);
    background: var(--ai-chat-primary);
    color: var(--ai-chat-white);
    border-radius: var(--ai-chat-radius) var(--ai-chat-radius) 0 0;
}

.ai-chat-lead-modal__header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chat-lead-modal__close {
    background: transparent;
    border: none;
    color: var(--ai-chat-white);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ai-chat-radius-full);
    transition: var(--ai-chat-transition);
}

.ai-chat-lead-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Lead Form */
.ai-chat-lead-form {
    padding: 20px;
}

.ai-chat-lead-form__group {
    margin-bottom: 16px;
}

.ai-chat-lead-form__group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ai-chat-gray-700);
    margin-bottom: 6px;
}

.ai-chat-lead-form__group input,
.ai-chat-lead-form__group select,
.ai-chat-lead-form__group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ai-chat-gray-300);
    border-radius: var(--ai-chat-radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--ai-chat-transition);
    background: var(--ai-chat-white);
}

.ai-chat-lead-form__group input:focus,
.ai-chat-lead-form__group select:focus,
.ai-chat-lead-form__group textarea:focus {
    outline: none;
    border-color: var(--ai-chat-primary);
    box-shadow: 0 0 0 3px var(--ai-chat-primary-light);
}

.ai-chat-lead-form__group input::placeholder,
.ai-chat-lead-form__group textarea::placeholder {
    color: var(--ai-chat-gray-400);
}

.ai-chat-lead-form__group select {
    cursor: pointer;
    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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.ai-chat-lead-form__group textarea {
    resize: vertical;
    min-height: 80px;
}

.ai-chat-lead-form__error {
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--ai-chat-radius-sm);
    color: var(--ai-chat-error);
    font-size: 13px;
    margin-bottom: 16px;
}

.ai-chat-lead-form__success {
    padding: 10px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--ai-chat-radius-sm);
    color: var(--ai-chat-success);
    font-size: 13px;
    margin-bottom: 16px;
}

.ai-chat-lead-form__submit {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--ai-chat-primary), var(--ai-chat-primary-dark));
    color: var(--ai-chat-white);
    border: none;
    border-radius: var(--ai-chat-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ai-chat-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ai-chat-lead-form__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(80, 44, 151, 0.3);
}

.ai-chat-lead-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-chat-lead-form__submit .spin {
    animation: spin 1s linear infinite;
}

/* Lead Quick Action Button */
.ai-chat-quick-action--lead {
    background: var(--ai-chat-primary) !important;
    color: var(--ai-chat-white) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-chat-quick-action--lead:hover {
    background: var(--ai-chat-primary-dark) !important;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}