/* Сайт «нормальный VPN»: лендинг и личный кабинет.
   Токены и приёмы те же, что в мини-аппе, но вёрстка своя: мини-апп рассчитан
   на шторку 393×852, а здесь полноэкранная страница с боковыми полями. */

:root {
  --bg: #0c0818;
  --accent: #b49bff; --accent2: #a893dd;
  --muted: #b3a8cf; --dim: #8a7fa6; --soft: #e6def8;
  /* Плотнее, чем в макете: там карточка лежала на ровном тёмном фоне, а у нас
     под ней светятся пятна — на .72 сквозь неё просвечивал весь фон. */
  --glass-bg: linear-gradient(180deg, rgba(28,19,60,.90), rgba(10,7,24,.95));
  --glass-border: rgba(200,180,255,.16);
  --btn-grad: linear-gradient(180deg, #a98cff, #6a3fe0);
  --btn-shadow: 0 6px 16px -10px rgba(139,108,245,.85), inset 0 1px 0 rgba(255,255,255,.3);
  --acc-bg: linear-gradient(180deg, rgba(84,60,168,.5), rgba(32,22,72,.55));
  --acc-border: rgba(178,152,255,.42);
  --green: #4ae08a; --red: #ff6b78; --amber: #ffb46b;
  --pad: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--soft);
  font-family: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--soft); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; box-shadow: none !important; transform: none !important; }
