/* ============================================================
   HECM Parakou — Hecmo, le robot-assistant de la page d'accueil
   ============================================================ */
.hecmo-eye { transform-box: fill-box; transform-origin: center; animation: hecmo-blink 4.6s infinite; }
@keyframes hecmo-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.hecmo-antenna { transform-box: fill-box; transform-origin: center; animation: hecmo-ping 2s ease-in-out infinite; }
@keyframes hecmo-ping { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

.hc { position: fixed; right: 22px; bottom: 22px; z-index: 1040; font-family: 'Inter', system-ui, sans-serif; }
.hc-fab {
    width: 72px; height: 72px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; position: relative;
    background: linear-gradient(145deg, #ffffff, #e6f5ea); box-shadow: 0 14px 34px rgba(11,47,21,.38), inset 0 0 0 3px #2e9e4f;
    animation: hc-bob 3.4s ease-in-out infinite; transition: transform .2s;
}
.hc-fab:hover { transform: scale(1.08) rotate(-4deg); }
.hc-fab svg { width: 100%; height: 100%; display: block; }
.hc.open .hc-fab { animation: none; }
@keyframes hc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.hc-dot { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: #ff5d73; border: 3px solid #fff; animation: hecmo-ping 1.6s infinite; }
.hc.open .hc-dot, .hc.seen .hc-dot { display: none; }

.hc-hello {
    position: absolute; right: 84px; bottom: 14px; width: max-content; max-width: 230px; background: #fff; color: #13261a;
    padding: 11px 15px; border-radius: 16px 16px 4px 16px; font-size: .86rem; font-weight: 600; line-height: 1.4;
    box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px) scale(.95); pointer-events: none; transition: all .35s;
}
.hc-hello.show { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.hc.open .hc-hello { display: none; }

.hc-panel {
    position: absolute; right: 0; bottom: 86px; width: 380px; max-width: calc(100vw - 28px); height: min(600px, calc(100vh - 130px));
    background: #fff; border-radius: 24px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 30px 80px rgba(8,36,16,.4); transform-origin: bottom right;
    transform: scale(.8) translateY(14px); opacity: 0; visibility: hidden; transition: transform .25s cubic-bezier(.2,.9,.3,1.2), opacity .2s, visibility .2s;
}
.hc.open .hc-panel { transform: none; opacity: 1; visibility: visible; }
.hc-head { position: relative; background: linear-gradient(135deg, #0b2f15, #1a6b2f 70%, #2e9e4f); color: #fff; padding: 16px 18px; display: flex; gap: 12px; align-items: center; overflow: hidden; }
.hc-head::after { content: ""; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hc-av { width: 50px; height: 50px; border-radius: 50%; background: #fff; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(127,255,158,.5); position: relative; }
.hc-av svg { width: 100%; height: 100%; }
.hc-av::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #7fff9e; border: 2px solid #124d22; }
.hc-head b { display: block; font-size: 1rem; }
.hc-head small { opacity: .85; font-size: .74rem; }
.hc-x { margin-left: auto; position: relative; z-index: 1; background: rgba(255,255,255,.16); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.hc-x:hover { background: rgba(255,255,255,.3); }

.hc-body { flex: 1; overflow-y: auto; padding: 16px 14px 6px; background:
    radial-gradient(circle at 15% 10%, rgba(46,158,79,.08), transparent 40%), #f4f9f5; scroll-behavior: smooth; }
.hc-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-end; animation: hc-pop .3s ease both; }
.hc-row.me { justify-content: flex-end; }
@keyframes hc-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.hc-mini { width: 28px; height: 28px; border-radius: 50%; background: #fff; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.hc-mini svg { width: 100%; height: 100%; }
.hc-msg { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.55; word-wrap: break-word; }
.hc-row.bot .hc-msg { background: #fff; color: #13261a; border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(11,47,21,.07); }
.hc-row.me .hc-msg { background: linear-gradient(135deg, #2e9e4f, #1a6b2f); color: #fff; border-bottom-right-radius: 4px; }
.hc-msg a { color: #1a6b2f; font-weight: 700; }
.hc-msg ul { margin: 6px 0 2px; padding-left: 18px; }
.hc-msg b { color: #124d22; }
.hc-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.hc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9fc9aa; animation: hc-dots 1.1s infinite; }
.hc-typing i:nth-child(2) { animation-delay: .18s; } .hc-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes hc-dots { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

.hc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 2px 12px 36px; }
.hc-chip { border: 1.5px solid #bfe0c9; background: #fff; color: #124d22; font-size: .78rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: all .15s; font-family: inherit; }
.hc-chip:hover { background: #2e9e4f; border-color: #2e9e4f; color: #fff; transform: translateY(-1px); }

.hc-foot { padding: 11px 12px; background: #fff; border-top: 1px solid #e4ede7; display: flex; gap: 8px; }
.hc-foot input { flex: 1; border: 1.5px solid #e1ece5; border-radius: 999px; padding: 10px 16px; font-size: .88rem; outline: none; font-family: inherit; background: #f8fcf9; }
.hc-foot input:focus { border-color: #2e9e4f; box-shadow: 0 0 0 4px rgba(46,158,79,.13); background: #fff; }
.hc-send { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(135deg, #2e9e4f, #1a6b2f); color: #fff; box-shadow: 0 6px 14px rgba(26,107,47,.35); transition: transform .15s; }
.hc-send:hover { transform: scale(1.08) rotate(8deg); }

@media (max-width: 520px) {
    .hc { right: 12px; bottom: 12px; }
    .hc-fab { width: 62px; height: 62px; }
    .hc-panel { bottom: 76px; width: calc(100vw - 24px); height: min(560px, calc(100vh - 110px)); }
    .hc-hello { right: 72px; max-width: 180px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .hc-fab, .hecmo-eye, .hecmo-antenna, .hc-dot { animation: none; } }
