/* Кабинет «Ключника» на дизайн-системе страницы ключа Teledesk (subpage.py): тёмный фон с фиолетовым
   свечением, карточки-поверхности, кнопки-таблетки. На компьютере — две колонки, на телефоне — одна. */
:root {
  --bg: #000000;
  --surface: #0e0e10;
  --surface-2: #161618;
  --border: #1f1f22;
  --border-2: #2a2a2e;
  --text: #ffffff;
  --soft: #c8c8cf;
  --muted: #8a8a90;
  --accent: #8b7cf6;
  --accent-2: #7c6ef0;
  --green: #4ecf9a;
  --amber: #f3c25b;
  --error: #ff8a80;
  --radius: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  min-height: 100%;
  background: radial-gradient(900px 480px at 50% -120px, rgba(139,124,246,0.22), transparent 70%), var(--bg);
  background-repeat: no-repeat; background-attachment: fixed;
}
body {
  margin: 0; min-height: 100vh; color: var(--text); line-height: 1.5; letter-spacing: -0.01em;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 12px; }
b { font-weight: 600; }

/* шапка */
.top { border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand:hover { text-decoration: none; }
.mark { font-size: 13px; letter-spacing: 3px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  border: 1px solid var(--border-2); border-radius: 8px; padding: 5px 9px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.chip { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 6px 13px;
  font-size: 14px; font-weight: 600; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 46vw; }
.who form { margin: 0; }

/* раскладка */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 18px; }
main.wrap { padding-top: 34px; padding-bottom: 56px; }
main.narrow { max-width: 460px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; line-height: 1.15; }
.sub { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.grid { display: grid; gap: 14px; }
.col { display: grid; gap: 14px; align-content: start; }
@media (min-width: 880px) {
  .grid { grid-template-columns: 1.25fr 1fr; gap: 18px; }
  .col { gap: 18px; }
  h1 { font-size: 36px; }
}

/* карточки */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.015em; }
.card .note { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.card > :last-child { margin-bottom: 0; }
.label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 10px; }

/* статус доступа */
.state { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; border-radius: 999px;
  padding: 5px 11px; background: rgba(78,207,154,0.12); color: var(--green); border: 1px solid rgba(78,207,154,0.25); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.off { background: rgba(255,138,128,0.1); color: var(--error); border-color: rgba(255,138,128,0.25); }
.until { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.until small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: -0.01em; }
.track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 14px 0 18px; }
.fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.fill.w0 { width: 4%; } .fill.w1 { width: 12%; } .fill.w2 { width: 25%; } .fill.w3 { width: 40%; }
.fill.w4 { width: 55%; } .fill.w5 { width: 70%; } .fill.w6 { width: 85%; } .fill.w7 { width: 100%; }
.cap { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }

/* шаги подключения */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--soft); font-size: 15px; counter-increment: s; }
.steps li::before { content: counter(s); flex: 0 0 26px; width: 26px; height: 26px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); font-size: 12.5px;
  font-weight: 600; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.steps li > div { flex: 1; min-width: 0; }
.steps li b { color: var(--text); }
.steps .button { margin-top: 10px; }

/* кнопки */
button, .button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 20px; margin: 0; border-radius: 999px; font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.2;
  letter-spacing: -0.01em; text-align: center; text-decoration: none; cursor: pointer;
  background: #fff; color: #000; border: 1px solid #fff; transition: transform .08s, background .15s; }
