:root {
  --text: #111418;
  --muted: #5b6470;
  --soft: #3d4550;
  --line: #dfe3e8;
  --line-strong: #8c95a0;
  --primary: #1769aa;
  --primary-dark: #0f4c7d;
  --tint: #eaf3fb;
  --gray: #f1f3f5;
  --ok: #1a7f37;
  --err: #b42318;
  --disabled: #c9cfd6;
  --frame: 1168px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
button, input, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Рамка сайта: шапка и подвал на всех страницах одной ширины. */
.frame { max-width: var(--frame); margin: 0 auto; padding: 0 24px; }
.hdr { border-bottom: 1px solid var(--line); }
.hdr-in { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 600; }
.nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 400; }
.nav a.nav-on { font-weight: 600; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.ftr { border-top: 1px solid var(--line); }
.ftr-in { padding: 18px 24px; display: flex; gap: 20px; font-size: 14px; color: var(--muted); }

/* Контент: одна колонка 560 у статусов, сетка 920 у формы и ключа, 680 у чата. */
.main {
  flex: 1 0 auto; width: 100%; margin: 0 auto;
  padding: clamp(32px, 7.5vw, 96px) 24px 56px;
  display: flex; flex-direction: column; gap: 24px;
}
.w560 { max-width: 608px; }
.w680 { max-width: 728px; gap: 16px; }
.w920 { max-width: 968px; }
/* Обёртки состояний формы оплаты держат тот же шаг, что и main. */
.stack { display: flex; flex-direction: column; gap: 24px; }

.status { display: flex; flex-direction: column; gap: 10px; }
.status h1 { display: flex; align-items: flex-start; gap: 10px; }
.status h1 .icon { flex: 0 0 20px; height: 1.25em; display: flex; align-items: center; }
.icon-spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon-spin { animation: none; } }

