/* Widget de Atendimento com IA — fonte única, carregada por todas as páginas */
/* Widget de Atendimento com IA */
.ai-chat-widget { position: fixed; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); right: calc(24px + env(safe-area-inset-right, 0px)); z-index: 9999; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
.ai-chat-trigger { display: inline-flex; align-items: center; gap: 8px; background: #0f5bd8; color: #fff; border: none; border-radius: 9999px; padding: 12px 20px; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(15, 91, 216, 0.4); transition: transform .2s, background-color .2s; min-height: 48px; min-width: 44px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ai-chat-trigger:focus-visible, .ai-chat-close:focus-visible, .ai-chat-input:focus-visible, .ai-chat-send:focus-visible, .ai-chat-contact-btn:focus-visible, .ai-chat-schedule-btn:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.ai-chat-window { position: fixed; bottom: calc(148px + env(safe-area-inset-bottom, 0px)); right: calc(24px + env(safe-area-inset-right, 0px)); width: 380px; max-width: calc(100% - 48px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); height: min(520px, calc(100vh - 110px)); height: min(520px, calc(100dvh - 110px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); background: #0b0f19; color: #f1f5f9; border: 1px solid #1e293b; border-radius: 16px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; overflow: hidden; }
.ai-chat-window[hidden] { display: none; }
.ai-chat-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: #131b2e; border-bottom: 1px solid #1e293b; }
.ai-chat-header-info { display: flex; align-items: center; gap: 10px; }
.ai-chat-status { width: 10px; height: 10px; background: #10b981; border-radius: 50%; display: inline-block; }
.ai-chat-header strong { display: block; font-size: 14px; color: #f1f5f9; }
.ai-chat-header small { display: block; font-size: 11px; color: #94a3b8; }
.ai-chat-close { background: transparent; border: none; color: #94a3b8; font-size: 22px; cursor: pointer; padding: 4px 8px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 6px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ai-chat-quick-actions { padding: 8px 14px; background: #101726; border-bottom: 1px solid #1e293b; }
.ai-chat-contact-btn { width: 100%; background: rgba(56, 189, 248, 0.1); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 8px; padding: 10px 12px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s; min-height: 44px; text-align: center; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.ai-chat-msg-bot { align-self: flex-start; }
.ai-chat-msg-user { align-self: flex-end; }
.ai-chat-bubble { padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.ai-chat-msg-bot .ai-chat-bubble { background: #131b2e; color: #e2e8f0; border: 1px solid #1e293b; }
.ai-chat-msg-user .ai-chat-bubble { background: #0f5bd8; color: #fff; }
.ai-chat-bubble-error { border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.1) !important; color: #fca5a5 !important; }
.ai-chat-bubble a { color: #38bdf8; text-decoration: underline; touch-action: manipulation; }
.ai-chat-bubble a:active { color: #7dd3fc; }
.ai-chat-schedule-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-chat-schedule-btn { background: #1e293b; color: #f1f5f9; border: 1px solid #334155; border-radius: 6px; padding: 8px 12px; font-size: 12px; font-weight: 500; cursor: pointer; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ai-chat-form { display: flex; align-items: center; padding: 10px 12px; background: #131b2e; border-top: 1px solid #1e293b; gap: 8px; }
.ai-chat-input { flex: 1; background: #0b0f19; border: 1px solid #334155; color: #f1f5f9; padding: 10px 12px; border-radius: 8px; font-size: max(16px, 1rem); min-height: 44px; touch-action: manipulation; }
.ai-chat-input:disabled { opacity: 0.6; }
.ai-chat-send { background: #0f5bd8; border: none; color: #fff; border-radius: 8px; padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ai-chat-send:active { background: #0d4eb8; }
.ai-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .ai-chat-trigger:hover { background: #0d4eb8; transform: translateY(-2px); }
  .ai-chat-close:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
  .ai-chat-contact-btn:hover { background: #38bdf8; color: #0b0f19; }
  .ai-chat-schedule-btn:hover { background: #10b981; color: #fff; border-color: #10b981; }
}
.ai-chat-trigger:active { background: #0d4eb8; transform: translateY(0); }
.ai-chat-close:active { color: #fff; background: rgba(255, 255, 255, 0.12); }
.ai-chat-contact-btn:active { background: #38bdf8; color: #0b0f19; }
.ai-chat-schedule-btn:active { background: #10b981; color: #fff; border-color: #10b981; }
@media (max-width: 640px) {
  .ai-chat-window { left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); width: auto; max-width: none; }
}
.ai-chat-bubble-loading span { display: inline-block; width: 5px; height: 5px; margin-right: 3px; background: #94a3b8; border-radius: 50%; animation: ai-pulse 1s infinite alternate; }
.ai-chat-bubble-loading span:nth-child(2) { animation-delay: 0.2s; }
.ai-chat-bubble-loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-pulse { from { opacity: 0.3; transform: scale(0.8); } to { opacity: 1; transform: scale(1.2); } }
