/* Assistant virtuel MOOVEA — widget */
.mv-chat-launcher {
  position: fixed;
  left: 24px;
  bottom: 28px;
  z-index: 950;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--blue-main, #00AEEF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 174, 239, 0.45);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease, box-shadow 0.3s ease;
}
.mv-chat-launcher:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(0, 174, 239, 0.55); }
.mv-chat-launcher:focus-visible,
.mv-chat-panel button:focus-visible,
.mv-chat-panel a:focus-visible,
.mv-chat-panel input:focus-visible,
.mv-chat-log:focus-visible { outline: 3px solid var(--pink, #FC537F); outline-offset: 2px; }
.mv-chat-launcher.mv-hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }

.mv-chat-panel {
  position: fixed;
  left: 24px;
  bottom: 104px;
  z-index: 960;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 128px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--text, #2c2c2c);
  border-radius: 18px;
  box-shadow: 0 12px 56px rgba(26, 26, 46, 0.28);
  overflow: hidden;
  font-family: var(--font-body, 'Quicksand', sans-serif);
  font-size: 15px;
  line-height: 1.45;
}
.mv-chat-panel[hidden] { display: none; }
.mv-chat-panel *, .mv-chat-panel *::before, .mv-chat-panel *::after { box-sizing: border-box; }

.mv-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 14px 18px;
  background: var(--dark, #1a1a2e);
  color: #fff;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, #37BDFD, #00AEEF, #FC537F, #FCA962, #ADD335) 1;
}
.mv-chat-title { flex: 1; min-width: 0; }
.mv-chat-title h2 { margin: 0; font-family: var(--font-title, 'Poppins', sans-serif); font-weight: 800; font-size: 16px; color: #fff; letter-spacing: 0; }
.mv-chat-title p { margin: 2px 0 0; font-size: 12px; opacity: 0.75; }
.mv-chat-iconbtn, .mv-chat-reset {
  border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-family: inherit;
}
.mv-chat-iconbtn { width: 36px; height: 36px; }
.mv-chat-reset { font-size: 12px; font-weight: 600; padding: 6px 8px; opacity: 0.9; }
.mv-chat-iconbtn:hover, .mv-chat-reset:hover { background: rgba(255, 255, 255, 0.14); }

.mv-chat-log {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-light, #f8fafc);
  overscroll-behavior: contain;
}
.mv-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mv-msg-bot { align-self: flex-start; background: #fff; border: 1px solid #e3e8ef; border-bottom-left-radius: 4px; }
.mv-msg-user { align-self: flex-end; background: var(--blue-main, #00AEEF); color: #fff; border-bottom-right-radius: 4px; }
.mv-msg-error { border-color: var(--pink, #FC537F); background: #fff4f7; }

.mv-typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.mv-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-light, #5a5a7a); animation: mv-bounce 1.2s infinite ease-in-out; }
.mv-typing span:nth-child(2) { animation-delay: 0.15s; }
.mv-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mv-bounce { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.mv-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.mv-chip {
  font-family: inherit; font-size: 13px; font-weight: 600; text-align: left;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--blue-main, #00AEEF); background: #fff; color: #006c9a;
  transition: background 0.2s ease, color 0.2s ease;
}
.mv-chip:hover { background: var(--blue-main, #00AEEF); color: #fff; }

.mv-chat-quick { display: flex; gap: 6px; padding: 8px 10px; background: #fff; border-top: 1px solid #e3e8ef; }
.mv-chat-quick-btn {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 6px; border-radius: 10px; text-decoration: none;
  font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center;
  background: #eef7fc; color: #006c9a; border: 1px solid #cfe9f6;
}
.mv-chat-quick-btn svg { flex: none; }
.mv-chat-quick-btn:hover { background: var(--blue-main, #00AEEF); color: #fff; }

.mv-chat-form { display: flex; gap: 8px; padding: 10px 10px 6px; background: #fff; }
.mv-chat-input {
  flex: 1; min-width: 0; font-family: inherit; font-size: 16px; /* 16px : évite le zoom auto sur iOS */
  padding: 11px 14px; border: 1.5px solid #cfd8e3; border-radius: 12px; background: #fff; color: var(--text, #2c2c2c);
}
.mv-chat-input:focus { border-color: var(--blue-main, #00AEEF); }
.mv-chat-send {
  flex: none; width: 46px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--blue-main, #00AEEF); color: #fff; display: flex; align-items: center; justify-content: center;
}
.mv-chat-send:disabled { opacity: 0.5; cursor: default; }
.mv-chat-notice { margin: 0; padding: 4px 14px 12px; background: #fff; font-size: 11px; line-height: 1.4; color: var(--text-light, #5a5a7a); }
.mv-chat-notice a { color: #006c9a; text-decoration: underline; }

@media (max-width: 639px) {
  .mv-chat-launcher { width: 52px; height: 52px; left: 16px; bottom: 20px; }
  .mv-chat-launcher svg { width: 24px; height: 24px; }
  /* Feuille du bas : pleine largeur */
  .mv-chat-panel {
    left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: 82vh; height: 82dvh; max-height: 82dvh;
    border-radius: 18px 18px 0 0;
  }
  .mv-chat-quick-btn { font-size: 11.5px; padding: 8px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .mv-chat-launcher, .mv-chip { transition: none; }
  .mv-typing span { animation: none; opacity: 0.7; }
}
