/* Chatbot module: floating "AI" chat assistant with lead capture. Loaded before app.css. */
.chatbot{--cb-bottom:86px;--cb-right:23px;font-family:var(--body)}
.chatbot-toggle{position:fixed;bottom:var(--cb-bottom);right:var(--cb-right);width:51px;height:51px;display:flex;align-items:center;justify-content:center;background:var(--green-dark);color:var(--paper);border:3px solid var(--paper);border-radius:50%;box-shadow:var(--shadow);z-index:39;cursor:pointer;transition:transform .2s ease,background .2s ease}
.chatbot-toggle:hover{transform:translateY(-2px)}.chatbot-toggle .icon{width:24px;height:24px}
.chatbot-toggle-close,.chatbot.is-open .chatbot-toggle-icon{display:none}.chatbot.is-open .chatbot-toggle-close{display:flex}
.chatbot-nudge{position:absolute;right:calc(100% + 12px);top:50%;transform:translateY(-50%);white-space:nowrap;background:var(--paper);color:var(--ink);font-size:13px;font-weight:500;padding:8px 14px;border-radius:20px;box-shadow:var(--shadow);animation:chatbot-pop .35s ease}
.chatbot-nudge::after{content:"";position:absolute;left:100%;top:50%;margin-top:-6px;border:6px solid transparent;border-left-color:var(--paper)}
@keyframes chatbot-pop{from{opacity:0;transform:translateY(-50%) translateX(6px)}to{opacity:1;transform:translateY(-50%)}}
.chatbot-panel{position:fixed;bottom:calc(var(--cb-bottom) + 64px);right:var(--cb-right);width:min(370px,calc(100vw - 32px));max-height:min(620px,calc(100vh - var(--cb-bottom) - 84px));display:flex;flex-direction:column;background:var(--paper);border-radius:18px;box-shadow:0 18px 60px #26311d2e;z-index:60;overflow:hidden;animation:chatbot-rise .25s ease}
@keyframes chatbot-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.chatbot-head{display:flex;align-items:center;gap:12px;padding:14px 14px 14px 18px;background:var(--green-dark);color:var(--paper)}
.chatbot-head div{flex:1;display:flex;flex-direction:column;line-height:1.3}.chatbot-head strong{font-family:var(--heading);font-weight:500;font-size:15px}.chatbot-head small{font-size:11px;opacity:.85;display:flex;align-items:center;gap:6px}
.chatbot-head .icon-button{color:var(--paper);width:36px;height:36px}.chatbot-head .icon-button:hover{background:#ffffff1f}
.chatbot-avatar{width:40px;height:40px;border-radius:50%;background:var(--gold);color:var(--green-dark);display:flex;align-items:center;justify-content:center;flex:none}
.chatbot-dot{width:8px;height:8px;border-radius:50%;background:#4ade80;box-shadow:0 0 0 3px #4ade8033;display:inline-block}
.chatbot-log{flex:1;overflow-y:auto;padding:18px 16px 8px;display:flex;flex-direction:column;gap:10px;background:var(--cream);scroll-behavior:smooth;min-height:220px}
.chatbot-msg{max-width:86%;padding:10px 14px;border-radius:16px;font-size:14px;line-height:1.55;white-space:pre-wrap;word-break:break-word;animation:chatbot-in .2s ease}
@keyframes chatbot-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.chatbot-msg.assistant{align-self:flex-start;background:var(--paper);color:var(--ink);border-bottom-left-radius:4px;box-shadow:0 2px 10px #26311d0f}
.chatbot-msg.visitor{align-self:flex-end;background:var(--green);color:var(--paper);border-bottom-right-radius:4px}
.chatbot-msg.error{background:#fff1f1;color:var(--danger)}
.chatbot-msg a{color:var(--green);text-decoration:underline}.chatbot-msg.visitor a{color:var(--paper)}
.chatbot-typing{align-self:flex-start;display:flex;gap:5px;padding:14px 16px;background:var(--paper);border-radius:16px;border-bottom-left-radius:4px;box-shadow:0 2px 10px #26311d0f}
.chatbot-typing span{width:7px;height:7px;border-radius:50%;background:var(--muted);opacity:.5;animation:chatbot-blink 1.1s infinite ease-in-out}
.chatbot-typing span:nth-child(2){animation-delay:.18s}.chatbot-typing span:nth-child(3){animation-delay:.36s}
@keyframes chatbot-blink{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.chatbot-cursor::after{content:"▍";color:var(--green);animation:chatbot-blink .9s infinite}
.chatbot-chips{display:flex;flex-wrap:wrap;gap:6px;align-self:flex-start;max-width:92%}
.chatbot-chips button{font:inherit;font-size:12.5px;padding:7px 12px;border:1px solid var(--green);color:var(--green);background:var(--paper);border-radius:20px;cursor:pointer;transition:background .15s,color .15s}
.chatbot-chips button:hover{background:var(--green);color:var(--paper)}
.chatbot-form{display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid var(--line);background:var(--paper)}
.chatbot-form input{flex:1;min-height:42px;border:1px solid var(--line);border-radius:22px;padding:0 16px;font:inherit;font-size:14px;background:var(--soft)}
.chatbot-form input:focus{outline:2px solid var(--green);outline-offset:-1px;background:var(--paper)}
.chatbot-form.ask-contact input{border-color:var(--gold);background:var(--yellow-light)}
.chatbot-send{width:42px;height:42px;border-radius:50%;background:var(--green);color:var(--paper);display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer;border:0}
.chatbot-send:disabled{opacity:.5;cursor:default}.chatbot-send .icon{width:20px;height:20px}
.chatbot-foot{margin:0;padding:0 14px 10px;font-size:10.5px;color:var(--muted);text-align:center;background:var(--paper)}
body.no-scroll-chat{overflow:hidden}
@media(max-width:700px){.chatbot{--cb-bottom:calc(78px + env(safe-area-inset-bottom));--cb-right:14px}
.chatbot-panel{left:0;right:0;bottom:0;width:100%;max-height:calc(100dvh - 8px);height:calc(100dvh - 8px);border-radius:18px 18px 0 0;z-index:70}
.chatbot.is-open .chatbot-toggle{display:none}.chatbot-nudge{font-size:12px}}
@media(prefers-reduced-motion:reduce){.chatbot-panel,.chatbot-msg,.chatbot-nudge{animation:none}.chatbot-typing span,.chatbot-cursor::after{animation-duration:2s}}
