/* ════════════════════════════════════════════════════════════
   LYAECO Chatbot — Apple Intelligence Glassmorphism
   Dark mode · Toutes les classes JS conservées
   ════════════════════════════════════════════════════════════ */

#lyaeco-chatbot *,
#lyaeco-chat-inline * {
  box-sizing: border-box;
  font-family: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Wrapper widget ─────────────────────────────────────── */
#lyaeco-chatbot {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 9999;
}

/* ─── WhatsApp float override ────────────────────────────── */
.wa-float {
  bottom: 20px !important;
  right: 20px !important;
}

/* ─── Bouton flottant ────────────────────────────────────── */
.lyaeco-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 8px 32px rgba(11,58,143,0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.lyaeco-btn img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
}

.lyaeco-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 4px 16px rgba(252,105,47,0.4);
}

.lyaeco-btn.lyaeco-btn-active {
  background: rgba(11,58,143,0.3);
  border-color: rgba(252,105,47,0.5);
}

@keyframes lyaecoBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25%       { transform: translateY(-10px) scale(1.04); }
  55%       { transform: translateY(-4px) scale(1.01); }
}
.lyaeco-btn.lyaeco-bounce { animation: lyaecoBounce 0.85s ease; }

/* ─── Bulle d'accroche ───────────────────────────────────── */
.lyaeco-bubble {
  position: absolute;
  bottom: 72px;
  right: 0;
  background: rgba(15,23,42,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px 14px 4px 14px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  display: none;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lyaeco-bubble.lyaeco-bubble-in { opacity: 1; transform: translateY(0); }
.lyaeco-bubble-x {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  padding: 0;
  line-height: 1;
}
.lyaeco-bubble-x:hover { color: #fff; }

/* ─── Fenêtre de chat (widget) ───────────────────────────── */
.lyaeco-win {
  position: fixed;
  bottom: 182px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: 70vh;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.88) translateY(16px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease, visibility 0s 0.32s;
  z-index: 9998;
}
.lyaeco-win.lyaeco-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease, visibility 0s 0s;
}

/* ─── Header ─────────────────────────────────────────────── */
.lyaeco-hdr {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.lyaeco-hdr-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lyaeco-hdr-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
}
.lyaeco-hdr-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.lyaeco-hdr-status {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.lyaeco-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.3);
  animation: lyaecoDotPulse 2s ease-in-out infinite;
}
@keyframes lyaecoDotPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.lyaeco-x {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.lyaeco-x:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ─── Zone messages ──────────────────────────────────────── */
.lyaeco-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scroll-behavior: smooth;
}
.lyaeco-msgs::-webkit-scrollbar { width: 3px; }
.lyaeco-msgs::-webkit-scrollbar-track { background: transparent; }
.lyaeco-msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

/* Messages */
.lyaeco-msg {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.lyaeco-msg.lyaeco-msg-in { opacity: 1; transform: translateY(0); }
.lyaeco-msg-bot  { justify-content: flex-start; }
.lyaeco-msg-user { justify-content: flex-end; }

/* Avatar bot à côté du message */
.lyaeco-msg-bot::before {
  content: '';
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: url('../images/assistant-ia-v3.png') center/cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
  align-self: flex-end;
  margin-bottom: 2px;
}

.lyaeco-bubble-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
}
.lyaeco-msg-bot .lyaeco-bubble-msg {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-bottom-left-radius: 4px;
}
.lyaeco-msg-user .lyaeco-bubble-msg {
  background: rgba(255,255,255,0.95);
  color: #0B3A8F;
  font-weight: 700;
  border-bottom-right-radius: 4px;
}

/* Indicateur de frappe */
.lyaeco-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  margin-left: 31px;
}
.lyaeco-typing span {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  display: inline-block;
  animation: lyaecoTyping 1.1s infinite;
}
.lyaeco-typing span:nth-child(2) { animation-delay: 0.18s; }
.lyaeco-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes lyaecoTyping {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%       { transform: translateY(-5px); opacity: 1; }
}

