/* IntioGEN AI Assistant — styles du widget */

:root {
  --ig-blue: #1F3864;
  --ig-blue-dark: #142544;
  --ig-gold: #B08D57;
  --ig-light: #EAF0F8;
  --ig-grey: #595959;
  --ig-radius: 14px;
}

#ig-ai-launcher {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ig-blue), var(--ig-blue-dark));
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(31, 56, 100, 0.35);
  cursor: pointer;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.15s ease;
}
#ig-ai-launcher:hover { transform: scale(1.06); }
#ig-ai-launcher .ig-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ig-gold);
  border: 2px solid #fff;
}

#ig-ai-window {
  position: fixed;
  bottom: 96px;
  right: 22px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: var(--ig-radius);
  box-shadow: 0 16px 48px rgba(20, 37, 68, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#ig-ai-window.ig-open { display: flex; }

#ig-ai-header {
  background: linear-gradient(135deg, var(--ig-blue), var(--ig-blue-dark));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#ig-ai-header .ig-title { font-weight: 700; font-size: 15px; }
#ig-ai-header .ig-subtitle { font-size: 11px; color: var(--ig-gold); font-weight: 600; letter-spacing: .3px; }
#ig-ai-header-actions { display: flex; align-items: center; gap: 10px; }
#ig-ai-lang-toggle {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 11px;
  border-radius: 20px;
  padding: 3px 9px;
  cursor: pointer;
}
#ig-ai-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.85;
}
#ig-ai-close:hover { opacity: 1; }

#ig-ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #FAFBFD;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ig-msg { max-width: 84%; font-size: 13.5px; line-height: 1.45; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; }
.ig-msg-assistant { align-self: flex-start; background: var(--ig-light); color: #1a1a1a; border-bottom-left-radius: 3px; }
.ig-msg-user { align-self: flex-end; background: var(--ig-blue); color: #fff; border-bottom-right-radius: 3px; }

.ig-typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 12px; }
.ig-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ig-blue); opacity: 0.4; animation: ig-blink 1.2s infinite; }
.ig-typing span:nth-child(2) { animation-delay: 0.2s; }
.ig-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ig-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 0.9; } }

.ig-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.ig-chip {
  background: #fff;
  border: 1px solid var(--ig-blue);
  color: var(--ig-blue);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ig-chip:hover { background: var(--ig-blue); color: #fff; }

.ig-escalate-box {
  align-self: flex-start;
  background: #fff;
  border: 1px dashed var(--ig-gold);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ig-grey);
}
.ig-escalate-box button {
  margin-top: 8px;
  background: var(--ig-gold);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#ig-ai-inputbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #ECECEC;
  background: #fff;
}
#ig-ai-input {
  flex: 1;
  border: 1px solid #DDE3EC;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13.5px;
  outline: none;
}
#ig-ai-input:focus { border-color: var(--ig-blue); }
#ig-ai-send {
  background: var(--ig-blue);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#ig-ai-send:disabled { opacity: 0.5; cursor: default; }

/* ---- Formulaire de lead ---- */
#ig-lead-form {
  padding: 14px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
#ig-lead-form.ig-open { display: flex; }
#ig-lead-form h4 { margin: 0 0 4px; color: var(--ig-blue); font-size: 14px; }
#ig-lead-form p.ig-lead-intro { margin: 0 0 6px; font-size: 12px; color: var(--ig-grey); }
#ig-lead-form input, #ig-lead-form select, #ig-lead-form textarea {
  border: 1px solid #DDE3EC;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}
#ig-lead-form textarea { resize: vertical; min-height: 50px; }
#ig-lead-form button[type="submit"] {
  background: var(--ig-blue);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
#ig-lead-form .ig-lead-back {
  background: none;
  border: none;
  color: var(--ig-grey);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  align-self: flex-start;
}
#ig-lead-confirmation { padding: 20px 14px; text-align: center; color: var(--ig-blue); font-size: 13.5px; display: none; }
#ig-lead-confirmation.ig-open { display: block; }

@media (max-width: 480px) {
  #ig-ai-window {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 84px;
    height: 70vh;
  }
  #ig-ai-launcher { right: 16px; bottom: 16px; }
}
