/* Animação "Atendimento automatizado" (js/motion-chatbot.js)
   O palco (.mcb__stg) é um quadrado de 96cqmin dentro da área visual, que também é container:
   tudo lá dentro usa cqmin da área visual, então as cenas têm o mesmo desenho em 16:9 e 4:5. */

.mcb {
  --base: #0a0d14;
  --e1: #1d4ed8;
  --e2: #3b82f6;
  --neon: #60a5fa;
  --ok: #22c55e;
  --red: #e3101b;
  --bal: #1a2133;
  position: relative;
  aspect-ratio: 16 / 9;
  container-type: size;
  overflow: hidden;
  isolation: isolate;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, .2);
  background:
    radial-gradient(55% 70% at 74% 50%, rgba(29, 78, 216, .26), transparent 70%),
    radial-gradient(120% 90% at 30% 40%, #101829 0%, var(--base) 65%);
  color: #fff;
  font-family: Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 640px) { .mcb { aspect-ratio: 3 / 4; } }
.mcb::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(143, 153, 179, .06) 1px, transparent 1px) 0 0 / 5cqmin 5cqmin,
    linear-gradient(90deg, rgba(143, 153, 179, .06) 1px, transparent 1px) 0 0 / 5cqmin 5cqmin;
  -webkit-mask-image: radial-gradient(60% 70% at 72% 50%, #000, transparent 85%);
  mask-image: radial-gradient(60% 70% at 72% 50%, #000, transparent 85%);
}
.mcb .ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.mcb__cam { position: absolute; inset: 0; }

/* ---------- texto (esquerda no desktop, em cima no celular) ---------- */
.mcb__txt { position: absolute; left: 7cqmin; top: 0; bottom: 0; width: 72cqmin; }
.mcb .tx { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); }
.mcb .tx__n { display: flex; align-items: center; gap: 2cqmin; color: var(--neon); font: 700 2.8cqmin/1 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .14em; }
.mcb .tx__n i { display: block; width: 10cqmin; height: 2px; background: linear-gradient(90deg, var(--neon), transparent); }
.mcb .tx__t { margin: 2.4cqmin 0 0; font-size: 6.2cqmin; line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; }
.mcb .tx__t em { font-style: normal; color: var(--neon); }
.mcb .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.mcb .wi { display: inline-block; }

.mcb__cta {
  --pulse: 0;
  position: absolute; z-index: 6; left: 7cqmin; top: calc(50% + 13cqmin);
  display: inline-flex; align-items: center; gap: 1.6cqmin;
  padding: 2.2cqmin 3.6cqmin; border-radius: 99px;
  background: var(--red); color: #fff; text-decoration: none;
  font-size: 3cqmin; font-weight: 700;
  box-shadow: 0 0 0 calc(1.6cqmin * var(--pulse)) rgba(227, 16, 27, .28), 0 1cqmin 4cqmin rgba(227, 16, 27, .35);
  visibility: hidden; pointer-events: none;
}
.mcb__cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- área visual (direita no desktop, embaixo no celular) ---------- */
.mcb__vis { position: absolute; left: 84cqmin; right: 3cqmin; top: 3cqmin; bottom: 3cqmin; container-type: size; }
.mcb__stg { position: absolute; left: calc(50% - 48cqmin); top: calc(50% - 48cqmin); width: 96cqmin; height: 96cqmin; font-size: 2.6cqmin; }
.mcb__stg > * { position: absolute; }

@media (max-width: 640px) {
  .mcb__txt { left: 7cqmin; right: 7cqmin; width: auto; top: 7cqmin; bottom: auto; height: 34cqmin; }
  .mcb .tx { top: 0; transform: none; }
  .mcb .tx__t { font-size: 6.6cqmin; }
  /* no celular o CTA fica embaixo, no espaço livre abaixo do check */
  .mcb__cta { top: auto; bottom: 9cqmin; left: 0; right: 0; width: max-content; margin: 0 auto; font-size: 3.6cqmin; }
  .mcb__vis { left: 2cqmin; right: 2cqmin; top: 36cqmin; bottom: 2cqmin; }
}