.card {
  padding: 20px 24px; border: 1.5px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card.pad24 { padding: 24px; }
.line { height: 1px; background: var(--line); }
.kv { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; }
.kv-label { display: flex; flex-direction: column; gap: 2px; }
.kv-label .small { color: var(--muted); }
.kv-value { font-weight: 600; }
.price { font-size: 18px; font-weight: 600; white-space: nowrap; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px; border-radius: 10px;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--primary); background: #fff; color: var(--primary);
}
.btn.primary { border: 0; background: var(--primary); color: #fff; }
.btn.tall { height: 44px; }
.btn.start { align-self: flex-start; }
.btn:disabled, .btn.off { border: 0; background: var(--disabled); color: var(--soft); cursor: default; }

/* Форма оплаты */
.seg {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  width: 320px; max-width: 100%; padding: 4px; background: var(--gray); border-radius: 12px;
}
.seg button {
  height: 40px; border: 0; border-radius: 9px; font-size: 15px; font-weight: 500;
  cursor: pointer; color: var(--text); background: transparent;
}
.seg button.seg-on { background: #fff; box-shadow: 0 1px 2px rgba(17, 20, 24, 0.14); }
.grid2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 24px; align-items: start;
}
.grid2.stretch { align-items: stretch; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); }
.field input {
  height: 44px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: #fff; width: 100%;
}
.field input[aria-invalid="true"] { border-color: var(--err); }
.note { font-size: 14px; color: var(--muted); }
.note.err { color: var(--err); }
.note.ok { color: var(--ok); }
.plans { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.plans legend { padding: 0 0 8px; font-size: 14px; color: var(--muted); }
.plan {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer;
}
.plan.plan-on { border-color: var(--primary); background: var(--tint); }
/* Кольцо фокуса только с клавиатуры: при клике мышью хватает выделенной рамки. */
.plan:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.plan input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.plan-name { display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.plan-name small { font-size: 14px; font-weight: 400; color: var(--muted); }
.plan-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.summary { padding: 24px; gap: 14px; }
.summary .what { font-size: 14px; color: var(--muted); }
.summary .name { font-size: 18px; font-weight: 600; }
.summary .traffic { font-size: 15px; color: var(--muted); }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total-sum { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.paybox { display: flex; flex-direction: column; gap: 10px; }

/* Ответ поддержки, пока вас не было */
.banner {
  padding: 14px 20px; border: 1.5px solid var(--primary); border-radius: 14px; background: var(--tint);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 20px;
}
.banner-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.banner-text h2 { font-size: 16px; }
.banner-text p { font-size: 14px; color: var(--soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Ключ готов */
.head { display: flex; flex-direction: column; gap: 4px; }
/* Ключ: QR слева, справа поля ссылки и кода; на телефоне QR сверху. */
.keycard { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px 28px; align-items: center; }
.qr { width: 168px; height: 168px; flex: 0 0 168px; border-radius: 12px; display: block; }
.qr.qr-small { width: 104px; height: 104px; flex-basis: 104px; }
.keyfields { min-width: 0; max-width: 520px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 600px) {
  .keycard { grid-template-columns: 1fr; justify-items: center; }
  .keyfields { width: 100%; }
}

/* Поле копирования: значение целиком, нажатие копирует, значок меняется на галочку. */
.cf-wrap { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cf {
  position: relative; width: 100%; min-height: 46px; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
.cf-text {
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px;
}
.cf-code .cf-text { font-size: 17px; font-weight: 600; letter-spacing: 0.04em; }
.cf-icon { position: relative; flex: 0 0 18px; width: 18px; height: 18px; color: var(--muted); }
.cf-icon svg { position: absolute; inset: 0; transition: opacity .18s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.cf-check { color: var(--ok); opacity: 0; transform: scale(.3) rotate(-30deg); }
.cf-done {
  position: absolute; top: 0; right: 10px; padding: 2px 10px; border-radius: 999px;
  background: var(--ok); color: #fff; font-size: 12px; font-weight: 600; line-height: 18px;
  opacity: 0; transform: translateY(-20%) scale(.8); pointer-events: none;
  transition: opacity .18s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
@media (hover: hover) {
  .cf:hover { border-color: var(--primary); background: var(--tint); }
  .cf:hover .cf-icon { color: var(--primary); }
}
.cf:active { transform: scale(.99); }
.cf.copied { border-color: var(--ok); background: #eaf6ee; animation: cf-pulse .5s ease-out; }
.cf.copied .cf-copy { opacity: 0; transform: scale(.3); }
.cf.copied .cf-check { opacity: 1; transform: none; }
.cf.copied .cf-done { opacity: 1; transform: translateY(-60%); }
@keyframes cf-pulse { from { box-shadow: 0 0 0 0 rgba(26, 127, 55, .35); } to { box-shadow: 0 0 0 8px rgba(26, 127, 55, 0); } }

.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.grow { margin-top: auto; font-size: 15px; }
.tgcard { flex-direction: row; gap: 20px; align-items: center; }
.tgtext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tgline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; }
.tgline svg { flex: 0 0 20px; }
@media (max-width: 600px) { .wide-only { display: none !important; } }

/* Чат */
.chat-sub { margin-top: -12px; font-size: 15px; color: var(--muted); }
.chat { height: 460px; border: 1.5px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.chat-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column-reverse; }
.chat-list { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 80%; display: flex; flex-direction: column; gap: 4px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; }
.msg .who { font-size: 13px; font-weight: 600; color: var(--primary); }
.msg p { padding: 10px 14px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine p { border-radius: 14px 14px 4px 14px; background: var(--tint); }
.msg.theirs p { border-radius: 14px 14px 14px 4px; background: var(--gray); }
.msg .meta { font-size: 13px; color: var(--muted); }
.msg-new { animation: msg-in .22s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg-new { animation: none; } }
.closed-line { display: flex; align-items: center; gap: 12px; padding: 14px 20px 0; font-size: 13px; color: var(--muted); }
.closed-line::before, .closed-line::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.composer { border-top: 1px solid var(--line); padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 6px; }
.composer-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; align-items: flex-end; }
.composer textarea {
  flex: 1 1 280px; min-width: 0; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px;
  font-size: 15px; line-height: 1.45; background: #fff; resize: none;
}
.composer textarea[aria-invalid="true"] { border-color: var(--err); }
.composer .note { font-size: 13px; }
.sr { position: absolute; left: -9999px; }

/* Оферта */
.doc { display: flex; flex-direction: column; gap: 12px; font-size: 16px; }
.doc h2 { margin-top: 12px; }

/* Отклик на действия: цвет, граница и тень меняются плавно, нажатие чуть вдавливает. */
.btn, .plan, .seg button, .nav a, .brand, .field input, .composer textarea, a, .cf {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease,
    box-shadow .18s ease, transform .12s ease, opacity .18s ease;
}
.btn:hover { background: var(--tint); }
.btn.primary:hover { background: var(--primary-dark); }
.btn:active:not(:disabled):not(.off) { transform: scale(.97); }
.btn:disabled:hover, .btn.off:hover { background: var(--disabled); }
.plan:hover:not(.plan-on) { border-color: var(--line-strong); }
.plan:active { transform: scale(.995); }
.seg button:hover:not(.seg-on) { background: rgba(255, 255, 255, .6); }
.nav a:hover, .brand:hover { color: var(--primary); }
.field input:hover, .composer textarea:hover { border-color: #6f7986; }
.field input:focus, .composer textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 170, .16);
}
.field input[aria-invalid="true"]:focus, .composer textarea[aria-invalid="true"]:focus {
  border-color: var(--err); box-shadow: 0 0 0 3px rgba(180, 35, 24, .14);
}

/* Появление: блоки страницы и тарифы приходят снизу, тарифы по очереди. */
@keyframes appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.appear, .banner, .plans .plan { animation: appear .26s ease-out both; }
.plans .plan:nth-child(2) { animation-delay: .04s; }
.plans .plan:nth-child(3) { animation-delay: .08s; }
.plans .plan:nth-child(4) { animation-delay: .12s; }
.plans .plan:nth-child(5) { animation-delay: .16s; }
.plans .plan:nth-child(n+6) { animation-delay: .2s; }
.qr { opacity: 0; }
.qr.loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .appear, .banner, .plans .plan, .msg-new, .cf.copied { animation: none; }
  .btn, .plan, .seg button, .nav a, .brand, .field input, .composer textarea, a, .qr, .cf, .cf-icon svg, .cf-done { transition: none; }
  .qr { opacity: 1; }
}
