/* =========================================================
   Assistant Dirigeoo - styles du widget
   Charte Dirigeoo : orange CTA #F78E07, bleu fonce #002881, bleu #0D55FF,
   texte #1F2937, fond clair #F5F7FC, bordure #E2E7F3, police Poppins.
   Tous les selecteurs sont prefixes par #leo-chatbot-root pour ne pas
   etre ecrases par les regles generiques du theme Consultio.
   ========================================================= */
#leo-chatbot-root{
  --leo-primary:#002881;
  --leo-primary-dark:#001c5c;
  --leo-accent:#0D55FF;
  --leo-secondary:#F78E07;
  --leo-secondary-dark:#E07E00;
  --leo-ink:#1F2937;
  --leo-grey:#6B7280;
  --leo-border:#E2E7F3;
  --leo-bg:#F5F7FC;
  --leo-white:#FFFFFF;
  font-family:'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color:var(--leo-ink);
}
#leo-chatbot-root *{ box-sizing:border-box; }
#leo-chatbot-root button,
#leo-chatbot-root input{ font-family:inherit; text-transform:none; letter-spacing:normal; }
#leo-chatbot-root [hidden]{ display:none !important; }

/* Bulle de lancement : orange de la charte, pastille navy */
#leo-chatbot-root .leo-launcher{
  position:fixed; bottom:26px; right:26px;
  width:60px; height:60px; padding:0; border-radius:50%;
  background:var(--leo-secondary);
  box-shadow:0 10px 28px rgba(247,142,7,.35);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; z-index:99998; border:none; color:#fff;
  transition:transform .18s ease, background .18s ease;
}
#leo-chatbot-root .leo-launcher:hover,
#leo-chatbot-root .leo-launcher:focus{ background:var(--leo-secondary-dark) !important; color:#fff !important; transform:scale(1.06); }
#leo-chatbot-root .leo-launcher .leo-dot{
  position:absolute; top:-3px; right:-3px; width:14px; height:14px;
  border-radius:50%; background:var(--leo-primary); border:2px solid #fff;
}
#leo-chatbot-root .leo-launcher.leo-hidden{ display:none; }
#leo-chatbot-root .leo-launcher svg{ width:28px; height:28px; color:#fff; display:block; stroke-width:2.2; }
#leo-chatbot-root .leo-launcher .zmdi{ font-size:26px; line-height:1; color:#fff !important; }

/* Bulle d'invitation (ordinateur uniquement) */
#leo-chatbot-root .leo-invite{
  position:fixed; bottom:36px; right:100px; z-index:99997;
  display:flex; align-items:center; gap:2px;
  background:#fff; border:1px solid var(--leo-border); border-radius:14px;
  box-shadow:0 10px 30px rgba(15,23,42,.16); padding:4px 4px 4px 4px;
}
#leo-chatbot-root .leo-invite-text{
  background:transparent; border:none; padding:8px 8px 8px 12px; cursor:pointer;
  font-size:13px; font-weight:600; color:var(--leo-primary); line-height:1.3; text-align:left;
}
#leo-chatbot-root .leo-invite-text:hover{ background:transparent !important; color:var(--leo-secondary-dark) !important; }
#leo-chatbot-root .leo-invite-x{
  background:transparent; border:none; width:26px; height:26px; padding:0; border-radius:50%;
  cursor:pointer; color:var(--leo-grey); display:flex; align-items:center; justify-content:center;
}
#leo-chatbot-root .leo-invite-x:hover{ background:var(--leo-bg) !important; color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-invite-x .zmdi{ font-size:14px; line-height:1; }
@media (max-width:768px){ #leo-chatbot-root .leo-invite{ display:none !important; } }

/* Panneau */
#leo-chatbot-root .leo-panel{
  position:fixed; bottom:22px; right:22px;
  width:380px; max-width:calc(100vw - 24px);
  height:600px; max-height:calc(100vh - 40px);
  background:var(--leo-white); border-radius:16px;
  box-shadow:0 22px 60px rgba(15,23,42,0.28);
  display:flex; flex-direction:column; overflow:hidden;
  z-index:99999; opacity:0; transform:translateY(14px) scale(.98);
  pointer-events:none; transition:opacity .18s ease, transform .18s ease;
}
#leo-chatbot-root .leo-panel.leo-open{ opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }

/* En-tete : orange de la charte, texte blanc gras */
#leo-chatbot-root .leo-header{
  background:var(--leo-secondary);
  color:#fff; padding:14px 16px; display:flex; align-items:center; gap:10px;
}
#leo-chatbot-root .leo-avatar{
  width:36px; height:36px; border-radius:50%; background:#fff; color:var(--leo-primary);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:15px; flex-shrink:0;
}
#leo-chatbot-root .leo-who{ flex:1; }
#leo-chatbot-root .leo-who .leo-name{ font-weight:700; font-size:14.5px; color:#fff; }
#leo-chatbot-root .leo-who .leo-status{ font-size:11.5px; color:#fff; opacity:.95; display:flex; align-items:center; gap:5px; }
#leo-chatbot-root .leo-who .leo-status .leo-online-dot{ width:7px; height:7px; background:#22C55E; border:1px solid #fff; border-radius:50%; display:inline-block; }
#leo-chatbot-root .leo-who .leo-status.leo-offline .leo-online-dot{ background:#E5E7EB; }
#leo-chatbot-root .leo-header button{
  background:rgba(255,255,255,0.22); border:none; color:#fff; width:28px; height:28px; padding:0;
  border-radius:7px; cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center;
}
#leo-chatbot-root .leo-header button:hover,
#leo-chatbot-root .leo-header button:focus{ background:rgba(255,255,255,0.38) !important; color:#fff !important; }
#leo-chatbot-root .leo-header button .zmdi{ font-size:16px; line-height:1; color:#fff !important; }

/* Messages */
#leo-chatbot-root .leo-messages{
  flex:1; overflow-y:auto; padding:16px 12px; background:var(--leo-bg);
  display:flex; flex-direction:column; gap:9px;
}
#leo-chatbot-root .leo-row{ display:flex; gap:7px; align-items:flex-end; }
#leo-chatbot-root .leo-row.leo-user{ justify-content:flex-end; }
#leo-chatbot-root .leo-row.leo-bot .leo-mini-avatar{
  width:24px; height:24px; border-radius:50%; background:var(--leo-primary); color:#fff;
  font-size:10.5px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
#leo-chatbot-root .leo-bubble{
  max-width:80%; padding:9px 13px; border-radius:13px; font-size:13px; line-height:1.5;
  white-space:pre-wrap; box-shadow:0 1px 2px rgba(15,23,42,0.06);
}
#leo-chatbot-root .leo-row.leo-bot .leo-bubble{ background:#fff; color:var(--leo-ink); border:1px solid var(--leo-border); border-bottom-left-radius:4px; }
#leo-chatbot-root .leo-row.leo-user .leo-bubble{ background:var(--leo-accent); color:#fff; border-bottom-right-radius:4px; }
#leo-chatbot-root .leo-bubble b{ font-weight:700; }
#leo-chatbot-root .leo-privacy-note{ display:block; margin-top:6px; font-size:11px; line-height:1.4; color:var(--leo-grey); }
#leo-chatbot-root .leo-privacy-note a{ color:var(--leo-primary); text-decoration:underline; }

#leo-chatbot-root .leo-typing{
  display:flex; gap:4px; padding:11px 13px; background:#fff; border:1px solid var(--leo-border);
  border-radius:13px; border-bottom-left-radius:4px; width:fit-content;
}
#leo-chatbot-root .leo-typing span{ width:5px; height:5px; background:#B9C2D0; border-radius:50%; animation:leo-blink 1.2s infinite ease-in-out; }
#leo-chatbot-root .leo-typing span:nth-child(2){ animation-delay:.2s; }
#leo-chatbot-root .leo-typing span:nth-child(3){ animation-delay:.4s; }
@keyframes leo-blink{ 0%,80%,100%{opacity:.3; transform:translateY(0);} 40%{opacity:1; transform:translateY(-2px);} }