button:active, .button:active { transform: scale(0.985); filter: brightness(0.8); }
button.is-busy, .button.is-busy { filter: brightness(0.7); cursor: progress; }   /* нажали — ждём страницу (press.js) */
.button:hover { text-decoration: none; background: #e9e9ee; }
button:hover { background: #e9e9ee; }
.button.renew, button.renew { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.renew:hover, button.renew:hover { background: var(--accent-2); }
.button.ghost, button.ghost { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.button.ghost:hover, button.ghost:hover { background: #222226; }
button.link { background: none; border: 0; color: var(--muted); font-weight: 500; font-size: 14px; padding: 8px 4px;
  width: auto; text-decoration: none; }
button.link:hover { color: var(--text); background: none; }
form + form { margin-top: 10px; }
form.secondary { margin-top: 14px; text-align: center; }
form.secondary button.link { margin: 0 auto; }

/* поля */
label { display: block; margin: 18px 0 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
input { width: 100%; padding: 14px 16px; font-family: inherit; font-size: 17px; line-height: 1.3; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 14px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,124,246,0.22); }
form > button { margin-top: 16px; }
#code { letter-spacing: 6px; font-size: 22px; text-align: center; font-weight: 600; }

/* QR и ссылка */
.qr-wrap { background: #fff; padding: 14px; border-radius: var(--radius); margin: 4px auto 14px; width: fit-content; }
.qr { display: block; width: 200px; height: 200px; }
.copy { font-size: 13px; color: var(--soft); padding: 12px 14px; }
details > summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 500; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* тексты */
.error { color: var(--error); background: rgba(255,138,128,0.08); border: 1px solid rgba(255,138,128,0.22);
  border-radius: 14px; padding: 11px 14px; font-size: 15px; }
.info, .status { color: var(--green); }
p.info { background: rgba(78,207,154,0.08); border: 1px solid rgba(78,207,154,0.22); border-radius: 14px;
  padding: 11px 14px; font-size: 15px; }
.small { font-size: 14px; color: var(--muted); }
.small a { font-weight: 500; }
.consent { margin-top: 14px; font-size: 12.5px; }
.center { text-align: center; }

/* одиночная карточка (вход, код, сообщения) */
.solo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 22px; }
.solo h1 { font-size: 26px; margin-bottom: 10px; }
.solo > p:first-of-type { color: var(--soft); }

/* тарифы */
.plans { display: grid; gap: 12px; margin-top: 4px; }
@media (min-width: 640px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { margin: 0; }
/* тариф — одна строка-кнопка: срок и цена за месяц слева, сумма справа; нажал — сразу оплата */
.plan button.plan-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  margin: 0; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; min-height: 64px; }
.plan button.plan-btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.plan button.plan-btn:active, .plan button.plan-btn.is-busy { background: var(--surface-2); border-color: var(--border-2); }
.plan.best button.plan-btn { border-color: rgba(139,124,246,0.65); box-shadow: 0 0 0 1px rgba(139,124,246,0.3) inset; }
.plan .p-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plan .p-title { font-size: 16px; font-weight: 600; }
.plan .p-price { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.plan .p-price::after { content: "›"; margin-left: 10px; color: var(--muted); font-weight: 400; }
.plan-month { font-size: 13.5px; color: var(--muted); font-weight: 400; }
.plan .flag { display: inline-block; vertical-align: 1px; margin-left: 6px; font-size: 11.5px; font-weight: 600;
  color: #fff; background: var(--accent); border-radius: 999px; padding: 3px 8px; }
.perks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 6px; color: var(--soft); font-size: 15px; }
.perks li { display: flex; gap: 10px; align-items: baseline; }
.perks li::before { content: ""; flex: none; width: 13px; height: 7px; border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green); transform: translateY(-3px) rotate(-45deg); }
.back { margin-top: 22px; }
.button.slim, button.slim { width: auto; padding: 9px 16px; font-size: 14px; }
.narrow-box { max-width: 460px; margin: 0 auto; }
.who form > button { margin-top: 0; }

/* вход: главный — через бота, почта второй (26.10.2026) */
.button.tg { background: #2aabee; border-color: #2aabee; color: #fff; }
.button.tg:hover { background: #229ed9; }
.button.tg svg { width: 20px; height: 20px; flex: none; }
.hint { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.solo > p.hint { color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
details.mail > summary { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text);
  font-size: 15px; font-weight: 600; }
details.mail[open] > summary { display: none; }
details.mail label { margin-top: 0; }

/* Закреплённая кнопка внизу экрана (ключ на 30 минут → бот, 27.10.2026): видна при любой прокрутке */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); }
.dock .button { max-width: 480px; margin: 0 auto; }
main.wrap.docked { padding-bottom: 120px; }   /* контент не уходит под кнопку */
details.copy-key { margin: 14px 0 6px; }
