/* ==========================================================================
   Bravico — WhatsApp chat demo component (ported verbatim from home.css).
   Self-contained; pair with chat-demo.js. Reuses the page's design tokens and
   adds only the two WhatsApp-only vars the product pages don't already define.
   ========================================================================== */
:root { --wa-bubble: #e2f4d5; --wa-deep: #178f43; }
/* :where() keeps this reset at low specificity so .phone__send's green wins */
.essai :where(button) { font: inherit; cursor: pointer; border: none; background: none; padding: 0; }

/* ==========================================================================
   5 · THE CHAT
   ========================================================================== */
.essai {
  display: flex; flex-direction: column; align-items: center;
  gap: 26px; text-align: center;
  padding: clamp(90px, 14vw, 150px) 16px clamp(44px, 7vw, 72px);
}
.essai__t {
  font-size: clamp(2rem, 7.5vw, 3.4rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
}
.essai__t em { color: var(--wa-deep); }

.phone {
  position: relative;
  width: min(430px, 100%);
  margin-top: 14px;
  background: var(--white);
  border-radius: 26px;
  box-shadow: 0 40px 90px -35px rgba(24, 43, 69, 0.45), 0 0 0 1px var(--line);
  overflow: hidden;
  text-align: left;
}
.phone__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--ink); color: var(--sand);
}
.phone__avatar {
  position: relative;
  display: grid; place-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--terra); color: var(--white);
  font-weight: 700; font-size: 1.05rem;
}
.phone__avatar::after {
  content: ""; position: absolute; right: 1px; bottom: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--wa); border: 2px solid var(--ink);
}
.motion .phone__avatar::after { animation: onlinePulse 1.9s ease-in-out infinite; }
@keyframes onlinePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(33, 179, 88, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(33, 179, 88, 0); }
}
.phone__id { display: flex; flex-direction: column; gap: 1px; }
.phone__id strong { font-size: 0.98rem; letter-spacing: -0.01em; }
.phone__id small {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; color: #9fd8ae; font-weight: 600;
}
.phone__demo {
  margin-left: auto; align-self: center; white-space: nowrap;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sand); background: rgba(246, 239, 227, 0.16);
  padding: 3px 9px; border-radius: 999px;
}
.wa { width: 13px; height: 13px; }