/* Options (chips) : texte bleu fonce lisible au survol et au focus */
#leo-chatbot-root .leo-chips{ display:flex; flex-wrap:wrap; gap:7px; padding:2px 30px 4px 0; }
#leo-chatbot-root .leo-chip{
  display:inline-flex; align-items:center; height:auto; min-height:0; margin:0;
  background:#EAF0FF; color:var(--leo-primary); border:1px solid #C9DBFB; border-radius:18px;
  padding:7px 13px; font-size:12.5px; font-weight:600; line-height:1.3; cursor:pointer;
  box-shadow:none; transition:background .15s ease, transform .1s ease;
}
#leo-chatbot-root .leo-chip:hover,
#leo-chatbot-root .leo-chip:focus,
#leo-chatbot-root .leo-chip:hover .zmdi,
#leo-chatbot-root .leo-chip:focus .zmdi{ color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-chip:hover{ background:#D7E5FF !important; transform:translateY(-1px); }
#leo-chatbot-root .leo-chip:disabled{ opacity:.45; cursor:default; transform:none; }
#leo-chatbot-root .leo-chip:disabled:hover{ background:#EAF0FF !important; transform:none; }
#leo-chatbot-root .leo-chip.leo-chip-cta{ background:var(--leo-secondary); color:#fff; border-color:var(--leo-secondary); }
#leo-chatbot-root .leo-chip.leo-chip-cta .zmdi{ color:#fff !important; }
#leo-chatbot-root .leo-chip.leo-chip-cta:hover,
#leo-chatbot-root .leo-chip.leo-chip-cta:focus,
#leo-chatbot-root .leo-chip.leo-chip-cta:hover .zmdi,
#leo-chatbot-root .leo-chip.leo-chip-cta:focus .zmdi{ color:#fff !important; }
#leo-chatbot-root .leo-chip.leo-chip-cta:hover{ background:var(--leo-secondary-dark) !important; border-color:var(--leo-secondary-dark) !important; }
#leo-chatbot-root .leo-chip.leo-chip-cta:disabled:hover{ background:var(--leo-secondary) !important; border-color:var(--leo-secondary) !important; }
#leo-chatbot-root .leo-chip.leo-chip-back{ background:transparent; border-color:var(--leo-border); color:var(--leo-grey); font-weight:500; }
#leo-chatbot-root .leo-chip.leo-chip-back .zmdi{ color:var(--leo-grey) !important; }
#leo-chatbot-root .leo-chip.leo-chip-back:hover,
#leo-chatbot-root .leo-chip.leo-chip-back:focus,
#leo-chatbot-root .leo-chip.leo-chip-back:hover .zmdi{ color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-chip.leo-chip-back:hover{ background:#fff !important; border-color:#C9DBFB !important; }
#leo-chatbot-root .leo-chip-icon{ display:inline-flex; align-items:center; justify-content:center; margin-right:6px; flex-shrink:0; }
#leo-chatbot-root .leo-chip-icon svg{ width:14px; height:14px; }
#leo-chatbot-root .leo-chip-icon .zmdi{ font-size:15px; line-height:1; }

/* Calendrier de rendez-vous */
#leo-chatbot-root .leo-chips.leo-cal-wrap{ display:block; padding:2px 0 4px 0; }
#leo-chatbot-root .leo-cal{
  background:#fff; border:1px solid var(--leo-border); border-radius:12px; padding:12px;
  box-shadow:0 1px 2px rgba(15,23,42,0.06);
}
#leo-chatbot-root .leo-cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
#leo-chatbot-root .leo-cal-title{ font-weight:700; font-size:13.5px; color:var(--leo-primary); text-transform:capitalize; }
#leo-chatbot-root .leo-cal-nav{
  width:30px; height:30px; padding:0; border-radius:8px; border:1px solid var(--leo-border);
  background:#fff; color:var(--leo-primary); cursor:pointer; display:flex; align-items:center; justify-content:center;
}
#leo-chatbot-root .leo-cal-nav .zmdi{ font-size:16px; line-height:1; color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-cal-nav:hover:not(:disabled){ background:#EAF0FF !important; color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-cal-nav:disabled{ opacity:.35; cursor:default; }
#leo-chatbot-root .leo-cal-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:4px; }
#leo-chatbot-root .leo-cal-dow span{ text-align:center; font-size:10.5px; font-weight:600; color:var(--leo-grey); padding:2px 0; }
#leo-chatbot-root .leo-cal-day{
  height:32px; padding:0; border-radius:8px; border:none; background:transparent;
  font-size:12.5px; font-weight:500; color:var(--leo-ink); cursor:pointer;
}
#leo-chatbot-root .leo-cal-day:hover:not(:disabled){ background:#EAF0FF !important; color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-cal-day:disabled{ color:#C0C7D4; cursor:default; background:transparent; }
#leo-chatbot-root .leo-cal-day.leo-sel,
#leo-chatbot-root .leo-cal-day.leo-sel:hover{ background:var(--leo-secondary) !important; color:#fff !important; }
#leo-chatbot-root .leo-cal-sub{ font-size:11.5px; font-weight:600; color:var(--leo-grey); margin:10px 0 6px; }
#leo-chatbot-root .leo-cal-times{ display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; }
#leo-chatbot-root .leo-cal-time{
  border:1px solid #C9DBFB; background:#EAF0FF; color:var(--leo-primary); border-radius:8px;
  padding:6px 0; font-size:12px; font-weight:600; cursor:pointer;
}
#leo-chatbot-root .leo-cal-time:hover{ background:#D7E5FF !important; color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-cal-time.leo-sel,
#leo-chatbot-root .leo-cal-time.leo-sel:hover{ background:var(--leo-secondary) !important; border-color:var(--leo-secondary) !important; color:#fff !important; }
#leo-chatbot-root .leo-cal-confirm{ margin-top:12px; width:100%; justify-content:center; }
#leo-chatbot-root .leo-cal-tz{ margin-top:8px; font-size:10.5px; color:var(--leo-grey); text-align:center; }