/* ─── Carte devis ────────────────────────────────────────── */
.lyaeco-devis {
  margin: 2px 0;
  background: rgba(11,58,143,0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(252,105,47,0.5);
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
}
.lyaeco-devis-ttl {
  font-weight: 900;
  font-size: 14px;
  color: #4A90D9;
  margin-bottom: 10px;
}
.lyaeco-devis-pack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}
.lyaeco-devis-pack strong { font-size: 15px; color: #fff; }
.lyaeco-devis-pack span   { font-size: 11px; color: rgba(255,255,255,0.6); }
.lyaeco-devis-res {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  font-style: italic;
  margin: 0 0 8px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.07);
  border-radius: 7px;
  border-left: 3px solid #0B3A8F;
}
.lyaeco-devis-opts {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lyaeco-devis-opts li {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lyaeco-opt-p { font-weight: 700; color: #fbbf24; }
.lyaeco-devis-tot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: #FC692F;
  border-radius: 9px;
  margin-bottom: 7px;
}
.lyaeco-devis-tot span  { color: rgba(255,255,255,.82); font-size: 12px; font-weight: 700; }
.lyaeco-devis-tot strong{ color: #fff; font-size: 20px; font-weight: 900; }
.lyaeco-maint-note { font-size: 10px; color: rgba(255,255,255,0.45); text-align: right; margin: 0 0 7px; }
.lyaeco-btn-email {
  width: 100%;
  background: #FC692F;
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.lyaeco-btn-email:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(252,105,47,0.4);
}

/* ─── Formulaire email ───────────────────────────────────── */
.lyaeco-email-area {
  background: rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 14px;
  flex-shrink: 0;
}
.lyaeco-ef p {
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
  margin: 0 0 9px;
  font-weight: 600;
}
.lyaeco-ef input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 7px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.lyaeco-ef input::placeholder { color: rgba(255,255,255,0.45); }
.lyaeco-ef input:focus {
  border-color: rgba(11,58,143,0.7);
  background: rgba(255,255,255,0.15);
}
.lyaeco-ef input.lyaeco-err { border-color: #ef4444; }
.lyaeco-ef-btn {
  width: 100%;
  background: #FC692F;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}
.lyaeco-ef-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.lyaeco-ef-note {
  font-size: 10.5px;
  color: rgba(255,255,255,0.4);
  text-align: center;
  margin: 5px 0 0;
}
.lyaeco-ef-ok { text-align: center; }
.lyaeco-ef-icon { font-size: 30px; margin-bottom: 6px; }
.lyaeco-ef-ok strong { display: block; font-size: 14px; color: #4A90D9; margin-bottom: 4px; }
.lyaeco-ef-ok p { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 10px; }
.lyaeco-wa-btn {
  display: inline-block;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 800;
}

/* ─── Zone de saisie ─────────────────────────────────────── */
.lyaeco-input-row {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 9px 11px;
  display: flex;
  gap: 7px;
  align-items: center;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.lyaeco-input-row input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 8px 13px;
  font-size: 16px;
  font-family: inherit;
  color: #fff;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.lyaeco-input-row input::placeholder { color: rgba(255,255,255,0.4); }
.lyaeco-input-row input:focus {
  border-color: rgba(11,58,143,0.7);
  background: rgba(255,255,255,0.15);
}
.lyaeco-input-row input:disabled { opacity: 0.45; cursor: not-allowed; }
#lyaeco-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FC692F;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(252,105,47,0.4);
}
#lyaeco-send:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(252,105,47,0.5);
}
#lyaeco-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
#lyaeco-send svg path { fill: #fff; }

/* ─── Mode pleine page ───────────────────────────────────── */
.lyaeco-fp-hero {
  text-align: center;
  padding: 52px 20px 36px;
  background: radial-gradient(circle at 50% 0%, rgba(11,58,143,.15), transparent 60%),
              linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.lyaeco-fp-robot {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto 20px;
  box-shadow: 0 12px 36px rgba(252,105,47,0.4);
  border: 2px solid rgba(255,255,255,0.2);
  animation: lyaecoFloat 3.2s ease-in-out infinite;
}
@keyframes lyaecoFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-9px); }
}
.lyaeco-fp-hero h2 {
  font-size: 30px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -1px;
  margin: 0 0 10px;
}
.lyaeco-fp-hero p {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.65;
}

.lyaeco-fp-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

#lyaeco-chat-inline {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 560px;
}

#lyaeco-chat-inline .lyaeco-msgs { flex: 1; }
#lyaeco-chat-inline .lyaeco-hdr { border-radius: 0; }

/* ─── Checkboxes ─────────────────────────────────────────── */
.lyaeco-bubble-ui {
  padding: 0 !important;
  overflow: hidden;
  background: transparent !important;
  border: none !important;
}
.lyaeco-cbs {
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lyaeco-cbs-ttl {
  font-size: 13px;
  font-weight: 700;
  color: #4A90D9;
  margin-bottom: 6px;
  line-height: 1.4;
}
.lyaeco-cb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 3px;
}
.lyaeco-cb-row:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.lyaeco-cb-row:has(.lyaeco-cb-input:checked) { background: rgba(11,58,143,0.3); border-color: rgba(252,105,47,0.5); }
.lyaeco-cb-input {
  width: 16px;
  height: 16px;
  accent-color: #0B3A8F;
  cursor: pointer;
  flex-shrink: 0;
}
.lyaeco-cb-lbl {
  flex: 1;
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
}
.lyaeco-cbs-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #4A90D9;
  text-align: center;
  padding: 8px 0 6px;
  border-top: 1px dashed rgba(255,255,255,0.15);
  margin-top: 4px;
}
.lyaeco-cbs-btn {
  width: 100%;
  background: #FC692F;
  color: #fff;
  border: none;
  border-radius: 0 0 14px 14px;
  padding: 10px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}
.lyaeco-cbs-btn:hover  { opacity: 0.9; }
.lyaeco-cbs-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Devis Recap ────────────────────────────────────────── */
.lyaeco-recap {
  margin: 4px 0;
  background: rgba(11,58,143,0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(11,58,143,0.45);
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
}
.lyaeco-recap-pack {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lyaeco-recap-pack-name {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
}
.lyaeco-recap-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.lyaeco-recap-ok {
  flex: 1;
  background: linear-gradient(135deg,#16a34a,#15803d);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
  line-height: 1.3;
}
.lyaeco-recap-ok:hover  { opacity: 0.9; }
.lyaeco-recap-ok:disabled { opacity: 0.45; cursor: not-allowed; }
.lyaeco-recap-mod {
  flex: 1;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 9px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  line-height: 1.3;
}
.lyaeco-recap-mod:hover  { background: rgba(255,255,255,0.18); }
.lyaeco-recap-mod:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Validation coordonnées ─────────────────────────────── */
.lyaeco-field-wrap { margin-bottom: 0; }
.lyaeco-field-err {
  font-size: 11px;
  color: #f87171;
  min-height: 16px;
  padding: 1px 2px 4px;
  line-height: 1.3;
}

/* ─── Audit téléphonique gratuit ─────────────────────────── */
.lyaeco-audit-cb {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(22,163,74,0.15);
  border: 1px solid rgba(74,222,128,0.35);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #86efac;
  cursor: pointer;
  line-height: 1.4;
}
.lyaeco-audit-cb input[type="checkbox"] {
  margin: 2px 0 0;
  accent-color: #4A90D9;
  flex-shrink: 0;
}

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  #lyaeco-chatbot {
    bottom: 92px;
    right: 16px;
  }
  .wa-float {
    bottom: 16px !important;
    right: 16px !important;
  }
  .lyaeco-btn { width: 66px; height: 66px; }
  .lyaeco-btn img { width: 66px; height: 66px; }
  .lyaeco-win {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    width: 100%;
    height: 72vh;
    max-height: 72vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transform-origin: bottom center;
    transition: transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.25s ease;
  }
  .lyaeco-win.lyaeco-open {
    transform: translateY(0);
    opacity: 1;
  }
  #lyaeco-chat-inline {
    height: calc(100vh - 420px);
    min-height: 360px;
    border-radius: 20px;
  }
  .lyaeco-fp-hero { padding: 36px 20px 24px; }
  .lyaeco-fp-hero h2 { font-size: 24px; }
  .lyaeco-fp-robot { width: 72px; height: 72px; }
}

@media (max-width: 480px) {
  #lyaeco-chat-inline {
    height: calc(100vh - 380px);
    min-height: 320px;
    border-radius: 12px;
  }
}

@media (max-width: 1024px) {
  .lyaeco-bubble { display: none !important; }
  #lyaeco-chatbot .lyaeco-bubble { display: none !important; }
}