/* cartões com cara de app escuro */
.mcb .card {
  border-radius: 3cqmin; background: #0f1421; border: 1px solid rgba(96, 165, 250, .18);
  box-shadow: 0 3cqmin 8cqmin rgba(0, 0, 0, .5);
  overflow: hidden;
}
.mcb .av { display: block; flex: none; width: 5.4cqmin; height: 5.4cqmin; border-radius: 50%; background: linear-gradient(135deg, var(--e2), var(--e1)); }
.mcb .av--c { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.mcb .av--b { background: linear-gradient(135deg, #a78bfa, #6366f1); }

/* ---------- cena 1: post com comentário ---------- */
.mcb .post { left: 2cqmin; top: 6cqmin; width: 58cqmin; }
.post__hd { display: flex; align-items: center; gap: 1.6cqmin; padding: 2cqmin 2.4cqmin; font-weight: 700; }
.post__hd small { display: block; color: #8f99b3; font-weight: 400; font-size: .85em; }
.post__img {
  position: relative; height: 26cqmin;
  background:
    radial-gradient(40% 60% at 75% 40%, rgba(255, 255, 255, .18), transparent 70%),
    linear-gradient(135deg, #1e3a8a, #1d4ed8 45%, #0b1224);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 2.4cqmin;
}
.post__img b { font-size: 4.2cqmin; letter-spacing: -.02em; line-height: 1; }
.post__img span { color: #c7d2fe; font-size: .9em; margin-top: .6cqmin; }
.post__act { display: flex; gap: 2.4cqmin; padding: 1.8cqmin 2.4cqmin .6cqmin; font-size: 3.6cqmin; color: #dfe6ff; }
.post__cm { padding: .8cqmin 2.4cqmin; line-height: 1.35; color: #dfe6ff; }
.post__cm b { margin-right: .8cqmin; }
.post__cm small { color: #8f99b3; margin-left: .8cqmin; }
.post__new { position: relative; border-radius: 1.4cqmin; margin: .6cqmin 1.2cqmin; padding: .8cqmin 1.2cqmin; }
.post__new::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(96, 165, 250, .16); border: 1px solid rgba(96, 165, 250, .5); opacity: var(--hl, 0); }
.post__new > * { position: relative; }
.post__in { display: flex; align-items: center; gap: 1.4cqmin; margin-top: 1cqmin; padding: 1.6cqmin 2.4cqmin 2.2cqmin; border-top: 1px solid rgba(255, 255, 255, .07); }
.post__in .av { width: 4.4cqmin; height: 4.4cqmin; }
.post__field { flex: 1; min-width: 0; padding: 1.2cqmin 2cqmin; border-radius: 99px; background: #161c2c; color: #fff; white-space: nowrap; overflow: hidden; }
.post__field .ph { color: #6b7590; }
.post__field .caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -.15em; background: var(--neon); animation: mcb-blink .9s steps(1) infinite; }
.post__pub { color: var(--neon); font-weight: 700; }

/* gatilho: raio do comentário até o nó de automação */
.mcb .bolt { left: 0; top: 0; width: 96cqmin; height: 96cqmin; overflow: visible; pointer-events: none; }
.bolt path { fill: none; stroke: var(--neon); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 1.2px #93c5fd) drop-shadow(0 0 3px var(--e2)); }
.mcb .hub {
  left: 74cqmin; top: 20cqmin; width: 16cqmin; height: 16cqmin; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle, #1d4ed8, #0f1a3d 70%);
  border: 1px solid rgba(147, 197, 253, .6);
  box-shadow: 0 0 calc(5cqmin * var(--glow, .3)) rgba(59, 130, 246, .9), inset 0 0 3cqmin rgba(96, 165, 250, .35);
  color: #fff; font-size: 7cqmin;
}
.hub__ring { position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--neon); opacity: 0; }
.mcb .hub__lb { left: 66cqmin; top: 38cqmin; width: 32cqmin; text-align: center; color: #c3cae0; font-size: .9em; font-weight: 600; letter-spacing: .02em; }

/* ---------- cena 2: Direct com resposta automática ---------- */
.mcb .chat { left: 8cqmin; top: 2cqmin; width: 80cqmin; height: 92cqmin; display: flex; flex-direction: column; }
.chat__hd { display: flex; align-items: center; gap: 1.8cqmin; padding: 2.4cqmin 2.8cqmin; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.chat__hd b { display: block; font-size: 1.1em; }
.chat__st { display: inline-flex; align-items: center; gap: 1cqmin; margin-top: .6cqmin; padding: .5cqmin 1.6cqmin; border-radius: 99px; background: rgba(34, 197, 94, .12); color: #86efac; font-size: .85em; font-weight: 600; }
.mcb .dot { width: 1.4cqmin; height: 1.4cqmin; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: mcb-ping 1.6s infinite; }
.chat__hd .ch { margin-left: auto; font-size: 4.4cqmin; color: #fff; }
.chat__bd { flex: 1; display: flex; flex-direction: column; gap: 1.6cqmin; padding: 2.8cqmin; }
.mcb .ctx { align-self: center; color: #8f99b3; font-size: .82em; }
.mcb .bb { max-width: 78%; padding: 1.6cqmin 2.2cqmin; border-radius: 2.6cqmin; line-height: 1.38; }
.mcb .bb small { display: block; margin-top: .5cqmin; font-size: .78em; opacity: .7; text-align: right; }
.mcb .bb--in { align-self: flex-start; background: var(--bal); border-bottom-left-radius: .8cqmin; transform-origin: 0 100%; }
.mcb .bb--out { align-self: flex-end; background: linear-gradient(135deg, var(--e2), var(--e1)); border-bottom-right-radius: .8cqmin; transform-origin: 100% 100%; box-shadow: 0 0 3cqmin rgba(29, 78, 216, .45); }
.mcb .typ { align-self: flex-end; display: flex; align-items: center; gap: 1.2cqmin; color: #93c5fd; font-size: .85em; }
.mcb .typ i { display: inline-flex; gap: .7cqmin; padding: 1.4cqmin 1.8cqmin; border-radius: 2.6cqmin; background: rgba(29, 78, 216, .35); }
.mcb .typ i span { width: 1.1cqmin; height: 1.1cqmin; border-radius: 50%; background: #bfdbfe; animation: mcb-dots 1s infinite; }
.mcb .typ i span:nth-child(2) { animation-delay: .15s; }
.mcb .typ i span:nth-child(3) { animation-delay: .3s; }
.mcb .lk { display: flex; gap: 1.6cqmin; align-items: center; margin-top: 1.2cqmin; padding: 1.2cqmin; border-radius: 1.6cqmin; background: rgba(6, 9, 20, .35); }
.lk__th { flex: none; width: 7cqmin; height: 7cqmin; border-radius: 1.2cqmin; background: linear-gradient(135deg, #1e3a8a, #60a5fa); display: grid; place-items: center; font-size: 3.6cqmin; }
.lk b { display: block; }
.lk span { color: #bfdbfe; font-size: .85em; }
.mcb .qr { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 1.1cqmin; }
.qr span { position: relative; padding: 1.1cqmin 2.2cqmin; border-radius: 99px; border: 1px solid rgba(96, 165, 250, .55); color: #dbeafe; font-weight: 600; font-size: .92em; background: rgba(29, 78, 216, calc(.12 + .6 * var(--on, 0))); }

/* cursor e toque */
.mcb .cur { left: 0; top: 0; width: 5cqmin; height: 5cqmin; z-index: 4; visibility: hidden; filter: drop-shadow(0 .6cqmin 1cqmin rgba(0, 0, 0, .5)); }
.mcb .cur svg { width: 100%; height: 100%; }
.mcb .tap { left: 0; top: 0; width: 8cqmin; height: 8cqmin; margin: -4cqmin 0 0 -4cqmin; border-radius: 50%; border: 2px solid #fff; z-index: 3; visibility: hidden; }

/* ---------- cena 3: três canais às 23:45 ---------- */
.mcb .clk { left: 30cqmin; top: 1cqmin; width: 36cqmin; display: flex; align-items: center; justify-content: center; gap: 1.4cqmin; padding: 1.4cqmin 0; border-radius: 99px; background: #0f1421; border: 1px solid rgba(96, 165, 250, .25); font: 700 4cqmin/1 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .06em; }
.clk .ico { color: #fcd34d; font-size: 3.6cqmin; }
.clk em { font-style: normal; animation: mcb-blink 1s steps(1) infinite; }
.clk small { font: 600 2cqmin/1 Inter, system-ui, sans-serif; color: #8f99b3; letter-spacing: .04em; }
.mcb .win { top: 13cqmin; width: 30.4cqmin; height: 78cqmin; display: flex; flex-direction: column; font-size: 2.3cqmin; }
.mcb .win1 { left: 1cqmin; } .mcb .win2 { left: 32.8cqmin; } .mcb .win3 { left: 64.6cqmin; }
.win__hd { display: flex; align-items: center; gap: 1.2cqmin; padding: 1.8cqmin; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.win__lg { display: grid; place-items: center; flex: none; width: 5cqmin; height: 5cqmin; border-radius: 1.4cqmin; color: #fff; font-size: 3.4cqmin; }
.win1 .win__lg { background: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7); }
.win2 .win__lg { background: #25d366; border-radius: 50%; }
.win3 .win__lg { background: linear-gradient(45deg, #0a7cff, #a033ff 70%, #ff5280); border-radius: 50%; }
.win__hd small { display: block; color: #8f99b3; font-weight: 400; font-size: .85em; }
.win__bd { flex: 1; display: flex; flex-direction: column; gap: 1.4cqmin; padding: 1.8cqmin; }
.win .bb { max-width: 92%; padding: 1.2cqmin 1.6cqmin; border-radius: 2cqmin; }
.win .typ i { padding: 1.1cqmin 1.4cqmin; }
.win__ok { margin-top: auto; align-self: flex-end; display: inline-flex; align-items: center; gap: .8cqmin; color: #86efac; font-weight: 600; font-size: .9em; }
.win__ok .ico { stroke-width: 2.6; }

/* ---------- cena 4: check de confirmação ---------- */
.mcb .ok { left: 32cqmin; top: 14cqmin; width: 32cqmin; height: 32cqmin; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(34, 197, 94, .3), rgba(34, 197, 94, .08) 70%); border: 2px solid var(--ok); box-shadow: 0 0 calc(8cqmin * var(--glow, 0)) rgba(34, 197, 94, .7), inset 0 0 4cqmin rgba(34, 197, 94, .3); }
.ok svg { width: 58%; height: 58%; overflow: visible; }
.ok path { fill: none; stroke: #dcfce7; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 1px #4ade80); }
.mcb .ok__lb { left: 8cqmin; top: 52cqmin; width: 80cqmin; text-align: center; }
.ok__lb b { display: block; font-size: 5cqmin; letter-spacing: -.02em; }
.ok__lb span { color: #86efac; font-size: 1.1em; }
.mcb .ok__ch { left: 22cqmin; top: 66cqmin; width: 52cqmin; display: flex; justify-content: center; gap: 2.4cqmin; }
.ok__ch .win__lg { width: 6.4cqmin; height: 6.4cqmin; font-size: 4cqmin; }
.ok__ch .win__lg:nth-child(1) { background: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7); }
.ok__ch .win__lg:nth-child(2) { background: #25d366; border-radius: 50%; }
.ok__ch .win__lg:nth-child(3) { background: linear-gradient(45deg, #0a7cff, #a033ff 70%, #ff5280); border-radius: 50%; }

/* ---------- controles ---------- */
.mcb__bar { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .06); }
.mcb__bar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--e1), var(--neon)); transform-origin: 0 50%; transform: scaleX(0); }
.mcb__btn {
  position: absolute; z-index: 6; right: 12px; bottom: 12px; display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%;
  background: rgba(10, 13, 20, .6); color: #fff; cursor: pointer; opacity: .7; transition: opacity .2s;
}
.mcb__btn:hover, .mcb__btn:focus-visible { opacity: 1; }
.mcb__btn svg { width: 14px; height: 14px; fill: currentColor; }
.mcb__btn .i-play, .mcb__btn[data-on="false"] .i-pause { display: none; }
.mcb__btn[data-on="false"] .i-play { display: block; }
.mcb__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes mcb-blink { 50% { opacity: 0; } }
@keyframes mcb-dots { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-.8cqmin); opacity: 1; } }
@keyframes mcb-ping { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 80%, 100% { box-shadow: 0 0 0 1.4cqmin rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) {
  .mcb .dot, .mcb .typ i span, .post__field .caret, .clk em { animation: none; }
}