/* Zone de saisie : texte noir de la charte, aide en gris, bordure fine */
#leo-chatbot-root .leo-composer{ display:flex; gap:7px; padding:11px; border-top:1px solid var(--leo-border); background:#fff; }
#leo-chatbot-root .leo-composer input{
  flex:1; min-width:0; height:auto !important; padding:9px 11px !important;
  border:1px solid var(--leo-border) !important; border-radius:9px !important; background:#fff !important;
  color:var(--leo-ink) !important; caret-color:var(--leo-ink);
  font-size:13.5px; font-weight:400; line-height:1.4; outline:none; box-shadow:none !important;
}
#leo-chatbot-root .leo-composer input::placeholder{ color:var(--leo-grey); opacity:1; }
#leo-chatbot-root .leo-composer input:focus{ border-color:var(--leo-primary) !important; }
#leo-chatbot-root .leo-composer button{
  background:var(--leo-accent); border:none; color:#fff; width:40px; height:40px; padding:0; border-radius:9px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
#leo-chatbot-root .leo-composer button:hover,
#leo-chatbot-root .leo-composer button:focus{ background:var(--leo-primary) !important; color:#fff !important; }
#leo-chatbot-root .leo-composer button svg{ width:16px; height:16px; }
#leo-chatbot-root .leo-composer button .zmdi{ font-size:18px; line-height:1; color:#fff !important; }

/* Champ piege anti-spam (invisible) */
#leo-chatbot-root .leo-hp{ position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }

#leo-chatbot-root .leo-footnote{ font-size:10px; color:var(--leo-grey); text-align:center; padding:5px 10px 9px; background:#fff; }
#leo-chatbot-root .leo-footnote a{ color:var(--leo-grey); text-decoration:underline; }

#leo-chatbot-root .leo-messages::-webkit-scrollbar{ width:5px; }
#leo-chatbot-root .leo-messages::-webkit-scrollbar-thumb{ background:#CBD5E1; border-radius:3px; }

@media (max-width:480px){
  #leo-chatbot-root .leo-panel{ right:10px; left:10px; width:auto; bottom:10px; height:calc(100vh - 90px); height:calc(100dvh - 90px); }
  #leo-chatbot-root .leo-launcher{ right:16px; bottom:16px; }
  #leo-chatbot-root .leo-cal-times{ grid-template-columns:repeat(3, 1fr); }
}

/* Icones (zmdi : Material Design Iconic Font, deja chargee par le theme) */
#leo-chatbot-root .leo-avatar svg{ width:20px; height:20px; color:var(--leo-primary); display:block; }
#leo-chatbot-root .leo-mini-avatar svg{ width:15px; height:15px; color:#fff; display:block; }

/* Neutralise la regle generique button du theme (degrade bleu, ombre, line-height 51px) pour tous les boutons du widget */
#leo-chatbot-root button{ box-shadow:none; background-size:auto; background-position:0 0; text-shadow:none; filter:none; line-height:1.3; height:auto; min-height:0; }
#leo-chatbot-root .leo-launcher{ height:60px; }
#leo-chatbot-root .leo-header button,
#leo-chatbot-root .leo-composer button{ height:28px; line-height:1; }
#leo-chatbot-root .leo-composer button{ height:40px; }
#leo-chatbot-root .leo-cal-nav{ height:30px; }
#leo-chatbot-root .leo-cal-day{ height:32px; }
#leo-chatbot-root .leo-invite-x{ height:26px; }
#leo-chatbot-root .leo-launcher{ box-shadow:0 10px 28px rgba(247,142,7,.35); }
