/* =============================================================
   LOLA HUB — Demonstração ao vivo (seção #demo)
   Usa os tokens e componentes de style.css (.app, .kpi, .msg...).
   ============================================================= */

.demo { display: grid; grid-template-columns: 290px 1fr; gap: 28px; align-items: start; }

/* Etapas */
.dm-steps { display: flex; flex-direction: column; gap: 6px; position: sticky; top: calc(var(--header-h) + 24px); }
.dm-step {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; align-items: center;
  padding: 13px 14px 15px; border-radius: 14px; text-align: left;
  border: 1px solid transparent; color: var(--text-2);
  transition: background-color .25s, border-color .25s, color .25s;
}
.dm-step:hover { background: rgba(255,255,255,.03); color: var(--text); }
.dm-step.is-active { background: var(--surface); border-color: var(--border-2); color: var(--text); box-shadow: var(--highlight); }
.dm-step__icon { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.dm-step__icon .i { width: 17px; height: 17px; }
.dm-step:not(.is-active) .dm-step__icon { background: rgba(255,255,255,.04); color: var(--muted); }
.dm-step b { font-size: 14.5px; letter-spacing: -.01em; }
.dm-step__desc { grid-column: 2; font-size: 13px; line-height: 1.5; color: var(--muted); max-height: 0; opacity: 0; transition: max-height .35s var(--ease), opacity .3s; }
.dm-step.is-active .dm-step__desc { max-height: 80px; opacity: 1; }
.dm-step__bar { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px; background: transparent; }
.dm-step.is-active .dm-step__bar { background: rgba(255,255,255,.07); }
.dm-step__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--primary); }
.dm-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 0 6px; }
.dm-controls small { font-size: 12px; color: var(--muted); }
.dm-toggle { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--border-2); color: var(--text-2); flex-shrink: 0; }
.dm-toggle:hover { color: var(--text); background: rgba(255,255,255,.05); }
.dm-toggle svg { width: 13px; height: 13px; fill: currentColor; }
.dm-ico-play, .demo.is-paused .dm-ico-pause { display: none; }
.demo.is-paused .dm-ico-play { display: block; }

/* Palco */
.dm-stage { position: relative; display: grid; grid-template-columns: 1fr 236px; gap: 18px; align-items: center; }
.dm-web { height: 500px; display: flex; flex-direction: column; }
.dm-web__body { position: relative; flex: 1; min-height: 0; }
.dm-view { position: absolute; inset: 0; padding: 18px 20px; display: none; flex-direction: column; gap: 12px; }
.dm-view.is-active { display: flex; animation: dmFade .45s var(--ease); }
@keyframes dmFade { from { opacity: 0; transform: translateY(6px); } }
.dm-head { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.dm-head__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.dm-head__icon .i { width: 16px; height: 16px; }
.dm-head b { display: block; font-size: 14.5px; letter-spacing: -.01em; }
.dm-head small { font-size: 12px; color: var(--muted); }

.dm-in { animation: dmIn .4s var(--ease) both; }
@keyframes dmIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dm-press { animation: dmPress .3s ease; }
@keyframes dmPress { 50% { transform: scale(.94); } }

/* 0 · Suporte */
.dm-chatbox { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.dm-chatbox .msg { font-size: 13px; }
.dm-chatbox .sup-card { max-width: 420px; align-self: flex-start; }
.dm-chatbox .sup-card__btn { white-space: nowrap; padding: 7px 10px; }
.dm-swap { display: block; margin: 6px 0 2px; font-size: 12px; color: var(--muted); }
.dm-swap s { color: var(--muted); }
.dm-swap b { color: var(--green); }
.dm-inputrow { display: flex; gap: 8px; }
.dm-input { flex: 1; min-height: 40px; padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-input.is-focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123,97,255,.2); }
.dm-input .dm-ph { color: var(--muted); }
.dm-input .dm-caret { display: inline-block; width: 1px; height: 14px; margin-left: 1px; vertical-align: -2px; background: var(--primary-light); animation: dmBlink 1s steps(1) infinite; }
@keyframes dmBlink { 50% { opacity: 0; } }
.dm-send { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--primary); }
.dm-send .i { width: 17px; height: 17px; }

/* 1 · Lote */
.dm-product { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; }
.dm-product > div { flex: 1; min-width: 0; }
.dm-product b { display: block; font-weight: 650; }
.dm-product small { color: var(--muted); }
.dm-groups { display: grid; gap: 6px; flex: 1; align-content: start; }
.dm-row { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.015); font-size: 12.5px; transition: border-color .25s, background-color .25s; }
.dm-row.is-on { border-color: var(--primary-line); background: var(--primary-soft); }
.dm-row__name { font-weight: 600; flex: 1; }
.dm-row small { color: var(--muted); font-size: 11.5px; }
.dm-row__status { min-width: 66px; text-align: center; visibility: hidden; }
.dm-row__status.is-shown { visibility: visible; }
.dm-check { width: 17px; height: 17px; border-radius: 5px; flex-shrink: 0; border: 1.5px solid var(--border-2); display: grid; place-items: center; transition: background-color .2s, border-color .2s; }
.dm-row.is-on .dm-check { background: var(--primary); border-color: var(--primary); }
.dm-row.is-on .dm-check::after { content: ''; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.dm-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dm-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border-2); }
.dm-pill .i { width: 14px; height: 14px; }

