/* ===== Chat with Us (added 2026-12-04) =====
   Floating rule-based assistant. The button stacks ABOVE the WhatsApp
   floating button on the inline-end side (WhatsApp: bottom 20px, 56px tall;
   call button sits on the inline-start side), so nothing overlaps on
   desktop or mobile. When the cookie notice is visible the site's floating
   buttons lift (body.cookie-visible .float-btn), and the chat button and
   panel lift by the same amount. While a form is on screen, script.js adds
   body.form-in-view and the chat button fades out with the other floating
   buttons (unless the chat panel is open). */

.ahf-chat-btn{position:fixed;inset-inline-end:20px;bottom:92px;z-index:320;display:inline-flex;align-items:center;gap:8px;border:0;border-radius:999px;padding:13px 18px;background:linear-gradient(135deg,var(--purple,#603080),#34185c);color:#fff;font:inherit;font-weight:700;font-size:.95rem;line-height:1;cursor:pointer;box-shadow:0 8px 22px rgba(34,16,63,.35);transition:transform .2s ease,opacity .25s ease,visibility .25s ease,bottom .25s ease}
.ahf-chat-btn:hover{transform:scale(1.05)}
.ahf-chat-btn svg{flex:0 0 auto}
body.cookie-visible .ahf-chat-btn{bottom:168px}
body.form-in-view:not(.ahf-chat-open) .ahf-chat-btn{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(12px)}

.ahf-chat-panel{position:fixed;inset-inline-end:20px;bottom:164px;z-index:330;width:min(362px,calc(100vw - 28px));height:min(540px,calc(100dvh - 190px));display:flex;flex-direction:column;background:#fff;border:1px solid #e4ddf0;border-radius:18px;box-shadow:0 18px 48px rgba(34,16,63,.30);overflow:hidden}
body.cookie-visible .ahf-chat-panel{bottom:240px}
.ahf-chat-panel[hidden]{display:none}

.ahf-chat-head{display:flex;align-items:center;gap:10px;background:linear-gradient(135deg,var(--purple,#603080),#34185c);color:#fff;padding:12px 14px}
.ahf-chat-head img{width:40px;height:40px;object-fit:contain;background:#fff;border-radius:10px;padding:3px}
.ahf-chat-head .ahf-chat-names{display:flex;flex-direction:column;min-width:0}
.ahf-chat-head strong{font-size:1rem;line-height:1.2}
.ahf-chat-head span{font-size:.8rem;opacity:.88;line-height:1.25}
.ahf-chat-close{margin-inline-start:auto;background:rgba(255,255,255,.16);border:0;color:#fff;width:34px;height:34px;border-radius:50%;font-size:1.15rem;line-height:1;cursor:pointer;flex:0 0 auto}
.ahf-chat-close:hover{background:rgba(255,255,255,.3)}

/* Pre-chat intake form (name / email / mobile, saved before the chat starts) */
.ahf-chat-intake{flex:1 1 auto;overflow-y:auto;padding:16px 14px;background:#f7f4fc;display:flex;flex-direction:column;gap:11px}
.ahf-intake-intro{margin:0;font-size:.93rem;line-height:1.5;color:#2b2b2b}
.ahf-intake-field{display:flex;flex-direction:column;gap:5px;font-size:.88rem;font-weight:700;color:var(--navy-dark,#22103f)}
.ahf-intake-field input{padding:11px 13px;border:1.5px solid #d9ccef;border-radius:10px;font:inherit;font-size:.95rem;font-weight:400;background:#fff}
.ahf-intake-field input:focus{outline:2px solid var(--purple,#603080);outline-offset:1px}
.ahf-intake-error{margin:0;font-size:.88rem;line-height:1.45;color:#b3261e;background:#fdecea;border:1px solid #f3c2bf;border-radius:10px;padding:9px 11px}
.ahf-intake-btn{background:var(--purple,#603080);color:#fff;border:0;border-radius:999px;padding:.72rem 1.2rem;font:inherit;font-weight:700;cursor:pointer}
.ahf-intake-btn:disabled{opacity:.55;cursor:wait}
.ahf-intake-note{margin:0;font-size:.76rem;color:#6b7280;line-height:1.45}

.ahf-chat-msgs{flex:1 1 auto;overflow-y:auto;padding:14px 12px;background:#f7f4fc;display:flex;flex-direction:column;gap:9px}
.ahf-msg{max-width:86%;padding:9px 12px;border-radius:14px;font-size:.93rem;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}
.ahf-msg-bot{align-self:flex-start;background:#fff;border:1px solid #e4ddf0;color:#2b2b2b;border-start-start-radius:4px}
.ahf-msg-user{align-self:flex-end;background:var(--purple,#603080);color:#fff;border-end-end-radius:4px}
.ahf-msg a{color:var(--purple,#603080);font-weight:700;text-decoration:underline}
.ahf-msg-user a{color:#fff}
.ahf-msg-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
.ahf-msg-actions a,.ahf-msg-actions button{display:inline-block;border-radius:999px;padding:.42rem .85rem;font:inherit;font-size:.85rem;font-weight:700;cursor:pointer;text-decoration:none!important}
.ahf-msg-actions a.ahf-act-call,.ahf-msg-actions button.ahf-act-primary{background:var(--purple,#603080);color:#fff;border:1px solid var(--purple,#603080)}
.ahf-msg-actions a.ahf-act-wa{background:#0C7A50;color:#fff;border:1px solid #0C7A50}
.ahf-msg-actions a.ahf-act-form,.ahf-msg-actions button.ahf-act-ghost{background:#fff;color:var(--purple,#603080);border:1.5px solid var(--purple,#603080)}

.ahf-chat-chips{display:flex;flex-wrap:wrap;gap:7px;padding:10px 12px 2px;background:#f7f4fc}
.ahf-chat-chips button{background:#fff;border:1.5px solid #d9ccef;color:var(--purple,#603080);border-radius:999px;padding:.38rem .8rem;font:inherit;font-size:.84rem;font-weight:700;cursor:pointer}
.ahf-chat-chips button:hover{background:var(--purple,#603080);color:#fff}

.ahf-chat-inputrow{display:flex;gap:8px;padding:10px 12px 12px;background:#fff;border-top:1px solid #eee7f8}
.ahf-chat-inputrow input{flex:1 1 auto;min-width:0;padding:11px 13px;border:1.5px solid #d9ccef;border-radius:999px;font:inherit;font-size:.95rem}
.ahf-chat-inputrow input:focus{outline:2px solid var(--purple,#603080);outline-offset:1px}
.ahf-chat-send{background:var(--purple,#603080);color:#fff;border:0;border-radius:999px;padding:.6rem 1.15rem;font:inherit;font-weight:700;cursor:pointer}
.ahf-chat-send:disabled{opacity:.55;cursor:wait}
.ahf-chat-note{margin:0;padding:0 12px 10px;background:#fff;font-size:.76rem;color:#6b7280}

@media (max-width:560px){
  .ahf-chat-btn{inset-inline-end:14px;bottom:76px;padding:11px 14px;font-size:.88rem}
  body.cookie-visible .ahf-chat-btn{bottom:190px}
  .ahf-chat-panel{inset-inline-end:14px;bottom:140px;height:min(520px,calc(100dvh - 165px))}
  body.cookie-visible .ahf-chat-panel{bottom:254px}
}
