/* FullCarro ChatVoz AI - Estilos del Widget */

:root {
    --fcai-primary-color: #0066cc;
    --fcai-primary-dark: #0052a3;
    --fcai-bg-light: #f8f9fa;
    --fcai-bg-white: #ffffff;
    --fcai-text-dark: #212529;
    --fcai-text-light: #6c757d;
    --fcai-border-color: #dee2e6;
    --fcai-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --fcai-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.1);
    --fcai-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Widget Container */
#fcai-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Posiciones */
.fcai-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.fcai-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.fcai-position-top-right {
    top: 20px;
    right: 20px;
}

.fcai-position-top-left {
    top: 20px;
    left: 20px;
}

/* Botón flotante */
.fcai-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--fcai-primary-color);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: var(--fcai-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fcai-transition);
    position: relative;
}

.fcai-toggle-btn:hover {
    background: var(--fcai-primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fcai-toggle-btn:active {
    transform: scale(0.95);
}

/* Ventana de chat */
.fcai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--fcai-bg-white);
    border-radius: 16px;
    box-shadow: var(--fcai-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fcaiSlideIn 0.3s ease-out;
}

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

/* Para posiciones izquierdas */
.fcai-position-bottom-left .fcai-chat-window,
.fcai-position-top-left .fcai-chat-window {
    right: auto;
    left: 0;
}

/* Para posiciones superiores */
.fcai-position-top-right .fcai-chat-window,
.fcai-position-top-left .fcai-chat-window {
    bottom: auto;
    top: 80px;
}

/* Header */
.fcai-chat-header {
    background: var(--fcai-primary-color);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fcai-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fcai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcai-header-text {
    flex: 1;
}

.fcai-agent-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.fcai-agent-status {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fcai-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: fcaiPulse 2s infinite;
}

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

.fcai-close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--fcai-transition);
}

.fcai-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mensajes */
.fcai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--fcai-bg-light);
}

.fcai-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    animation: fcaiFadeIn 0.3s ease-out;
}

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

.fcai-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
}

.fcai-message-bot .fcai-message-content {
    background: var(--fcai-bg-white);
    color: var(--fcai-text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: var(--fcai-shadow-sm);
}

.fcai-message-user {
    align-items: flex-end;
}

.fcai-message-user .fcai-message-content {
    background: var(--fcai-primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.fcai-message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.fcai-message-content p.fcai-bullet {
    margin: 4px 0;
}

.fcai-message-content .fcai-vehicle-link {
    color: var(--fcai-primary-color);
    text-decoration: underline;
    font-weight: 600;
    word-break: break-all;
}

.fcai-message-bot .fcai-message-content .fcai-vehicle-link {
    color: var(--fcai-primary-color);
}

.fcai-message-user .fcai-message-content .fcai-vehicle-link {
    color: #fff;
    opacity: 0.9;
}

.fcai-message-time {
    font-size: 11px;
    color: var(--fcai-text-light);
    margin-top: 4px;
    padding: 0 4px;
}

/* Indicador de escritura */
.fcai-typing {
    padding: 8px 20px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.fcai-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--fcai-text-light);
    border-radius: 50%;
    animation: fcaiTyping 1.4s infinite;
}

.fcai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.fcai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fcaiTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Container */
.fcai-input-container {
    padding: 16px;
    background: var(--fcai-bg-white);
    border-top: 1px solid var(--fcai-border-color);
    display: flex;
    gap: 8px;
    align-items: center;
}

.fcai-voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fcai-bg-light);
    border: none;
    color: var(--fcai-text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fcai-transition);
    flex-shrink: 0;
}

.fcai-voice-btn:hover {
    background: var(--fcai-border-color);
}

.fcai-voice-btn.fcai-recording {
    background: #ef4444;
    color: white;
    animation: fcaiRecordPulse 1.5s infinite;
}

@keyframes fcaiRecordPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.fcai-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--fcai-border-color);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: var(--fcai-transition);
    font-family: inherit;
}

.fcai-input:focus {
    border-color: var(--fcai-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.fcai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fcai-primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fcai-transition);
    flex-shrink: 0;
}

.fcai-send-btn:hover {
    background: var(--fcai-primary-dark);
    transform: scale(1.05);
}

.fcai-send-btn:active {
    transform: scale(0.95);
}