/* 2 · Modo Clone */
.dm-clone { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 120px 1fr; gap: 10px; }
.dm-col { display: flex; flex-direction: column; min-height: 0; border-radius: 12px; border: 1px solid var(--border); background: #0B0D11; overflow: hidden; }
.dm-col__title { font-size: 11.5px; font-weight: 700; color: var(--text-2); padding: 9px 12px; border-bottom: 1px solid var(--border); background: #111419; }
.dm-col__body { flex: 1; padding: 10px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }
.dm-mid { display: flex; align-items: center; justify-content: center; position: relative; }
.dm-mid::before { content: ''; position: absolute; left: -6px; right: -6px; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--border-2), transparent); }
.dm-rule { position: relative; z-index: 1; width: 100%; padding: 12px 8px; border-radius: 12px; text-align: center; background: var(--surface); border: 1px solid var(--border-2); transition: border-color .3s, box-shadow .3s; }
.dm-rule .i { width: 18px; height: 18px; margin: 0 auto 6px; color: var(--muted); }
.dm-rule b { display: block; font-size: 12px; }
.dm-rule small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.dm-rule.is-on { border-color: var(--primary-line); box-shadow: 0 0 0 4px rgba(123,97,255,.12); }
.dm-rule.is-on .i { color: var(--primary-light); animation: dmSpin 1s linear infinite; }
.dm-rule.is-ok { border-color: rgba(52,211,153,.45); }
.dm-rule.is-ok .i { color: var(--green); animation: none; }
@keyframes dmSpin { to { transform: rotate(360deg); } }
.dm-modes { margin-left: auto; display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.dm-mode { padding: 5px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap; transition: background-color .25s, color .25s; }
.dm-mode.is-on { background: var(--primary); color: #fff; }
.dm-rot { margin-left: auto; display: none; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; color: var(--primary-light); background: var(--primary-soft); border: 1px solid var(--primary-line); }
.dm-rot.is-shown { display: inline-flex; animation: dmIn .4s var(--ease) both; }
.wa b { font-weight: 700; }
.dm-foot { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.dm-foot b { color: var(--text); }
.dm-foot > * { white-space: nowrap; }

/* Bolha estilo WhatsApp (usada no clone e no celular) */
.wa { max-width: 92%; padding: 7px 9px 5px; border-radius: 10px; font-size: 12px; line-height: 1.45; color: #E9EDEF; background: #202C33; align-self: flex-start; }
.wa--out { align-self: flex-end; background: #005C4B; }
.wa__img { height: 70px; margin: -2px -4px 6px; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(135deg, #2E3A44, #1B242B); color: #8696A0; }
.wa--out .wa__img { background: linear-gradient(135deg, #0E7A63, #024A3D); color: #9FE3CE; }
.wa__img .i { width: 26px; height: 26px; stroke-width: 1.4; }
.wa__name { display: block; font-size: 11px; font-weight: 700; color: #F2A65A; margin-bottom: 2px; }
.wa__time { display: block; text-align: right; font-size: 9.5px; color: rgba(233,237,239,.55); margin-top: 2px; }
.wa__link { color: #53BDEB; word-break: break-all; transition: background-color .3s, color .3s; border-radius: 4px; }
.wa__link.is-other { color: #F87171; text-decoration: line-through; }
.wa__link.is-mine { color: #fff; background: rgba(52,211,153,.35); padding: 0 3px; }
.wa--typing { display: flex; gap: 4px; padding: 10px 11px; }
.wa--typing span { width: 6px; height: 6px; border-radius: 50%; background: #8696A0; animation: typing 1.2s infinite; }
.wa--typing span:nth-child(2) { animation-delay: .15s; }
.wa--typing span:nth-child(3) { animation-delay: .3s; }
.wa-react { align-self: flex-start; font-size: 11px; color: #8696A0; margin-top: -4px; padding-left: 4px; }

/* 3 · Robô */
.dm-convs { display: grid; gap: 6px; }
.dm-conv { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); font-size: 12.5px; }
.dm-conv.is-active { border-color: var(--primary-line); background: var(--primary-soft); }
.dm-av { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--surface-3); }
.dm-conv.is-active .dm-av { background: var(--grad-brand); }
.dm-conv__txt { flex: 1; min-width: 0; }
.dm-conv__txt b { display: block; font-weight: 650; }
.dm-conv__txt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dm-stats div { padding: 10px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); }
.dm-stats small { display: block; font-size: 11px; color: var(--muted); }
.dm-stats b { font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dm-assume-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.dm-assume-row small { font-size: 12px; color: var(--muted); }

/* 4 · Resultados */
.dm-view .kpis b { font-variant-numeric: tabular-nums; }
.dm-view .app__cols { flex: 1; min-height: 0; grid-template-columns: 1fr 1.2fr; }
.dm-view .panel { overflow: hidden; display: flex; flex-direction: column; }
.dm-view .bars { flex: 1; height: auto; min-height: 90px; }
.dm-view .queue li { padding: 6px 0; }
.dm-view .queue__txt small { white-space: nowrap; }
.dm-view .bars span { height: var(--h, 0%); transition: height .9s var(--ease); }
.dm-view .queue li { animation: dmIn .4s var(--ease) both; }

/* Celular */
.dm-phone {
  width: 236px; height: 470px; padding: 9px; border-radius: 38px;
  background: #050507; box-shadow: var(--shadow-lg), inset 0 0 0 1.5px #2A2836;
  transition: opacity .4s, transform .4s var(--ease), filter .4s;
}
.dm-phone__screen { height: 100%; border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; background: #0B141A; }
.dm-phone__head { display: flex; align-items: center; gap: 9px; padding: 30px 12px 10px; background: #202C33; }
.dm-phone__avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: #3B4A54; }
.dm-phone__head b { display: block; font-size: 12.5px; color: #E9EDEF; }
.dm-phone__head small { font-size: 10.5px; color: #8696A0; }
.dm-phone__chat {
  flex: 1; min-height: 0; padding: 10px 9px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.025) 0 2px, transparent 3px) 0 0 / 22px 22px,
    #0B141A;
}
.dm-stage[data-phone="off"] .dm-phone { opacity: .35; transform: scale(.96); filter: saturate(.4); }

/* Cursor */
.dm-cursor {
  position: absolute; left: 0; top: 0; z-index: 6; width: 24px; height: 24px; pointer-events: none;
  opacity: 0; transform: translate(60%, 60%);
  transition: transform .75s cubic-bezier(.45, 0, .2, 1), opacity .3s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.5));
}
.dm-cursor svg { width: 24px; height: 24px; }
.dm-cursor.is-shown { opacity: 1; }
.dm-cursor::after {
  content: ''; position: absolute; left: -9px; top: -9px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(180,167,255,.9); opacity: 0; transform: scale(.3);
}
.dm-cursor.is-click::after { animation: dmRipple .45s ease-out; }
@keyframes dmRipple { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }

.demo__cta { margin-top: 30px; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.demo__cta small { font-size: 13px; color: var(--muted); }

/* Responsivo */
@media (max-width: 1080px) {
  .demo { grid-template-columns: 1fr; }
  .dm-steps { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .dm-steps::-webkit-scrollbar { display: none; }
  .dm-step { flex: 0 0 auto; grid-template-columns: 28px auto; padding: 10px 12px 12px; }
  .dm-step__icon { width: 28px; height: 28px; grid-row: auto; }
  .dm-step__desc { display: none; }
  .dm-controls { margin: 0; flex: 0 0 auto; }
  .dm-controls small { display: none; }
}
@media (max-width: 760px) {
  .dm-stage { grid-template-columns: 1fr; justify-items: center; }
  .dm-web { width: 100%; height: 500px; }
  .dm-stage[data-focus="web"] .dm-phone { display: none; }
  .dm-stage[data-focus="phone"] .dm-web { display: none; }
  .dm-stage[data-phone="off"] .dm-phone { opacity: 1; transform: none; filter: none; }
  .dm-phone { width: 260px; height: 470px; }
  .dm-view { padding: 14px; }
  .dm-clone { grid-template-columns: 1fr; grid-template-rows: minmax(0, .7fr) auto minmax(0, 1.6fr); }
  .dm-mid::before { display: none; }
  .dm-col .wa__img { display: none; }
  .dm-rule { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; }
  .dm-rule .i { margin: 0; }
  .dm-rule small { margin: 0 0 0 auto; }
  .dm-view .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dm-view .kpi { padding: 9px 11px; }
  .dm-view .kpi__icon { display: none; }
  .dm-view .kpi b { font-size: 17px; }
  .dm-view .app__cols { grid-template-columns: 1fr; }
  .dm-view .app__cols .panel:first-child { display: none; }
  .dm-row small { display: none; }
  .dm-stats div:last-child { display: none; }
  .dm-mode { padding: 4px 7px; font-size: 10.5px; }
  .dm-head small { display: none; }
  .dm-rot { display: none !important; }
  .dm-stats { grid-template-columns: 1fr 1fr; }
  .dm-cursor { display: none; }
}
