/* Chat Tom Élan – widget flottant */

.chat-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Bouton flottant */
.chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: #0b8457;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.chat-toggle-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

.chat-toggle-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-toggle-text strong {
  font-weight: 600;
}

/* Fenêtre de chat */
.chat-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 4.5rem; /* au-dessus du bouton */
  width: 360px;
  max-height: 80vh;
  background: #f5f7fc;
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.chat-header-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
}

.chat-header-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.chat-header-status {
  font-size: 0.75rem;
  color: #6b7280;
}

.chat-header-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}

/* Corps */
.chat-body {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.75rem;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Bulle générique */
.chat-message {
  max-width: 80%;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Bot à gauche */
.chat-message--bot {
  background: #eaf2ff;
  color: #111827;
  border-radius: 16px 16px 16px 4px;
}

/* User à droite */
.chat-message--user {
  margin-left: auto;
  background: #0b8457;
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
}

/* Zone de saisie */
.chat-input {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding-top: 0.25rem;
  border-top: 1px solid #e2e8f0;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
}

.chat-input textarea:focus {
  outline: 2px solid #0b8457;
  outline-offset: 1px;
  border-color: transparent;
}

.chat-send-btn {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: #0b8457;
  color: #ffffff;
  cursor: pointer;
}

/* Accessibilité */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

/* Mobile : plein écran */
@media (max-width: 768px) {
  .chat-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 4.25rem;
    max-height: 80vh;
  }
}
