/* === Axentia Chatbot Widget — v3 monocromatico (General Sans + JetBrains Mono, bianco/nero/grigi) === */

#ax-chat-toggle {
    position: fixed;
    bottom: 84px;
    right: 32px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    color: #0A0A0A;
    border: 1.5px solid #0A0A0A;
    border-radius: 999px;
    padding: 13px 21px 13px 15px;
    cursor: pointer;
    font-family: 'General Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 24px rgba(10,10,10,0.12);
    transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s cubic-bezier(.22,1,.36,1), background .2s ease, color .2s ease;
    white-space: nowrap;
}

#ax-chat-toggle:hover {
    background: #0A0A0A;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(10,10,10,0.24);
}

#ax-chat-toggle:active { transform: translateY(0) scale(0.98); }

#ax-chat-toggle svg { flex-shrink: 0; }

#ax-chat-panel {
    position: fixed;
    bottom: 148px;
    right: 32px;
    width: 380px;
    height: 560px;
    z-index: 9998;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px) saturate(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
    border: 1px solid #E8E8E6;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(10,10,10,0.14);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'General Sans', sans-serif;
    font-size: 15px;
}

#ax-chat-panel.ax-hidden { display: none; }

#ax-chat-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #EDEDED;
}

#ax-chat-header-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0A0A0A;
}

#ax-chat-header-dot {
    width: 7px;
    height: 7px;
    background: #0A0A0A;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ax-dot-pulse 2.4s ease-in-out infinite;
}

@keyframes ax-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

#ax-chat-header-actions { display: flex; align-items: center; gap: 2px; }

#ax-chat-new-session,
#ax-chat-close {
    background: transparent;
    border: none;
    color: #8A8A8A;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 6px;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
}

#ax-chat-new-session:hover,
#ax-chat-close:hover {
    color: #0A0A0A;
    background: #F0F0EE;
}

#ax-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 78px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: rgba(10,10,10,0.14) transparent;
}

#ax-chat-messages::-webkit-scrollbar { width: 5px; }
#ax-chat-messages::-webkit-scrollbar-track { background: transparent; }
#ax-chat-messages::-webkit-scrollbar-thumb { background-color: rgba(10,10,10,0.14); border-radius: 10px; }

.ax-msg { max-width: 85%; display: flex; flex-direction: column; gap: 5px; }

.ax-msg::before {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8A8A8A;
}

.ax-msg-bot { align-self: flex-start; }
.ax-msg-bot::before { content: "Assistente"; }

.ax-msg-user { align-self: flex-end; align-items: flex-end; }
.ax-msg-user::before { content: "Tu"; text-align: right; }

.ax-msg-content { padding: 12px 15px; font-size: 14.5px; line-height: 1.6; }

.ax-msg-bot .ax-msg-content {
    background: #F0F0EE;
    color: #0A0A0A;
    border-radius: 4px 14px 14px 14px;
}

.ax-msg-user .ax-msg-content {
    background: #0A0A0A;
    color: #fff;
    border-radius: 14px 4px 14px 14px;
}

.ax-msg-bot .ax-msg-content a { color: #0A0A0A; text-decoration: underline; }
.ax-msg-user .ax-msg-content a { color: rgba(255,255,255,0.9); text-decoration: underline; }

.ax-msg-bot .ax-msg-content p { margin: 0 0 8px; }
.ax-msg-bot .ax-msg-content p:last-child,
.ax-msg-bot .ax-msg-content ul:last-child,
.ax-msg-bot .ax-msg-content ol:last-child { margin-bottom: 0; }
.ax-msg-bot .ax-msg-content ul,
.ax-msg-bot .ax-msg-content ol { margin: 4px 0 8px; padding-left: 20px; }
.ax-msg-bot .ax-msg-content li { margin: 3px 0; }
.ax-msg-bot .ax-msg-content strong { font-weight: 600; color: #0A0A0A; }
.ax-msg-bot .ax-msg-content em { font-style: italic; }
.ax-msg-bot .ax-msg-content code {
    background: rgba(10,10,10,0.07);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', monospace;
}

.ax-typing {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 2px;
    background: transparent;
    align-self: flex-start;
    width: fit-content;
}

.ax-typing-px {
    width: 18px;
    height: 18px;
    display: block;
    image-rendering: pixelated;
}

#ax-chat-quick-replies {
    padding: 10px 18px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    background: transparent;
    border-top: 1px solid #E8E8E6;
}

.ax-qr {
    background: #fff;
    border: 1px solid #E0E0DE;
    color: #0A0A0A;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 12.5px;
    font-family: 'General Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
    white-space: nowrap;
}

.ax-qr:hover { background: #0A0A0A; color: #fff; border-color: #0A0A0A; }

#ax-chat-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid #E8E8E6;
    flex-shrink: 0;
    background: transparent;
    min-height: 54px;
}

#ax-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'General Sans', sans-serif;
    font-size: 14.5px;
    color: #0A0A0A;
    resize: none;
    padding: 4px 0;
    min-width: 0;
}

#ax-chat-input::placeholder { color: #B0B0B0; }

#ax-chat-send {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1C1C1C 0%, #0A0A0A 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset;
    padding: 0;
}

#ax-chat-send:hover { transform: scale(1.06); box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 16px rgba(10,10,10,0.24); }

#ax-chat-send:disabled { background: #E8E8E6; color: #B0B0B0; cursor: not-allowed; box-shadow: none; transform: none; }

@media (max-width: 768px) {
    #ax-chat-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 136px;
        height: 65vh;
    }
    #ax-chat-toggle {
        right: 16px;
        bottom: 72px;
        padding: 13px 18px 13px 14px;
        font-size: 13px;
    }
}