.fcai-send-btn:disabled {
    background: var(--fcai-border-color);
    cursor: not-allowed;
    transform: none;
}

/* Botón de WhatsApp en mensajes */
.fcai-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    transition: var(--fcai-transition);
}

.fcai-whatsapp-btn:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: var(--fcai-shadow-sm);
}

/* Responsive */
@media (max-width: 480px) {
    .fcai-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }

    .fcai-position-top-right .fcai-chat-window,
    .fcai-position-top-left .fcai-chat-window {
        top: 70px;
    }

    .fcai-toggle-btn {
        width: 56px;
        height: 56px;
    }
}

/* Scrollbar */
.fcai-messages::-webkit-scrollbar {
    width: 6px;
}

.fcai-messages::-webkit-scrollbar-track {
    background: transparent;
}

.fcai-messages::-webkit-scrollbar-thumb {
    background: var(--fcai-border-color);
    border-radius: 3px;
}

.fcai-messages::-webkit-scrollbar-thumb:hover {
    background: var(--fcai-text-light);
}

/* ===============================================
   REGISTRATION FORM STYLES
   =============================================== */

.fcai-registration-form {
    padding: 30px 20px;
    background: var(--fcai-bg-white);
    height: 100%;
    overflow-y: auto;
}

.fcai-registration-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--fcai-border-color);
}

.fcai-registration-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--fcai-primary-color);
}

.fcai-registration-header p {
    margin: 0;
    font-size: 14px;
    color: var(--fcai-text-light);
}

.fcai-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fcai-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fcai-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fcai-text-dark);
}

.fcai-form-group input[type="text"],
.fcai-form-group input[type="email"],
.fcai-form-group input[type="tel"] {
    padding: 12px 15px;
    border: 2px solid var(--fcai-border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--fcai-transition);
    background: var(--fcai-bg-white);
}

.fcai-form-group input:focus {
    outline: none;
    border-color: var(--fcai-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.fcai-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--fcai-text-dark);
    line-height: 1.5;
}

.fcai-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--fcai-primary-color);
}

.fcai-checkbox-label a {
    color: var(--fcai-primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.fcai-checkbox-label a:hover {
    color: var(--fcai-primary-dark);
}

.fcai-btn-primary {
    padding: 14px 24px;
    background: var(--fcai-primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--fcai-transition);
    box-shadow: var(--fcai-shadow-sm);
}

.fcai-btn-primary:hover {
    background: var(--fcai-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--fcai-shadow);
}

.fcai-btn-primary:active {
    transform: translateY(0);
}

.fcai-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.fcai-form-error {
    padding: 12px 15px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* reCAPTCHA container */
.fcai-form-group .g-recaptcha {
    display: flex;
    justify-content: center;
}

/* Avatar grande para login prompt */
.fcai-avatar-large {
    text-align: center;
    margin-bottom: 20px;
}

.fcai-avatar-large svg {
    width: 80px;
    height: 80px;
}

/* Botones de login */
.fcai-login-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fcai-btn-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.fcai-btn-secondary {
    padding: 14px 24px;
    background: white;
    color: var(--fcai-primary-color);
    border: 2px solid var(--fcai-primary-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--fcai-transition);
    text-decoration: none;
    text-align: center;
}

.fcai-btn-secondary:hover {
    background: var(--fcai-primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Divider "o" */
.fcai-divider {
    position: relative;
    text-align: center;
    margin: 10px 0;
}

.fcai-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--fcai-border-color);
}

.fcai-divider span {
    position: relative;
    display: inline-block;
    padding: 0 15px;
    background: white;
    color: var(--fcai-text-light);
    font-size: 14px;
    font-weight: 500;
}

/* Texto de ayuda */
.fcai-login-help {
    text-align: center;
    font-size: 13px;
    color: var(--fcai-text-light);
    margin-top: 10px;
}

.fcai-login-help a {
    color: var(--fcai-primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.fcai-login-help a:hover {
    color: var(--fcai-primary-dark);
}

/* Responsive */
@media (max-width: 480px) {
    .fcai-registration-form {
        padding: 20px 15px;
    }

    .fcai-registration-header h3 {
        font-size: 20px;
    }

    .fcai-btn-primary,
    .fcai-btn-secondary {
        font-size: 15px;
        padding: 12px 20px;
    }

    .fcai-avatar-large svg {
        width: 64px;
        height: 64px;
    }
}
