/* Бот «Контур» — симуляция чата, демо arweiss */

@font-face { font-family: "Onest"; src: url("fonts/onest-cyrillic.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("fonts/onest-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }

:root {
  --bg: #e8ecf1;
  --ink: #11161c;
  --muted: #55606d;
  --panel: #ffffff;
  --chat: #f3f5f8;
  --bubble: #ffffff;
  --line: #d5dbe3;
  --accent: #0b7a5f;
  --accent-dark: #086049;
  --accent-soft: #e1f3ed;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, p, ul { margin: 0; padding: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.page {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: clamp(24px, 5vw, 72px); align-items: center;
  max-width: 1080px; min-height: 100vh; min-height: 100dvh; margin-inline: auto; padding: clamp(16px, 4vw, 40px);
}

.tag { display: inline-block; margin-bottom: 20px; padding: 6px 14px; background: var(--panel); border-radius: 999px; font-size: .875rem; color: var(--muted); }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 600; line-height: 1.05; letter-spacing: -.04em; text-wrap: balance; }
.lead { margin-top: 20px; max-width: 30em; font-size: 1.0625rem; color: #2c353f; text-wrap: pretty; }
.points { display: grid; gap: 10px; margin-top: 28px; list-style: none; }
.points li { position: relative; padding-left: 28px; }
.points li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain; }
code { padding: 2px 6px; background: var(--panel); border-radius: 6px; font-size: .9em; }
.note { margin-top: 28px; padding: 16px 18px; max-width: 34em; background: var(--panel); border-radius: 16px; font-size: .9375rem; color: #2c353f; }
.btn { margin-top: 20px; min-height: 46px; padding: 0 22px; background: var(--ink); color: #fff; border: 0; border-radius: 999px; font-weight: 500; cursor: pointer; transition: background-color .2s; }
.btn:hover { background: #2c353f; }

.phone {
  display: flex; flex-direction: column; height: min(720px, calc(100dvh - 48px)); min-height: 480px;
  background: var(--chat); border: 1px solid var(--line); border-radius: 32px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(17, 22, 28, .25);
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); }
.avatar svg { width: 22px; height: 22px; }
.chat-head__name { font-weight: 600; line-height: 1.2; }
.chat-head__status { font-size: .8125rem; color: var(--muted); }

.log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.msg { max-width: 86%; display: grid; gap: 6px; animation: pop .22s ease-out; }
.msg--bot { align-self: flex-start; }
.msg--user { align-self: flex-end; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.bubble { padding: 10px 14px 8px; border-radius: 18px; background: var(--bubble); white-space: pre-line; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(17, 22, 28, .06); }
.msg--bot .bubble { border-bottom-left-radius: 6px; }
.msg--user .bubble { border-bottom-right-radius: 6px; background: var(--accent); color: #fff; }
.bubble time { display: block; margin-top: 2px; text-align: right; font-size: .6875rem; color: var(--muted); }
.msg--user .bubble time { color: #fff; }
.label { display: block; margin-bottom: 4px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-dark); }

.noscript { margin: 16px; padding: 14px 16px; border: 1px solid currentColor; border-radius: 12px; }
.kb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.kb--1 { grid-template-columns: 1fr; }
.kb--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kb button { min-height: 44px; padding: 6px 10px; background: var(--accent-soft); color: var(--accent-dark); border: 0; border-radius: 12px; font-size: .9375rem; font-weight: 500; line-height: 1.25; cursor: pointer; transition: background-color .15s; }
.kb button:hover:not(:disabled) { background: #cdeadf; }
.kb button:disabled { cursor: default; opacity: .55; }
.kb button.is-picked { opacity: 1; background: var(--accent); color: #fff; }
.kb .wide { grid-column: 1 / -1; }

.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 14px 16px; background: var(--bubble); border-radius: 18px; border-bottom-left-radius: 6px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b1; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; transform: translateY(-2px); } }

.composer { display: flex; gap: 8px; padding: 10px 12px; background: var(--panel); border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; min-height: 46px; padding: 0 16px; background: var(--chat); border: 1px solid #8793a1; border-radius: 999px; }
.composer input::placeholder { color: #66717e; opacity: 1; }
.composer button { flex: none; display: grid; place-items: center; width: 46px; height: 46px; background: var(--accent); color: #fff; border: 0; border-radius: 50%; cursor: pointer; transition: background-color .15s; }
.composer button:hover { background: var(--accent-dark); }
.composer svg { width: 20px; height: 20px; }

@media (max-width: 820px) {
  .page { grid-template-columns: 1fr; align-items: start; }
  .phone { height: min(680px, calc(100dvh - 32px)); border-radius: 24px; }
  .points, .note { display: none; }
  .lead { margin-top: 12px; font-size: 1rem; }
  .tag { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .log { scroll-behavior: auto; }
}
