/* ===================================================================
   NETTELECOM — Widget Agent IA (chat flottant)
   Front uniquement : parle à un webhook n8n configurable (voir ai-agent.js)
   =================================================================== */

#nt-agent-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--nt-gradient, linear-gradient(135deg, #0F056B 0%, #2c1caf 55%, #e6573f 130%));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 5, 107, 0.35);
  transition: transform .25s ease, box-shadow .25s ease;
  font-size: 26px;
}
#nt-agent-launcher:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 16px 36px rgba(15, 5, 107, 0.45); }
#nt-agent-launcher .nt-agent-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

#nt-agent-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 9999;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 5, 107, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  font-family: "Open Sans", sans-serif;
}
#nt-agent-panel.nt-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#nt-agent-header {
  background: var(--nt-gradient, linear-gradient(135deg, #0F056B 0%, #2c1caf 55%, #e6573f 130%));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#nt-agent-header .nt-agent-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
#nt-agent-header .nt-agent-title { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 15px; line-height: 1.2; }
#nt-agent-header .nt-agent-subtitle { font-size: 12px; opacity: .85; }
#nt-agent-header .nt-agent-close {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
#nt-agent-header .nt-agent-close:hover { background: rgba(255,255,255,.25); }

#nt-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f7f8fc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nt-agent-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.nt-agent-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e7e8f2;
  color: #16162c;
  border-bottom-left-radius: 4px;
}
.nt-agent-msg.user {
  align-self: flex-end;
  background: #0F056B;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.nt-agent-msg.error {
  align-self: flex-start;
  background: #fde8e8;
  color: #a12626;
  border: 1px solid #f3c1c1;
}
.nt-agent-msg .nt-agent-src {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  opacity: .65;
}

.nt-agent-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e7e8f2;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.nt-agent-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #b9bcd6;
  animation: nt-bounce 1.2s infinite ease-in-out;
}
.nt-agent-typing span:nth-child(2) { animation-delay: .15s; }
.nt-agent-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes nt-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

#nt-agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  background: #f7f8fc;
}
.nt-agent-suggestion {
  border: 1px solid #e7e8f2;
  background: #fff;
  color: #0F056B;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}
.nt-agent-suggestion:hover { background: #0F056B; color: #fff; border-color: #0F056B; }

#nt-agent-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e7e8f2;
  background: #fff;
}
#nt-agent-input {
  flex: 1;
  border: 1px solid #e7e8f2;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  font-family: "Open Sans", sans-serif;
}
#nt-agent-input:focus { border-color: #0F056B; }
#nt-agent-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: #e6573f;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease;
}
#nt-agent-send:hover { background: #c73f28; }
#nt-agent-send:disabled { background: #ccc; cursor: not-allowed; }

#nt-agent-footer-note {
  font-size: 10.5px;
  text-align: center;
  color: #9aa0b8;
  padding: 6px 10px 10px;
  background: #fff;
}

@media (max-width: 480px) {
  #nt-agent-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
  #nt-agent-launcher { right: 16px; bottom: 16px; }
}