.phone__chat {
  height: 250px;
  transition: height 0.7s var(--ease);
  overflow-y: auto;
  padding: 18px 14px 10px;
  background:
    radial-gradient(rgba(24, 43, 69, 0.045) 1px, transparent 1px) 0 0 / 22px 22px,
    #f2ead9;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.phone__chat.is-live { height: 430px; }
.phone__chat { scrollbar-width: thin; scrollbar-color: rgba(24, 43, 69, 0.22) transparent; }
.phone__chat::-webkit-scrollbar { width: 6px; }
.phone__chat::-webkit-scrollbar-thumb { background: rgba(24, 43, 69, 0.16); border-radius: 999px; }
.phone__chat::-webkit-scrollbar-track { background: transparent; }
.daychip {
  width: fit-content; margin: 0 auto 12px;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(24, 43, 69, 0.08);
  font-size: 0.68rem; font-weight: 700; color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.msg {
  max-width: 84%;
  width: fit-content;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.92rem; line-height: 1.45;
  box-shadow: 0 2px 6px -2px rgba(24, 43, 69, 0.15);
  animation: pop 0.4s var(--ease) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.msg--out {
  margin-left: auto;
  background: var(--wa-bubble);
  border-radius: 18px 4px 18px 18px;
  font-weight: 600;
}
.msg--in {
  background: var(--white);
  border-radius: 4px 18px 18px 18px;
}
.msg--in strong { font-weight: 700; }
.msg--in .accent { color: var(--terra); font-weight: 700; }

.msg__meta {
  display: flex; justify-content: flex-end; align-items: center; gap: 4px;
  margin-top: 3px;
  font-size: 0.62rem; color: var(--muted);
}
.ticks { font-weight: 700; letter-spacing: -0.14em; color: #a9b4ae; transition: color 0.3s; }
.ticks.is-read { color: #34b7f1; }

.msg--typing {
  display: inline-flex; gap: 5px; align-items: center;
  padding: 14px 16px;
  background: var(--white); border-radius: 4px 18px 18px 18px;
}
.msg--typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  opacity: 0.45; animation: bounce 1.1s infinite;
}
.msg--typing i:nth-child(2) { animation-delay: 0.16s; }
.msg--typing i:nth-child(3) { animation-delay: 0.32s; }
@keyframes bounce { 0%,100% { transform: none; opacity: 0.4; } 45% { transform: translateY(-4px); opacity: 1; } }
.phone.is-thinking .phone__head { box-shadow: inset 0 -1px 0 rgba(33, 179, 88, 0.22); }

.msg .mini { margin: 10px 0 4px; width: 200px; height: 64px; }

.dossier {
  margin-top: 8px;
  border-left: 3px solid var(--terra);
  padding: 8px 12px;
  background: rgba(199, 92, 58, 0.06);
  border-radius: 8px;
  font-size: 0.88rem;
}
.dossier li { padding: 2px 0; }

/* prepared-document chip — a ready report the product hands over */
.doc {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 4px;
  padding: 9px 11px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.doc__ico {
  flex: none; display: grid; place-content: center;
  width: 34px; height: 40px; border-radius: 7px;
  background: rgba(199, 92, 58, 0.12); color: var(--terra);
}
.doc__ico svg { width: 20px; height: 20px; }
.doc__txt { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; text-align: left; }
.doc__txt strong { font-size: 0.9rem; font-weight: 700; }
.doc__txt small { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

/* source chips — the answer shows what it consulted */
.srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; }
.srcs__ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.src {
  font-size: 0.68rem; font-weight: 600; color: var(--ink-soft);
  background: rgba(24, 43, 69, 0.06);
  padding: 3px 9px; border-radius: 999px;
}

/* quick-reply hints — the manager keeps control */
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.act {
  font-size: 0.78rem; font-weight: 700; color: var(--ink-soft);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 13px;
  cursor: default;
}

/* the traveling signal dot — question sent, answer delivered */
.fly {
  position: absolute; left: 0; top: 0;
  border-radius: 50%;
  background: var(--wa);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.msg--cta {
  background: var(--ink); color: var(--sand);
  font-weight: 600;
}
.msg--cta a {
  display: inline-flex; margin-top: 10px;
  background: var(--terra); color: var(--white);
  padding: 9px 18px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700;
}

/* input bar */
.phone__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border-top: 1px solid var(--line);
}
.phone__input {
  flex: 1;
  min-height: 44px;
  display: flex; align-items: center;
  padding: 10px 16px;
  background: #f3eee2;
  border-radius: 999px;
  font-size: 0.93rem; font-weight: 600; color: var(--ink);
  overflow: hidden; white-space: nowrap;
  cursor: pointer;
}
.caret {
  width: 2px; height: 1.1em; margin-left: 2px;
  background: var(--terra);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.phone__send {
  --mx: 0px; --my: 0px;
  flex: none;
  display: grid; place-content: center;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--wa); color: #fff;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 0.2s var(--ease), background 0.2s, scale 0.15s var(--ease);
  position: relative;
}
.phone__send svg { width: 22px; height: 22px; margin-left: 2px; }
.phone__send:hover { transform: translate3d(var(--mx), var(--my), 0) scale(1.06); }
.phone__send:active { scale: 0.88; }
.phone__send:disabled { background: #b8c4bd; cursor: default; transform: none; }
.phone__send.is-hot::before {
  content: ""; position: absolute; inset: -6px;
  border-radius: 50%; border: 2px solid var(--wa);
  animation: ring 1.6s var(--ease) infinite;
}
.phone__send.is-hot::after {
  content: "Envoyer";
  position: absolute; right: 50%; bottom: calc(100% + 12px);
  transform: translateX(50%);
  background: var(--ink); color: var(--sand);
  padding: 6px 11px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  box-shadow: 0 10px 22px -14px rgba(24, 43, 69, 0.45);
  pointer-events: none;
  animation: hintBob 1.6s ease-in-out infinite;
}
@keyframes hintBob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}
@keyframes ring {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

.essai__dots { display: flex; gap: 9px; justify-content: center; margin-top: 6px; }
.essai__dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(24, 43, 69, 0.16);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.essai__dots .is-done { background: var(--ink-soft); }
.essai__dots .is-now { background: var(--terra); transform: scale(1.3); }
.essai__replay {
  display: none;
  align-items: center; gap: 8px;
  margin-top: 2px;
  padding: 9px 18px;
  border: 1.5px solid var(--line); border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; color: var(--ink-soft);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.essai__replay.is-on { display: inline-flex; animation: pop 0.4s var(--ease) both; }
.essai__replay:hover { color: var(--terra); border-color: var(--terra); background: rgba(255, 253, 249, 0.7); }
.essai__replay svg { width: 15px; height: 15px; }

.essai__note {
  max-width: 44ch;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}


/* phone reveal entrance (ported from home.css motion block) */
.motion .phone.reveal:not(.is-in) { transform: translateY(32px) scale(0.965); }
