/* =====================================================================
   ATELIER 360 — CONCIERGE IA (bulle flottante / plein écran mobile)
   Périmètre strict : produit, tarif, recettes, contact (Plan 3 §5).
   ===================================================================== */

.concierge-launcher {
  position: fixed;
  bottom: clamp(1rem, 3vw, 1.8rem);
  right: clamp(1rem, 3vw, 1.8rem);
  z-index: var(--z-concierge);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.2rem .8rem .9rem;
  border-radius: var(--r-pill);
  background: var(--indigo);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--glow-indigo), var(--shadow-lg);
  transition: transform var(--t-base), box-shadow var(--t-base), background var(--t-base);
}
.concierge-launcher:hover { transform: translateY(-3px); background: var(--indigo-bright); }
.concierge-launcher svg { width: 22px; height: 22px; }
/* Focus clavier visible (WCAG 2.2 — 2.4.11) : anneau indigo hors survol souris */
.concierge-launcher:focus-visible,
.cc-close:focus-visible,
.cc-send:focus-visible,
.cc-suggests button:focus-visible,
.cc-input input:focus-visible {
  outline: 2px solid var(--indigo-bright);
  outline-offset: 2px;
}
.concierge-launcher:focus-visible { outline-offset: 3px; }
.concierge-launcher .lbl { white-space: nowrap; }
.concierge-launcher[aria-expanded="true"] { transform: scale(.9); opacity: 0; pointer-events: none; }

.concierge-panel {
  position: fixed;
  bottom: clamp(1rem, 3vw, 1.8rem);
  right: clamp(1rem, 3vw, 1.8rem);
  z-index: var(--z-concierge);
  width: min(390px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 4rem));
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 100px -40px rgba(79,70,229,.7);
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(16px) scale(.96);
  pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
}
.concierge-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.cc-header {
  display: flex; align-items: center; gap: .8rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(79,70,229,.18), rgba(124,58,237,.08));
  border-bottom: 1px solid var(--border);
}
.cc-avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--indigo); color: #fff; font-weight: 700; box-shadow: var(--glow-indigo); }
.cc-id { flex: 1; min-width: 0; }
.cc-id .name { font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: 1rem; }
.cc-id .status { display: flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); color: var(--text-muted); }
.cc-id .status .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }
.cc-close { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-muted); }
.cc-close:hover { background: var(--surface-glass); color: var(--text); }
.cc-close svg { width: 20px; height: 20px; }

.cc-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.cc-msg { max-width: 85%; padding: .7rem .9rem; border-radius: 14px; font-size: var(--fs-sm); line-height: 1.5; }
.cc-msg--bot { align-self: flex-start; background: var(--bg-elevated-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--text-body); }
.cc-msg--user { align-self: flex-end; background: var(--indigo); color: #fff; border-bottom-right-radius: 4px; }
.cc-msg a { color: var(--indigo-bright); text-decoration: underline; text-underline-offset: 3px; }
.cc-msg--user a { color: #fff; }

/* État « tape… » */
.cc-typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: .8rem 1rem; background: var(--bg-elevated-2); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px; }
.cc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: typing 1.2s infinite; }
.cc-typing i:nth-child(2){ animation-delay:.2s; } .cc-typing i:nth-child(3){ animation-delay:.4s; }

/* Suggestions (périmètre cadré) */
.cc-suggests { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.1rem .6rem; }
.cc-suggests button {
  font-size: var(--fs-xs); color: var(--text-body);
  border: 1px solid var(--border-strong); background: var(--surface-glass);
  padding: .45rem .75rem; border-radius: var(--r-pill); transition: all var(--t-fast);
  min-height: 24px; /* WCAG 2.2 — 2.5.8 Target Size (Minimum) */
}
.cc-suggests button:hover { border-color: var(--indigo-bright); color: var(--text); background: var(--indigo-soft); }

.cc-input {
  display: flex; gap: .5rem; align-items: center;
  padding: .8rem; border-top: 1px solid var(--border); background: var(--bg-elevated);
}
.cc-input input {
  flex: 1; background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--r-pill); padding: .7rem 1rem; font-size: var(--fs-sm); color: var(--text);
}
.cc-input input::placeholder { color: var(--text-faint); }
.cc-input input:focus { outline: none; border-color: var(--indigo-bright); }
.cc-send { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--indigo); color: #fff; display: grid; place-items: center; transition: background var(--t-fast); }
.cc-send:hover { background: var(--indigo-bright); }
.cc-send svg { width: 18px; height: 18px; }
.cc-disclaimer { padding: 0 1.1rem .8rem; font-size: 11px; color: var(--text-faint); text-align: center; }

/* Plein écran sur mobile (Plan 3 §5) */
@media (max-width: 560px) {
  .concierge-panel {
    inset: 0; width: 100vw; height: 100dvh;
    border-radius: 0; border: 0;
    transform: translateY(100%);
  }
  .concierge-panel.is-open { transform: none; }
  .concierge-launcher .lbl { display: none; }
  .concierge-launcher { padding: .9rem; }
}
