/* Chat direct avec Anthony — lanceur et panneau sur la vitrine (09/09/2026).
   Le panneau ne contient qu'une iframe vers la page de chat de l'application
   (hôte neutre, même site) : aucun cookie ni requête tant que le visiteur
   n'a pas ouvert le panneau et écrit. Couleurs : variables de la page avec
   repli sur la charte (cream, terracotta). */

.chat-launcher {
    position: fixed;
    left: 18px;
    bottom: 22px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px 11px 13px;
    border: 2px solid var(--text-primary, #1f1612);
    border-radius: 999px;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #1f1612);
    font: 600 0.9rem/1.2 var(--font-main, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    cursor: pointer;
    box-shadow: 0 6px 20px var(--shadow, rgba(31, 22, 18, 0.14));
}

.chat-launcher:hover { background: var(--bg-soft, #f5ece2); }

.chat-launcher:focus-visible {
    outline: 3px solid var(--accent-color, #e76f51);
    outline-offset: 2px;
}

.chat-launcher-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color, #e76f51);
    flex: none;
}

.chat-launcher[hidden] { display: none; }

.chat-panel {
    position: fixed;
    left: 18px;
    bottom: 22px;
    z-index: 9995;
    width: 380px;
    max-width: calc(100vw - 36px);
    height: 600px;
    max-height: calc(100vh - 44px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, #e2d2c2);
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    box-shadow: 0 16px 48px var(--shadow-lg, rgba(31, 22, 18, 0.22));
}

.chat-panel[hidden] { display: none; }

.chat-panel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    background: var(--text-primary, #1f1612);
    color: #fff;
    font: 600 0.85rem/1.2 var(--font-main, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.chat-panel-close {
    appearance: none;
    -webkit-appearance: none;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.chat-panel-close:hover { background: rgba(255, 255, 255, 0.12); }

.chat-panel iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: #f4f4f1;
}

/* Sur petit écran : plein écran, et le lanceur remonte au-dessus de la barre
   d'appel à l'action fixe de la landing (64 px), comme le bouton de thème. */
@media (max-width: 767px) {
    .chat-launcher {
        left: 12px;
        bottom: 80px;
        padding: 10px 14px 10px 12px;
        font-size: 0.85rem;
    }

    .chat-panel {
        left: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border: none;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .chat-panel { animation: chat-panel-in 0.2s ease-out; }

    @keyframes chat-panel-in {
        from { transform: translateY(10px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
}
