/* FAQ Chatbot — site-wide floating widget */
/* Updated: 2026-10-26 13:20 (Europe/Zurich) */

.faq-chat-widget {
    position: fixed;
    left: var(--space-6, 1.5rem);
    bottom: var(--space-6, 1.5rem);
    z-index: var(--z-popover, 600);
}

.faq-chat-fab {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--color-gray-500);
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.faq-chat-fab:hover {
    background: var(--color-gray-600);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.faq-chat-fab-icon-close {
    display: none;
}

.faq-chat-fab.is-open .faq-chat-fab-icon-open {
    display: none;
}

.faq-chat-fab.is-open .faq-chat-fab-icon-close {
    display: block;
}

.faq-chat-panel {
    position: absolute;
    left: 0;
    bottom: calc(56px + var(--space-4, 1rem));
    width: 380px;
    max-width: calc(100vw - 2 * var(--space-6, 1.5rem));
    max-height: min(560px, 75vh);
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: var(--space-5);
}

.faq-chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.faq-chat-panel-header span {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.faq-chat-panel-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

.faq-chat-panel-close:hover {
    background: var(--color-gray-100);
    color: var(--color-text);
}

.faq-chat-panel .faq-chatbot-subtitle {
    text-align: left;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
}

.faq-chat-panel .faq-chatbot-form {
    flex-direction: column;
}

.faq-chat-panel .faq-chatbot-input {
    /* flex-basis 260px from the row layout is otherwise read as a height
       once the axis flips to column here, ballooning the input */
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.faq-chat-panel .faq-chatbot-submit {
    width: 100%;
}

.faq-chat-panel .faq-chatbot-result {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
}

@media (max-width: 768px) {
    .faq-chat-widget {
        left: var(--space-4, 1rem);
        bottom: var(--space-4, 1rem);
    }

    .faq-chat-fab {
        width: 48px;
        height: 48px;
    }

    .faq-chat-panel {
        width: calc(100vw - 2 * var(--space-4, 1rem));
        max-width: none;
        bottom: calc(48px + var(--space-3, 0.75rem));
    }
}
