/* ==========================================================================
   Assistant virtuel GLP — bouton flottant + fenêtre de discussion
   ========================================================================== */

.glp-chat{ position:fixed; right:20px; bottom:20px; z-index:9990; font-family:inherit; }

.glp-chat-toggle{
    position:relative; width:60px; height:60px; border:none; border-radius:50%;
    background:var(--gradient-primary, linear-gradient(-90deg,#0B5D8C,#1189CE)); color:#fff;
    font-size:28px; display:flex; align-items:center; justify-content:center; cursor:pointer;
    box-shadow:0 10px 30px rgba(11,93,140,.35); transition:transform .2s ease;
}
.glp-chat-toggle:hover{ transform:scale(1.06); }
.glp-chat-toggle:focus-visible{ outline:3px solid #FFA529; outline-offset:3px; }
.glp-chat-toggle::before{
    content:""; position:absolute; inset:0; border-radius:50%;
    border:2px solid #1189CE; animation:glpChatPulse 2.2s ease-out infinite;
}
.glp-chat.is-open .glp-chat-toggle::before{ display:none; }
@keyframes glpChatPulse{ from{ transform:scale(1); opacity:.7; } to{ transform:scale(1.5); opacity:0; } }

.glp-chat-ico-close{ display:none; }
.glp-chat.is-open .glp-chat-ico-open{ display:none; }
.glp-chat.is-open .glp-chat-ico-close{ display:inline; }

.glp-chat-badge{
    position:absolute; top:-2px; right:-2px; min-width:20px; height:20px; padding:0 5px;
    border-radius:10px; background:#FFA529; color:#0B2338; font-size:12px; font-weight:700;
    line-height:20px; text-align:center;
}
.glp-chat-badge[hidden]{ display:none; }

.glp-chat-panel{
    position:absolute; right:0; bottom:76px; width:370px; height:560px; max-height:calc(100vh - 110px);
    display:flex; flex-direction:column; background:#fff; border-radius:16px; overflow:hidden;
    box-shadow:0 20px 60px rgba(11,35,56,.25); animation:glpChatIn .2s ease-out;
}
.glp-chat-panel[hidden]{ display:none; }
@keyframes glpChatIn{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:none; } }

.glp-chat-head{
    display:flex; align-items:center; gap:10px; padding:14px 16px;
    background:var(--gradient-primary, linear-gradient(-90deg,#0B5D8C,#1189CE)); color:#fff;
}
.glp-chat-head img{ width:40px; height:40px; border-radius:50%; object-fit:cover; background:#fff; }
.glp-chat-head strong{ display:block; font-size:16px; line-height:1.2; }
.glp-chat-head span{ font-size:12px; opacity:.9; }
.glp-chat-head span i{ color:#4ADE80; font-size:9px; vertical-align:1px; }
.glp-chat-close{ margin-left:auto; background:rgba(255,255,255,.15); border:none; color:#fff; width:32px; height:32px; border-radius:50%; font-size:18px; cursor:pointer; }
.glp-chat-close:hover{ background:rgba(255,255,255,.3); }

.glp-chat-body{ flex:1; overflow-y:auto; padding:16px; background:#EFF6FA; display:flex; flex-direction:column; gap:10px; }

.glp-chat-msg{ max-width:85%; padding:10px 14px; border-radius:14px; font-size:14px; line-height:1.5; word-wrap:break-word; }
.glp-chat-msg.bot{ align-self:flex-start; background:#fff; color:#0F2A43; border-bottom-left-radius:4px; box-shadow:0 2px 6px rgba(11,42,67,.06); }
.glp-chat-msg.user{ align-self:flex-end; background:#1189CE; color:#fff; border-bottom-right-radius:4px; }
.glp-chat-msg a{ color:#0B5D8C; font-weight:600; text-decoration:underline; }
.glp-chat-msg.user a{ color:#fff; }
.glp-chat-msg ul{ margin:6px 0; padding-left:18px; }
.glp-chat-msg li{ margin:2px 0; }
.glp-chat-msg p{ margin:0 0 6px; }
.glp-chat-msg p:last-child{ margin-bottom:0; }

.glp-chat-typing{ display:inline-flex; gap:4px; padding:4px 0; }
.glp-chat-typing i{ width:7px; height:7px; border-radius:50%; background:#8FB8D3; animation:glpChatDot 1.2s infinite; }
.glp-chat-typing i:nth-child(2){ animation-delay:.15s; }
.glp-chat-typing i:nth-child(3){ animation-delay:.3s; }
@keyframes glpChatDot{ 0%,60%,100%{ transform:none; opacity:.5; } 30%{ transform:translateY(-4px); opacity:1; } }

.glp-chat-quick{ display:flex; gap:6px; padding:8px 12px; overflow-x:auto; background:#EFF6FA; border-top:1px solid #DCEAF3; scrollbar-width:thin; }
.glp-chat-quick[hidden]{ display:none; }
.glp-chat-quick button{
    flex:0 0 auto; border:1px solid #1189CE; background:#fff; color:#0B5D8C; border-radius:18px;
    padding:5px 12px; font-size:13px; cursor:pointer; white-space:nowrap;
}
.glp-chat-quick button:hover{ background:#1189CE; color:#fff; }

.glp-chat-form{ display:flex; gap:8px; padding:10px 12px; border-top:1px solid #E5EEF4; background:#fff; }
.glp-chat-form input{ flex:1; min-width:0; border:1px solid #D5E3EC; border-radius:22px; padding:9px 14px; font-size:14px; outline:none; }
.glp-chat-form input:focus{ border-color:#1189CE; box-shadow:0 0 0 3px rgba(17,137,206,.15); }
.glp-chat-form button{ width:40px; height:40px; flex:0 0 40px; border:none; border-radius:50%; background:#FFA529; color:#0B2338; font-size:18px; cursor:pointer; }
.glp-chat-form button:disabled{ opacity:.5; cursor:default; }

.glp-chat-foot{ padding:0 12px 10px; font-size:12px; color:#5B7285; text-align:center; background:#fff; }
.glp-chat-foot a{ color:#0B5D8C; font-weight:600; }

@media (max-width:480px){
    .glp-chat{ right:16px; bottom:16px; }
    .glp-chat-panel{ position:fixed; inset:auto 0 0 0; width:100%; height:calc(100% - 70px); max-height:none; border-radius:16px 16px 0 0; }
    .glp-chat.is-open .glp-chat-toggle{ display:none; }
}

@media (prefers-reduced-motion:reduce){
    .glp-chat-toggle::before, .glp-chat-panel, .glp-chat-typing i{ animation:none; }
}
