@charset "UTF-8";
/* ==========================================================================
   FARTEC — Chat AI widget
   ========================================================================== */
.chat-fab {
  position: fixed; bottom: 26px; right: 26px; z-index: 200;
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, #0a6cff, #5e5ce6);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 34px -8px rgba(10,108,255,.6);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.chat-fab:hover { transform: scale(1.07); }
.chat-fab svg { width: 28px; height: 28px; }
.chat-fab .badge {
  position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
  background: #ff3b30; color: #fff; border-radius: 980px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
  transform: scale(0); transition: transform .3s var(--ease);
}
.chat-fab .badge.show { transform: scale(1); }

.chat-panel {
  position: fixed; bottom: 26px; right: 26px; z-index: 201;
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 52px));
  background: #fff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.4); border: 1px solid rgba(0,0,0,.06);
  display: flex; flex-direction: column;
  transform: translateY(24px) scale(.96); opacity: 0; pointer-events: none;
  transform-origin: bottom right; transition: transform .4s var(--ease), opacity .35s;
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }

.chat-head {
  background: linear-gradient(135deg, #0a6cff, #5e5ce6); color: #fff;
  padding: 18px 20px; display: flex; align-items: center; gap: 12px;
}
.chat-head .avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-weight: 700; backdrop-filter: blur(6px); }
.chat-head .meta { flex: 1; }
.chat-head .meta strong { font-size: 16px; display: block; letter-spacing: -0.01em; }
.chat-head .meta span { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.chat-head .meta span::before { content:""; width: 7px; height: 7px; border-radius: 50%; background: var(--sdot, #30d158); box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.chat-head .close, .chat-head .op { color: #fff; opacity: .85; line-height: 1; padding: 4px; }
.chat-head .close { font-size: 22px; }
.chat-head .op { display: grid; place-items: center; }
.chat-head .op svg { width: 20px; height: 20px; }
.chat-head .close:hover, .chat-head .op:hover { opacity: 1; }
.chat-head .avatar svg { width: 22px; height: 22px; }

.chat-body { flex: 1; overflow-y: auto; padding: 20px; background: #f5f5f7; display: flex; flex-direction: column; gap: 12px; }
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 6px; }

.msg { max-width: 82%; padding: 12px 15px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; animation: msgIn .4s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.bot { background: #fff; color: var(--ink); align-self: flex-start; border-bottom-left-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.msg.user { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.operator { background: #1d1d1f; color: #fff; align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.operator::before { content: "Operatore"; display: block; font-size: 10.5px; font-weight: 600; opacity: .6; margin-bottom: 3px; }
.chat-note { align-self: center; text-align: center; font-size: 12px; color: var(--ink-soft); background: rgba(0,0,0,.05); padding: 7px 14px; border-radius: 980px; max-width: 90%; animation: msgIn .4s var(--ease); }

.typing { display: flex; gap: 4px; align-self: flex-start; background: #fff; padding: 14px 16px; border-radius: 18px; border-bottom-left-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #c7c7cc; animation: blink 1.3s infinite both; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 8px; background: #f5f5f7; }
.chip { font-size: 13px; padding: 8px 13px; border-radius: 980px; background: #fff; border: 1px solid var(--line); color: var(--ink); transition: background .2s, border .2s; }
.chip:hover { background: #eaf2ff; border-color: var(--brand); color: var(--brand); }

.lead-card { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.05); align-self: stretch; animation: msgIn .4s var(--ease); }
.lead-card h4 { font-size: 15px; margin-bottom: 4px; }
.lead-card p { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.lead-card input { width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); font-size: 14px; font-family: inherit; margin-bottom: 9px; }
.lead-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,108,255,.12); }
.lead-card button { width: 100%; background: var(--brand); color: #fff; padding: 11px; border-radius: 11px; font-size: 14px; font-weight: 500; transition: background .2s; }
.lead-card button:hover { background: var(--brand-deep); }

.chat-input { display: flex; gap: 10px; padding: 14px 16px; background: #fff; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; padding: 12px 14px; border-radius: 980px; border: 1px solid var(--line); font-size: 14.5px; font-family: inherit; }
.chat-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,108,255,.12); }
.chat-input button { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; transition: background .2s, transform .2s; }
.chat-input button:hover { background: var(--brand-deep); }
.chat-input button:active { transform: scale(.92); }
.chat-input button svg { width: 20px; height: 20px; }
.chat-disclaimer { font-size: 10.5px; color: var(--ink-soft); text-align: center; padding: 0 16px 10px; background: #fff; }
