/* ALSI Nettoyage – assistant du site (js/chat.js). Remplace la bulle WhatsApp flottante, qu'il propose lui-même. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.has-chat .wa { display: none; }

.chat { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 110; font-family: var(--f-text); }
.chat-btn { position: relative; display: flex; align-items: center; gap: .6rem; padding: .85rem 1.25rem .85rem 1rem; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--blue-d), var(--navy)); color: #fff; font-size: .95rem; font-weight: 600; cursor: pointer; box-shadow: 0 14px 34px rgba(22, 121, 171, .4); transition: transform .3s var(--ease), box-shadow .3s; }
.chat-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(22, 121, 171, .5); }
.chat-btn svg, .chat-x svg, .chat-form svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(41, 168, 224, .55); animation: pulse 2.8s ease-out 3s infinite; }
.chat.ouvert .chat-btn::before { animation: none; }

.chat-panel { position: absolute; right: 0; bottom: calc(100% + .875rem); display: flex; flex-direction: column; width: min(24rem, calc(100vw - 2rem)); height: min(36rem, calc(100svh - 7rem)); border-radius: 22px; overflow: hidden; background: var(--soft); box-shadow: 0 30px 80px rgba(11, 22, 34, .35), 0 0 0 1px rgba(41, 168, 224, .18); transform-origin: 100% 100%; animation: chat-in .4s cubic-bezier(.16, 1, .3, 1); }
.chat-panel[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

.chat-top { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: linear-gradient(135deg, var(--night), var(--navy)); color: #fff; }
.chat-top img { width: 36px; height: 36px; border-radius: 50%; background: #fff; padding: 3px; object-fit: contain; }
.chat-top p { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.chat-top b { font-family: var(--f-title); font-size: 1rem; }
.chat-top span { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: #b9c6d3; }
.chat-top i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .2); }
.chat-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.chat-x:hover { background: rgba(255, 255, 255, .16); }

.chat-log { flex: 1; display: flex; flex-direction: column; gap: .5rem; padding: 1rem; overflow-y: auto; overscroll-behavior: contain; }
.chat-b { max-width: 86%; margin: 0; padding: .65rem .9rem; border-radius: 16px; font-size: .9rem; line-height: 1.45; animation: chat-b .3s var(--ease); }
@keyframes chat-b { from { opacity: 0; transform: translateY(6px); } }
.chat-bot { align-self: flex-start; border-bottom-left-radius: 5px; background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(38, 62, 84, .07); }
.chat-bot a { color: var(--blue-d); text-decoration: underline; }
.chat-moi { align-self: flex-end; border-bottom-right-radius: 5px; background: var(--blue-d); color: #fff; }
.chat-tape { display: flex; gap: 4px; padding: .8rem .9rem; }
.chat-tape span { width: 7px; height: 7px; border-radius: 50%; background: #a9bfd1; animation: chat-tape 1s infinite; }
.chat-tape span:nth-child(2) { animation-delay: .15s; }
.chat-tape span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-tape { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat-choix { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.chat-choix button, .chat-choix a { padding: .5rem .8rem; border: 1px solid rgba(22, 121, 171, .35); border-radius: 999px; background: #fff; color: var(--blue-d); font: inherit; font-size: .82rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.chat-choix button:hover, .chat-choix a:hover { background: var(--blue-bg); border-color: var(--blue-d); }
.chat-choix .chat-cta { background: var(--blue-d); border-color: var(--blue-d); color: #fff; }
.chat-choix .chat-cta:hover { background: var(--navy); color: #fff; }

.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); background: #fff; }
.chat-form input { flex: 1; min-width: 0; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 16px; color: var(--navy); background: var(--soft); }
.chat-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(41, 168, 224, .2); }
.chat-form button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--blue-d); color: #fff; cursor: pointer; }
.chat-note { margin: 0; padding: 0 .75rem .6rem; background: #fff; font-size: .7rem; color: var(--dim); text-align: center; }

/* téléphone : bouton rond au-dessus de la barre « Appeler / Devis », fenêtre en plein écran */
@media (max-width: 640px) {
  .chat { right: 1rem; bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .chat-btn { width: 56px; height: 56px; padding: 0; justify-content: center; }
  .chat-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .chat.ouvert { inset: 0; right: 0; bottom: 0; }
  .chat.ouvert .chat-btn { display: none; }
  .chat-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; animation: none; }
  .chat-top { padding-top: calc(.9rem + env(safe-area-inset-top)); }
  .chat-note { padding-bottom: calc(.6rem + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-btn::before, .chat-panel, .chat-b, .chat-tape span { animation: none; }
}
