/* F617.W13 — hero product-story: Telegram-чат → бронь → сделка B24 → оплата.
 * Scripted DOM-анимация (НЕ видео, НЕ фейк-браузер-хром). Токены --lp-* из landing.css. */

.demo{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.06fr);
  gap:14px;align-items:stretch}

/* — Чат (телефонная панель) — */
.demo__chat{background:#fff;border:1px solid var(--lp-line);border-radius:18px;
  box-shadow:0 1px 2px rgba(23,22,28,.05),0 44px 84px -42px rgba(23,22,28,.36);
  display:flex;flex-direction:column;min-height:380px;overflow:hidden}
.demo__chat-head{display:flex;align-items:center;gap:10px;padding:12px 16px;
  border-bottom:1px solid var(--lp-line);background:var(--lp-bg-muted)}
.demo__avatar{width:30px;height:30px;border-radius:50%;background:var(--lp-primary-soft);
  display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.demo__avatar svg{width:16px;height:16px;fill:none;stroke:var(--lp-primary);
  stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.demo__chat-name{font-size:14px;font-weight:600;line-height:1.2}
.demo__chat-status{font-size:11.5px;color:var(--lp-emerald);font-weight:500;margin-left:auto}
.demo__msgs{flex:1;display:flex;flex-direction:column;gap:8px;padding:14px;overflow:hidden;
  justify-content:flex-end}
.demo__msg{max-width:86%;padding:8px 12px;border-radius:14px;font-size:13.5px;line-height:1.4;
  opacity:0;transform:translateY(8px);
  transition:opacity .28s var(--ease-decelerate,ease-out),transform .28s var(--ease-decelerate,ease-out)}
.demo__msg.is-on{opacity:1;transform:none}
.demo__msg--user{align-self:flex-end;background:var(--lp-primary);color:#fff;border-bottom-right-radius:5px}
.demo__msg--bot{align-self:flex-start;background:var(--lp-bg-muted);color:var(--lp-ink);
  border:1px solid var(--lp-line);border-bottom-left-radius:5px}
.demo__typing{align-self:flex-start;display:inline-flex;gap:4px;padding:10px 13px;
  background:var(--lp-bg-muted);border:1px solid var(--lp-line);border-radius:14px;
  border-bottom-left-radius:5px;opacity:0;transition:opacity .2s}
.demo__typing.is-on{opacity:1}
.demo__typing i{width:6px;height:6px;border-radius:50%;background:var(--lp-ink-mute);
  animation:demoDot 1s infinite ease-in-out}
.demo__typing i:nth-child(2){animation-delay:.16s}
.demo__typing i:nth-child(3){animation-delay:.32s}
@keyframes demoDot{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}
.demo__input{display:flex;align-items:center;gap:10px;border-top:1px solid var(--lp-line);
  padding:11px 14px;font-size:13.5px;color:var(--lp-ink);min-height:44px}
.demo__input-text{white-space:nowrap;overflow:hidden;text-overflow:clip}
.demo__input-text:empty + .demo__caret{opacity:.45}
.demo__caret{width:1.5px;height:16px;background:var(--lp-primary);flex:0 0 auto;
  animation:demoCaret 1.05s steps(1) infinite}
@keyframes demoCaret{0%,55%{opacity:1}56%,100%{opacity:0}}
.demo__send{margin-left:auto;width:28px;height:28px;border-radius:50%;flex:0 0 auto;
  background:var(--lp-primary-soft);display:flex;align-items:center;justify-content:center}
.demo__send svg{width:14px;height:14px;fill:none;stroke:var(--lp-primary);
  stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* — Правая колонка: календарь + сделка — */
.demo__side{display:flex;flex-direction:column;gap:14px;justify-content:center;min-width:0}
.demo__card{background:#fff;border:1px solid var(--lp-line);border-radius:16px;
  box-shadow:var(--lp-shadow);padding:14px 16px;opacity:0;transform:translateY(14px);
  transition:opacity .34s var(--ease-decelerate,ease-out),transform .34s var(--ease-decelerate,ease-out)}
.demo__card.is-on{opacity:1;transform:none}
.demo__card-head{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;
  letter-spacing:.02em;text-transform:uppercase;color:var(--lp-ink-mute);margin-bottom:11px}
.demo__card-head svg{width:15px;height:15px;fill:none;stroke:var(--lp-ink-mute);
  stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* календарь виден с первого кадра (свободный слот-призрак → заполняется бронью) */
.demo__card--cal{opacity:1;transform:none}
.demo__cal-row{display:grid;gap:7px}
.demo__cal-row > *{grid-area:2/1}
.demo__cal-res{grid-area:1/1;font-size:14px;font-weight:600}
.demo__cal-ghost{border:1.5px dashed var(--lp-line);border-radius:9px;padding:8px 12px;
  font-size:12.5px;font-weight:500;color:var(--lp-ink-mute);transition:opacity .3s}
.demo__cal-ghost.is-off{opacity:0}
.demo__cal-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-radius:9px;padding:8px 12px;font-size:12.5px;font-weight:500;
  background:#fdf3e4;color:var(--lp-amber);border:1px solid #f3dfc0;
  transform-origin:left center;transform:scaleX(0);opacity:0;
  transition:transform .4s var(--ease-decelerate,ease-out),opacity .3s,background .45s,color .45s,border-color .45s}
.demo__cal-bar.is-on{transform:none;opacity:1}
.demo__cal-bar.is-paid{background:#e7f7f0;color:var(--lp-emerald);border-color:#bbf0d6}
.demo__pill{font-size:11.5px;font-weight:600;white-space:nowrap}

.demo__b24-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;
  font-size:13px;padding:6px 0;border-bottom:1px dashed var(--lp-line);
  opacity:0;transform:translateY(6px);transition:opacity .26s,transform .26s}
.demo__b24-row.is-on{opacity:1;transform:none}
.demo__b24-row span:last-child{font-weight:600;white-space:nowrap}
.demo__b24-total{border-bottom:0;font-weight:600;font-size:13.5px;padding-top:9px}
.demo__b24-state{display:inline-flex;align-items:center;gap:6px;margin-top:9px;
  font-size:12px;font-weight:600;border-radius:999px;padding:4px 11px;
  background:#fdf3e4;color:var(--lp-amber);
  opacity:0;transition:opacity .3s,background .45s,color .45s}
.demo__b24-state.is-on{opacity:1}
.demo__b24-state.is-paid{background:#e7f7f0;color:var(--lp-emerald)}
.demo__b24-state svg{width:13px;height:13px;fill:none;stroke:currentColor;
  stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* — Toast «клиент оплатил» — */
.demo__toast{position:absolute;right:10px;bottom:-14px;display:flex;align-items:center;gap:9px;
  background:#fff;border:1px solid #bbf0d6;border-radius:12px;padding:10px 14px;
  font-size:13px;font-weight:600;color:var(--lp-emerald);
  box-shadow:0 10px 30px -12px rgba(23,22,28,.3);
  opacity:0;transform:translateY(10px);transition:opacity .32s,transform .32s}
.demo__toast.is-on{opacity:1;transform:none}
.demo__toast svg{width:16px;height:16px;fill:none;stroke:var(--lp-emerald);
  stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* loop fade */
.demo.is-fading .demo__chat,.demo.is-fading .demo__side{opacity:.001;transition:opacity .5s}
.demo__chat,.demo__side{opacity:1;transition:opacity .5s}

@media (max-width:880px){
  .demo{grid-template-columns:1fr;max-width:480px;margin:0 auto}
  .demo__chat{min-height:330px}
  .demo__toast{bottom:-10px}
}
