/* Widget Chatbot Dempsey Law Firm — branché sur les variables du thème (--c-*, --font-*) */
.fv-chat { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 1250; font-family: var(--font-body); }
.fv-chat-panel, .fv-chat-teaser { max-width: calc(100vw - 2rem); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.fv-chat-launcher {
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer; position: relative;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-deep)); color: #fff;
  box-shadow: 0 14px 32px -6px rgba(var(--rgb-primary), 0.6); display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.fv-chat-launcher:hover { transform: translateY(-2px) scale(1.03); }
.fv-chat-launcher .icon-close, .fv-chat.is-open .fv-chat-launcher .icon-open { display: none; }
.fv-chat.is-open .fv-chat-launcher .icon-close { display: block; }
.fv-chat-dot { position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.fv-chat.is-open .fv-chat-dot { display: none; }

.fv-chat-teaser {
  position: absolute; right: 0; bottom: 76px; width: 270px; background: var(--c-surface); color: var(--c-text-body);
  border: 1px solid var(--c-border); border-radius: 14px 14px 4px 14px; padding: 0.85rem 2rem 0.85rem 1rem;
  font-size: 0.85rem; line-height: 1.45; box-shadow: 0 18px 38px rgba(0,0,0,0.14); cursor: pointer;
}
.fv-chat-teaser strong { display: block; color: var(--c-primary); margin-bottom: 0.15rem; }
.fv-chat-teaser-close { position: absolute; top: 4px; right: 8px; border: none; background: none; font-size: 1.1rem; cursor: pointer; color: var(--c-text-muted); }

.fv-chat-panel {
  position: absolute; right: 0; bottom: 78px; width: 395px; height: min(645px, calc(100vh - 115px));
  background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 30px 70px -15px rgba(var(--rgb-text-dark), 0.35);
}
.fv-chat-panel[hidden], .fv-chat-sheet[hidden], .fv-chat-teaser[hidden], .fv-chat-quick[hidden],
.fv-chat-actions[hidden], .fv-chat-composer[hidden], #fv-chat-form label[hidden] { display: none; }

.fv-chat-header {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--c-secondary), var(--c-primary)); color: #fff;
}
.fv-chat-avatar { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, 0.14); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.fv-chat-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fv-chat-id strong { font-family: var(--font-heading); font-size: 1.1rem; line-height: 1.1; }
.fv-chat-id span { font-size: 0.72rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-online { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; margin-right: 6px; }
.fv-chat-icon-btn { border: none; background: rgba(255, 255, 255, 0.12); color: #fff; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 1rem; }

.fv-chat-body { flex: 1; overflow-y: auto; padding: 1rem; scroll-behavior: smooth; }
.fv-chat-messages { display: flex; flex-direction: column; gap: 0.6rem; }
.fv-msg { max-width: 87%; padding: 0.7rem 0.95rem; border-radius: 15px; font-size: 0.89rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.fv-msg.assistant { align-self: flex-start; background: var(--c-surface); color: var(--c-text-body); border: 1px solid var(--c-border-light); border-bottom-left-radius: 5px; }
.fv-msg.user { align-self: flex-end; background: var(--c-primary); color: #fff; border-bottom-right-radius: 5px; }
.fv-msg.success { align-self: stretch; max-width: 100%; background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.fv-msg.error { align-self: stretch; max-width: 100%; background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.fv-typing { display: inline-flex; gap: 4px; padding: 0.85rem 1rem; }
.fv-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-primary); animation: fv-blink 1.2s infinite; }
.fv-typing i:nth-child(2) { animation-delay: 0.15s; }
.fv-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes fv-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.fv-chat-quick { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.85rem; }
.fv-chip { border: 1px solid var(--c-secondary-soft); background: var(--c-surface); color: var(--c-primary); border-radius: 999px; padding: 0.4rem 0.8rem; font-size: 0.78rem; font-weight: 600; cursor: pointer; text-align: left; }
.fv-chip:hover { background: var(--c-surface-tint); }

.fv-chat-actions { display: flex; gap: 0.5rem; padding: 0.55rem 0.9rem 0; border-top: 1px solid var(--c-border-light); background: var(--c-bg); }
.fv-action { flex: 1; border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-primary); border-radius: 10px; padding: 0.5rem; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.fv-action:hover, .fv-action.is-highlight { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

.fv-chat-composer { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.65rem 0.9rem; background: var(--c-bg); }
.fv-chat-composer textarea { flex: 1; resize: none; max-height: 120px; border: 1px solid var(--c-border); border-radius: 14px; padding: 0.65rem 0.85rem; font: inherit; font-size: 0.9rem; background: var(--c-surface); color: var(--c-text-dark); }
.fv-send { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; border: none; background: var(--c-primary); color: #fff; cursor: pointer; font-size: 1rem; }
.fv-chat-privacy { font-size: 0.67rem; color: var(--c-text-muted); text-align: center; padding: 0 0.9rem 0.65rem; margin: 0; background: var(--c-bg); line-height: 1.35; }

.fv-chat-sheet { position: absolute; inset: 60px 0 0 0; background: var(--c-bg); padding: 1rem; overflow-y: auto; z-index: 2; display: flex; flex-direction: column; gap: 0.7rem; }
.fv-sheet-head { display: flex; justify-content: space-between; align-items: center; color: var(--c-text-dark); }
.fv-link { background: none; border: none; color: var(--c-primary); font-weight: 700; cursor: pointer; font-size: 0.82rem; }
.fv-center { align-self: center; margin-top: 0.25rem; }
.fv-muted { color: var(--c-text-muted); font-size: 0.85rem; }
.fv-channel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.fv-channel label { border: 1px solid var(--c-border); border-radius: 10px; padding: 0.45rem 0.3rem; font-size: 0.76rem; font-weight: 700; text-align: center; cursor: pointer; background: var(--c-surface); }
.fv-channel input { accent-color: var(--c-primary); }
.fv-slot-day { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-muted); font-weight: 700; margin: 0.4rem 0 0.35rem; }
.fv-slot-times { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fv-slot { border: 1px solid var(--c-secondary-soft); background: var(--c-surface); color: var(--c-primary); border-radius: 9px; padding: 0.42rem 0.72rem; font-weight: 700; font-size: 0.84rem; cursor: pointer; }
.fv-slot:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.fv-slot-recap { background: var(--c-surface-tint); border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.84rem; color: var(--c-primary); font-weight: 700; margin: 0; }
#fv-chat-form label { display: flex; flex-direction: column; gap: 0.28rem; font-size: 0.8rem; font-weight: 600; color: var(--c-text-dark); }
#fv-chat-form input:not([type="checkbox"]) { border: 1px solid var(--c-border); border-radius: 9px; padding: 0.58rem 0.75rem; font: inherit; font-size: 16px; background: var(--c-surface); color: var(--c-text-dark); }
#fv-chat-form .fv-consent { flex-direction: row; align-items: flex-start; gap: 0.5rem; font-weight: 500; color: var(--c-text-muted); }
.fv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.fv-form-error { color: #B91C1C; font-size: 0.82rem; margin: 0; }
.fv-chat-primary { border: none; border-radius: 999px; background: var(--c-primary); color: #fff; padding: 0.78rem; font-weight: 700; cursor: pointer; font-size: 0.9rem; }
.fv-chat-primary:disabled { opacity: 0.6; }

@media (max-width: 520px) {
  .fv-chat { right: 1rem; bottom: 1rem; }
  .fv-chat-panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; border-radius: 0; bottom: 0; }
  .fv-chat.is-open .fv-chat-launcher { display: none; }
  .fv-row { grid-template-columns: 1fr; }
}
