/* Assistant FLE — styles du widget */
.afle-root {
  --afle-color: #0EA5A4;
  --afle-encre: #123B3A;
  --afle-fond: #F2FBFA;
  --afle-carte: #ffffff;
  --afle-bulle-user: var(--afle-color);
  --afle-bulle-bot: #EAF6F5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--afle-encre);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.afle-root * { box-sizing: border-box; }

.afle-card {
  background: var(--afle-carte);
  border: 1px solid rgba(18,59,58,.12);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(18,59,58,.08);
  height: min(72vh, 640px);
  min-height: 380px;
}

.afle-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--afle-color);
  color: #fff;
}
.afle-avatar { font-size: 22px; }
.afle-title { font-weight: 700; font-size: 17px; }

.afle-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--afle-fond);
}

.afle-msg { display: flex; flex-direction: column; max-width: 88%; }
.afle-msg.afle-user { align-self: flex-end; align-items: flex-end; }
.afle-msg.afle-assistant { align-self: flex-start; align-items: flex-start; }

.afle-bubble {
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.afle-user .afle-bubble {
  background: var(--afle-bulle-user);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.afle-assistant .afle-bubble {
  background: var(--afle-bulle-bot);
  color: var(--afle-encre);
  border-bottom-left-radius: 5px;
}
.afle-bubble strong { font-weight: 700; }

.afle-listen {
  margin-top: 4px;
  background: none;
  border: none;
  color: var(--afle-color);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 3px 4px;
}

.afle-typing { display: flex; gap: 5px; align-items: center; }
.afle-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--afle-color); opacity: .5;
  animation: afle-blink 1.2s infinite both;
}
.afle-typing span:nth-child(2) { animation-delay: .2s; }
.afle-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes afle-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.afle-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(18,59,58,.1);
  background: var(--afle-carte);
}
.afle-input {
  flex: 1;
  resize: none;
  border: 2px solid rgba(18,59,58,.15);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 16px;
  font-family: inherit;
  color: var(--afle-encre);
  max-height: 140px;
  line-height: 1.4;
}
.afle-input:focus { outline: none; border-color: var(--afle-color); }

.afle-send, .afle-mic {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--afle-color);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.afle-mic { background: #fff; color: var(--afle-color); border: 2px solid var(--afle-color); }
.afle-mic.afle-live { background: var(--afle-color); color: #fff; animation: afle-pulse 1s infinite; }
@keyframes afle-pulse { 50% { transform: scale(1.08); } }
.afle-send:disabled { opacity: .5; cursor: default; }
.afle-send.afle-busy { opacity: .6; }

.afle-foot {
  padding: 7px 14px 10px;
  font-size: 11.5px;
  color: rgba(18,59,58,.5);
  text-align: center;
  background: var(--afle-carte);
}
.afle-locked { padding: 40px 20px; text-align: center; font-size: 17px; }

@media (max-width: 480px) {
  .afle-card { height: min(80vh, 640px); border-radius: 14px; }
  .afle-bubble { font-size: 15.5px; }
  .afle-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .afle-typing span, .afle-mic.afle-live { animation: none !important; }
}
