/* Tayar (by emoteur) : aux couleurs d'emoteur.ma */
.tayar {
  --t-navy: #1e3a54;
  --t-deep: #142b41;
  --t-cyan: #00d3d7;
  --t-green: #1bc744;
  --t-ground: #f4f7f9;
  --t-line: #dde5ec;
  --t-ink: #1b2a38;
  --t-muted: #5b6b7a;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--t-ink);
}
.tayar *, .tayar *::before, .tayar *::after { box-sizing: border-box; }
.tayar svg { width: 100%; height: 100%; display: block; }
.tayar button { font-family: inherit; box-shadow: none; margin: 0; text-transform: none; letter-spacing: normal; }

/* Bouton d'ouverture */
.tayar-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  padding: 8px 20px 8px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--t-deep);
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 10px 30px rgba(20, 43, 65, 0.28) !important;
  transition: transform .15s ease;
}
.tayar-launcher:hover { transform: translateY(-2px); }
.tayar-launcher:focus-visible, .tayar button:focus-visible, .tayar a:focus-visible, .tayar textarea:focus-visible, .tayar input:focus-visible {
  outline: 2px solid var(--t-cyan);
  outline-offset: 2px;
}
.tayar-launcher-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tayar-launcher-text strong { font-size: 15px; font-weight: 700; }
.tayar-launcher-text span { font-size: 13px; color: #c9d6e2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tayar.is-open .tayar-launcher { display: none; }

.tayar-mark {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--t-cyan);
  overflow: hidden;
}

/* Les yeux clignent ; pendant la réflexion, ils regardent à gauche et à droite. */
.tayar-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: tayar-blink 5s infinite;
}
.tayar-eye + .tayar-eye { animation-delay: .04s; }
.tayar-eyes { transition: transform .3s ease; }
.tayar.is-thinking .tayar-eyes { animation: tayar-look 1.6s infinite ease-in-out; }
@keyframes tayar-blink {
  0%, 44%, 50%, 90%, 100% { transform: scaleY(1); }
  47%, 93% { transform: scaleY(.12); }
  95.5% { transform: scaleY(1); }
  97.5% { transform: scaleY(.12); }
}
@keyframes tayar-look {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-22px); }
  75% { transform: translateX(22px); }
}

/* Panneau */
.tayar-panel {
  display: flex;
  flex-direction: column;
  width: 390px;
  height: min(640px, calc(100vh - 40px));
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(20, 43, 65, 0.3);
}
.tayar-panel[hidden] { display: none; }

.tayar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--t-deep);
  color: #fff;
}
.tayar-head .tayar-mark { width: 40px; height: 40px; }
.tayar-title { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.tayar-title strong { font-size: 17px; font-weight: 700; }
.tayar-title span { font-size: 12.5px; color: #9fd9dc; }
.tayar-icon-btn {
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 0;
  border-radius: 50% !important;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.tayar-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.tayar-notice {
  margin: 0;
  padding: 8px 16px;
  font-size: 12px;
  line-height: 1.4;
  text-align: left !important;
  color: var(--t-muted);
  background: var(--t-ground);
  border-bottom: 1px solid var(--t-line);
}
.tayar-notice a { color: var(--t-navy); text-decoration: underline; }
.tayar-test {
  margin: 0;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  text-align: left !important;
  color: #7a4b00;
  background: #fff4dc;
}

/* Conversation */
.tayar-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}
.tayar-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  word-wrap: break-word;
}
.tayar-msg p { margin: 0 0 8px; text-align: left !important; font-size: inherit; line-height: 1.5; color: inherit; }
.tayar-msg p:last-child { margin-bottom: 0; }
.tayar-msg ul { margin: 4px 0 8px; padding-left: 18px; }
.tayar-msg li { margin: 2px 0; }
.tayar-msg a { color: var(--t-navy); text-decoration: underline; word-break: break-word; }
.tayar-bot { align-self: flex-start; background: var(--t-ground); border-bottom-left-radius: 6px; }
.tayar-user { align-self: flex-end; background: var(--t-navy); color: #fff; border-bottom-right-radius: 6px; }
.tayar-error { background: #fdecec; }
.tayar-retry {
  margin-top: 8px !important;
  padding: 4px 12px;
  border: 1px solid var(--t-navy);
  border-radius: 999px;
  background: #fff;
  color: var(--t-navy);
  font-size: 13px;
  cursor: pointer;
}

.tayar-sources-wrap { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--t-line); font-size: 12.5px; }
.tayar-sources-wrap > span { color: var(--t-muted); font-weight: 600; }
.tayar-sources { list-style: none; margin: 4px 0 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.tayar-sources li { margin: 0 !important; }
.tayar-sources a {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--t-line);
  border-radius: 999px;
  background: #fff;
  text-decoration: none !important;
  color: var(--t-navy);
}
.tayar-rate { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--t-muted); }
.tayar-rate button {
  padding: 2px 12px;
  border: 1px solid var(--t-line);
  border-radius: 999px;
  background: #fff;
  color: var(--t-ink);
  font-size: 12.5px;
  cursor: pointer;
}
.tayar-rate button:hover { border-color: var(--t-cyan); }

.tayar-typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.tayar-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aabbb;
  animation: tayar-dot 1.2s infinite ease-in-out;
}
.tayar-typing span:nth-child(2) { animation-delay: .15s; }
.tayar-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes tayar-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.tayar-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Suggestions */
.tayar-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.tayar-chips:empty { display: none; }
.tayar-chips button {
  padding: 6px 12px;
  border: 1px solid var(--t-cyan);
  border-radius: 999px;
  background: #fff;
  color: var(--t-deep);
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
}
.tayar-chips button:hover { background: #e6fafa; }

/* Barre de contact */
.tayar-contact {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--t-line);
  background: #fff;
}
.tayar-contact button, .tayar-contact a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--t-line);
  border-radius: 999px;
  background: #fff;
  color: var(--t-navy);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.tayar-contact button:hover, .tayar-contact a:hover { border-color: var(--t-navy); }