input::placeholder, textarea::placeholder { color: var(--dim); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; color: #fff; letter-spacing: -.02em; }

.ms { font-family: 'Material Symbols Rounded'; font-style: normal; font-size: 24px; line-height: 1;
  display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
  font-variation-settings: 'FILL' 0; -webkit-font-feature-settings: 'liga'; }
.ms.i18 { font-size: 18px; } .ms.i20 { font-size: 20px; } .ms.i21 { font-size: 21px; } .ms.i28 { font-size: 28px; }
.ms.fill { font-variation-settings: 'FILL' 1; }
/* Пока шрифт иконок не пришёл, вместо значков видны английские слова —
   прячем их, иначе первый экран мигает словами content_copy и devices. */
body:not(.fonts-ready) .ms { visibility: hidden; }

/* ---------- фон ----------
   Свечение рисуем прямо на body фоном, без отдельного слоя.

   Так было не сразу, и путь стоит помнить. Сначала здесь лежали три размытых
   пятна (filter: blur) — браузер не успевал растрировать их во весь экран и
   выводил вместо плиток шахматку прямо поверх карточки. Потом пятна стали
   градиентами, но остались в элементе position:fixed со своим z-index: это
   всё ещё отдельный композитный слой над содержимым, и на части машин текст
   под ним переставал отрисовываться — на экране оставались только элементы с
   собственным фоном.

   Теперь слоёв нет вообще: ни fixed, ни filter, ни will-change, ни z-index.
   Фон — обычная заливка, которую браузер рисует вместе со всей страницей. */
body {
  background:
    radial-gradient(64vw 56vh at 10% -6%,  rgba(129, 88, 238, .55), transparent 64%),
    radial-gradient(52vw 48vh at 94%  10%, rgba(96, 56, 214, .42), transparent 62%),
    radial-gradient(76vw 60vh at 46% 106%, rgba(74, 44, 158, .48), transparent 66%),
    var(--bg);
  background-attachment: fixed;
}
.aurora { display: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---------- каркас ---------- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto;
  padding: 24px 16px calc(48px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; flex: none; border-radius: 13px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #c3b0ff, #7b4ff0 46%, #4a24b8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.logo i { position: absolute; background: #fff; border-radius: 2px; }
.logo i:nth-child(1) { left: 12px; top: 10px; width: 4px; height: 20px; }
.logo i:nth-child(2) { right: 12px; top: 10px; width: 4px; height: 20px; }
.logo i:nth-child(3) { left: 12px; top: 10px; width: 20px; height: 4px; transform: rotate(52deg); transform-origin: left top; }
.wordmark { display: flex; align-items: baseline; gap: 6px; font-size: 18px; font-weight: 700; }
.wordmark span { color: #fff; } .wordmark b { color: var(--accent); }
.topbar-acts { display: flex; align-items: center; gap: 8px; }

/* ---------- карточки ---------- */
.card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 24px;
  padding: var(--pad); display: flex; flex-direction: column; gap: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.card-t { font-size: 17px; font-weight: 700; color: #fff; }
.card-s { font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt { margin-top: 6px; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 20px; border: 0; border-radius: 16px; line-height: 1.2;
  font-size: 16px; font-weight: 700; color: #fff; background: var(--btn-grad);
  box-shadow: var(--btn-shadow); transition: transform .1s ease, filter .12s ease; text-align: center; }
/* Наведение только там, где есть настоящий курсор: на тач-экранах :hover
   «залипает» после нажатия и снимается лишь следующим тапом по другому месту.
   Подсветку даём не filter'ом, а фоном — filter поднимает элемент на
   отдельный композитный слой, а именно от слоёв мы здесь и уходим. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background-image: linear-gradient(180deg, #b79cff, #7a50e8); }
  .btn.quiet:hover { background-image: linear-gradient(180deg, rgba(58,42,112,.98), rgba(28,19,60,.98)); }
  .btn.acc:hover { border-color: rgba(178,152,255,.6); }
}
.btn:active { transform: scale(.98); }
.btn.wide { width: 100%; }
.btn.quiet { background: linear-gradient(180deg, rgba(48,34,96,.95), rgba(22,15,50,.95));
  border: 1px solid var(--glass-border); box-shadow: none; font-weight: 600; }
.btn.acc { background: var(--acc-bg); border: 1px solid var(--acc-border); box-shadow: none; }
.btn.small { min-height: 42px; padding: 8px 14px; font-size: 14px; border-radius: 13px; }
.btn.danger { background: linear-gradient(180deg, #ff8a93, #d83a49); box-shadow: 0 14px 28px -14px rgba(216,58,73,.8); }
.ibtn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px;
  background: rgba(58,40,120,.42); border: 1px solid var(--glass-border); color: var(--soft); }
@media (hover: hover) and (pointer: fine) { .ibtn:hover { border-color: var(--acc-border); } }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font-size: 14px; font-weight: 600; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 16px; font-size: 16px; color: #fff;
  background: rgba(20,13,48,.85); border: 1px solid var(--glass-border); outline: none; }
.input:focus { border-color: rgba(178,152,255,.6); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }

/* ---------- мелочи ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 11px;
  background: linear-gradient(180deg, rgba(58,40,120,.55), rgba(24,16,56,.62)); border: 1px solid var(--glass-border);
  color: var(--soft); font-size: 13px; font-weight: 600; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.pill.off i { background: var(--dim); box-shadow: none; }
.big { font-size: clamp(28px, 3.2vw, 34px); font-weight: 800; line-height: 1.1; color: #fff; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.dim { color: var(--dim); font-size: 13px; line-height: 1.45; }
.warn { padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; color: #f2c8a2;
  background: rgba(255,150,70,.09); border: 1px solid rgba(255,170,100,.24); text-wrap: pretty; }
.err { padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; color: #ffd3d8;
  background: rgba(255,107,120,.12); border: 1px solid rgba(255,107,120,.3); }
.ok-note { padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; color: #cdf5de;
  background: rgba(74,224,138,.1); border: 1px solid rgba(74,224,138,.28); }
.key { padding: 12px 14px; border-radius: 99px; background: rgba(8,5,18,.72); border: 1px solid rgba(200,180,255,.1);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; color: #c9bcf0;
  text-align: center; overflow-wrap: anywhere; user-select: all; }
.spinner { width: 26px; height: 26px; margin: 28px auto; border-radius: 50%;
  border: 2.5px solid rgba(200,180,255,.18); border-top-color: var(--accent); animation: sp .9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 30; padding: 13px 22px; border-radius: 99px;
  background: rgba(18,12,34,.94); border: 1px solid rgba(200,180,255,.16); color: #fff; font-size: 15px; font-weight: 500;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- вход ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 420px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px;
  background: rgba(14,9,32,.9); border: 1px solid var(--glass-border); }
.tabs button { min-height: 42px; border: 0; border-radius: 12px; background: none; color: var(--muted);
  font-size: 15px; font-weight: 600; }
.tabs button.on { background: var(--btn-grad); color: #fff; }
.or-line { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--dim); }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: rgba(200,180,255,.12); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 30px; font-weight: 700; letter-spacing: .18em;
  color: #fff; text-align: center; padding: 14px; border-radius: 16px;
  background: rgba(8,5,18,.6); border: 1px solid var(--acc-border); }

/* ---------- кабинет ---------- */
.ring-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { position: relative; width: 164px; height: 164px; flex: none; }
.ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; }
.ring .num b { font-size: 48px; font-weight: 800; letter-spacing: -.04em; color: #fff; line-height: 1; }
.ring .num span { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 800; color: #fff; }
.stat span { font-size: 13px; color: var(--muted); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.slots { display: flex; gap: 6px; }
.slots i { flex: 1; height: 6px; border-radius: 4px; background: rgba(200,180,255,.14); }
.slots i.on { background: linear-gradient(90deg, #a98cff, #8a63f2); }
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(200,180,255,.08); }
.item:last-child { border-bottom: 0; }
.item .ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px;
  background: rgba(58,40,120,.42); border: 1px solid var(--glass-border); color: var(--accent); }
.item .body { flex: 1; min-width: 0; }
.item .body b { display: block; color: #fff; font-size: 15px; font-weight: 600; }
.item .body span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.item .amount { font-size: 15px; font-weight: 700; white-space: nowrap; }
.amount.plus { color: var(--green); } .amount.minus { color: var(--soft); }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pay { min-height: 52px; padding: 8px 12px; border-radius: 14px; display: flex; align-items: center; gap: 8px;
  background: rgba(58,40,120,.35); border: 1px solid var(--glass-border); color: var(--soft);
  font-size: 15px; font-weight: 600; transition: border-color .12s ease; }
.pay.on { background: var(--acc-bg); border-color: var(--acc-border); color: #fff; }
.pay .ms { color: var(--accent); }

/* ---------- чат поддержки ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45;
  text-wrap: pretty; display: flex; flex-direction: column; gap: 6px; }
/* .op — ответ поддержки слева, .me — своё справа. Раньше классы назывались
   in/out по направлению записи в базе, и на сайте читалось не то поле. */
.msg.op { align-self: flex-start; background: rgba(58,40,120,.45); border: 1px solid var(--glass-border); }
.msg.me { align-self: flex-end; background: var(--acc-bg); border: 1px solid var(--acc-border); color: #fff; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-img { max-width: 100%; border-radius: 12px; display: block; }
.msg-file { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; }
.msg time { font-size: 11px; color: var(--dim); align-self: flex-end; }
.chat-bar { display: flex; gap: 10px; align-items: flex-end; }
.chat-bar .input { flex: 1; min-height: 52px; }

@media (max-width: 640px) {
  :root { --pad: 16px; }
  .wrap { padding: 16px 14px 40px; }
  .ring { width: 132px; height: 132px; }
  .ring .num b { font-size: 38px; }
  .stats3 { grid-template-columns: 1fr; }
}