.tayar-contact .tayar-wa { color: #fff; background: var(--t-green); border-color: var(--t-green); }
.tayar-contact .tayar-wa svg { width: 16px; height: 16px; }
.tayar-contact.is-highlight { animation: tayar-glow 1.6s ease-out 1; }
@keyframes tayar-glow { 0% { background: #e6fafa; } 100% { background: #fff; } }

/* Saisie */
.tayar-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
}
.tayar-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  margin: 0;
  padding: 11px 16px;
  border: 1px solid var(--t-line);
  border-radius: 22px;
  background: var(--t-ground);
  color: var(--t-ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  box-shadow: none;
}
.tayar-form textarea:focus { border-color: var(--t-cyan); background: #fff; outline: none; }
.tayar-send {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 0;
  border-radius: 50% !important;
  background: var(--t-cyan);
  color: var(--t-deep);
  cursor: pointer;
}
.tayar-send:disabled { opacity: .5; cursor: default; }

/* Formulaire de contact */
.tayar-lead { max-width: 100%; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.tayar-lead label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; color: var(--t-ink); margin: 0; }
.tayar-lead input:not([type=checkbox]), .tayar-lead textarea {
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--t-line);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--t-ink);
  box-shadow: none;
}
.tayar-lead .tayar-consent { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 12.5px; line-height: 1.4; color: var(--t-muted); }
.tayar-lead .tayar-consent input { margin-top: 2px; flex: none; }
.tayar-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; }
.tayar-lead-error { color: #b42318; font-size: 12.5px; }
.tayar-lead-error:empty { display: none; }
.tayar-lead-actions { display: flex; gap: 10px; align-items: center; }
.tayar-lead-actions button[type=submit] {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--t-navy);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tayar-link { padding: 0; border: 0; background: none; color: var(--t-muted); text-decoration: underline; font-size: 13px; cursor: pointer; }

/* Mobile */
@media (max-width: 600px) {
  .tayar { right: 12px; bottom: 12px; }
  .tayar-launcher { max-width: calc(100vw - 24px); }
  .tayar.is-open { left: 0; right: 0; bottom: 0; }
  .tayar-panel { width: 100%; height: 88vh; height: 88dvh; border-radius: 24px 24px 0 0; }
  .tayar-contact button, .tayar-contact a { font-size: 12px; padding: 7px 6px; }
}

/* Protection contre les styles du thème (survol, focus, labels) */
.tayar .tayar-launcher:hover, .tayar .tayar-launcher:focus, .tayar .tayar-launcher:active { background: var(--t-deep) !important; color: #fff !important; }
.tayar .tayar-icon-btn:focus, .tayar .tayar-icon-btn:active { background: rgba(255, 255, 255, 0.12) !important; color: #fff !important; }
.tayar .tayar-icon-btn:hover { color: #fff !important; }
.tayar .tayar-send:hover, .tayar .tayar-send:focus, .tayar .tayar-send:active { background: var(--t-cyan) !important; color: var(--t-deep) !important; }
.tayar .tayar-chips button:hover, .tayar .tayar-chips button:focus, .tayar .tayar-chips button:active { background: #e6fafa !important; color: var(--t-deep) !important; }
.tayar .tayar-contact button:hover, .tayar .tayar-contact button:focus, .tayar .tayar-contact button:active { background: #fff !important; color: var(--t-navy) !important; }
.tayar .tayar-contact .tayar-wa:hover, .tayar .tayar-contact .tayar-wa:focus { background: var(--t-green) !important; color: #fff !important; }
.tayar .tayar-rate button:hover, .tayar .tayar-rate button:focus, .tayar .tayar-rate button:active { background: #fff !important; color: var(--t-ink) !important; }
.tayar .tayar-retry:hover, .tayar .tayar-retry:focus { background: #fff !important; color: var(--t-navy) !important; }
.tayar .tayar-lead-actions button[type=submit]:hover, .tayar .tayar-lead-actions button[type=submit]:focus { background: var(--t-deep) !important; color: #fff !important; }
.tayar .tayar-link:hover, .tayar .tayar-link:focus { background: none !important; color: var(--t-ink) !important; }
.tayar .tayar-lead label { padding: 0 !important; gap: 4px; line-height: 1.3; }
.tayar .tayar-form textarea { overflow-y: hidden; }
.tayar .tayar-consent input[type=checkbox] {
  -webkit-appearance: checkbox !important;
  appearance: auto !important;
  display: inline-block !important;
  position: static !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  opacity: 1 !important;
  accent-color: var(--t-navy);
}

@media (prefers-reduced-motion: reduce) {
  .tayar-launcher, .tayar-typing span, .tayar-contact.is-highlight, .tayar-eye, .tayar-eyes { transition: none; animation: none !important; }
}
