:root {
  --bg: #07060d;
  --card: rgba(255, 255, 255, .045);
  --card-hi: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .08);
  --text: #f4f2ff;
  --muted: #9a96b5;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
  --radius: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.45; min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 18s ease-in-out infinite; }
.o1 { width: 340px; height: 340px; background: #6d28d9; top: -120px; left: -100px; }
.o2 { width: 300px; height: 300px; background: #0891b2; top: 220px; right: -140px; animation-delay: -6s; opacity: .4; }
.o3 { width: 260px; height: 260px; background: #4f46e5; bottom: -120px; left: 20%; animation-delay: -12s; opacity: .35; }
.noise { position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,40px) scale(1.1); } }

#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 14px 16px calc(100px + var(--safe-b)); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(139, 92, 246, .15); border: 1px solid rgba(139, 92, 246, .35);
  box-shadow: 0 0 24px rgba(139, 92, 246, .35); }
.logo svg { width: 28px; height: 28px; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { color: var(--muted); font-size: 13px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad) center/cover; display: grid; place-items: center;
  font-weight: 800; border: 2px solid rgba(255,255,255,.12); }

/* ---------- tabs ---------- */
.tab { display: none; animation: in .35s cubic-bezier(.2,.8,.2,1); }
.tab.active { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.loader { display: grid; place-items: center; height: 60vh; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--violet); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); margin-bottom: 12px; }
.h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 6px 2px 4px; }
.lead { color: var(--muted); margin: 0 2px 16px; }
.label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* hero */
.hero { position: relative; overflow: hidden; padding: 22px; }
.hero::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(139,92,246,.7), rgba(34,211,238,.25) 50%, transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.hero-main { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.08); }
.ring .prog { stroke: url(#rg); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 8px rgba(139,92,246,.6)); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-num { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.ring-cap { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hero-info { flex: 1; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.pill.ok { color: var(--green); background: rgba(52,211,153,.12); }
.pill.ok i { animation: pulse 2s infinite; }
.pill.warn { color: var(--amber); background: rgba(251,191,36,.12); }
.pill.bad { color: var(--red); background: rgba(248,113,113,.12); }
@keyframes pulse { 50% { opacity: .35; } }
.hero-until { margin-top: 12px; color: var(--muted); font-size: 13px; }
.hero-until b { display: block; color: var(--text); font-size: 17px; margin-top: 2px; }

.traffic { margin-top: 20px; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; border-radius: inherit; background: var(--grad); width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.traffic-nums { font-size: 13px; color: var(--muted); }
.traffic-nums b { color: var(--text); }

/* buttons */
.btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-radius: 18px;
  font-weight: 800; font-size: 16px; transition: transform .15s, opacity .2s; position: relative; overflow: hidden; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -8px rgba(139,92,246,.7); }
.btn-primary::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); animation: shine 3.5s infinite; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-ghost { background: var(--card-hi); border: 1px solid var(--line); }
.btn svg { width: 20px; height: 20px; }
.btn-sm { padding: 10px 14px; font-size: 14px; border-radius: 14px; width: auto; }
.mt { margin-top: 12px; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); transition: transform .15s; }
.action:active { transform: scale(.94); }
.action .ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; }
.action svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* promo */
.promo { text-align: center; padding: 26px 20px; }
.promo-emoji { font-size: 46px; filter: drop-shadow(0 6px 18px rgba(139,92,246,.6)); }
.promo h3 { font-size: 22px; margin: 10px 0 6px; font-weight: 800; letter-spacing: -.02em; }
.promo p { color: var(--muted); margin: 0 0 18px; }
.feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.feat { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.feat .e { font-size: 22px; }
.feat b { display: block; margin-top: 6px; font-size: 14px; }
.feat span { color: var(--muted); font-size: 12px; }

/* plans */
.plans { display: grid; gap: 10px; }
.plan { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); transition: border-color .2s, background .2s, transform .15s; }
.plan:active { transform: scale(.98); }
.plan.sel { border-color: var(--violet); background: rgba(139,92,246,.12); box-shadow: 0 0 0 4px rgba(139,92,246,.12); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); flex-shrink: 0; display: grid; place-items: center; }
.plan.sel .radio { border-color: var(--violet); }
.plan.sel .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--violet); }
.plan-title { font-weight: 800; font-size: 16px; }
.plan-sub { color: var(--muted); font-size: 13px; }
.plan-price { margin-left: auto; text-align: right; }
.plan-price b { font-size: 18px; font-weight: 800; }
.plan-price span { display: block; color: var(--muted); font-size: 12px; }
.badge { position: absolute; top: -9px; right: 16px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; background: var(--grad); color: #fff; }

.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.method { padding: 14px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); text-align: left; transition: .2s; }
.method.sel { border-color: var(--cyan); background: rgba(34,211,238,.1); }
.method .e { font-size: 22px; }
.method b { display: block; font-size: 14px; margin-top: 4px; }
.method span { color: var(--muted); font-size: 12px; }

/* devices */
.dev { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.dev-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--card-hi); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.dev-name { font-weight: 700; }
.dev-meta { color: var(--muted); font-size: 12px; }
.dev .del { margin-left: auto; width: 38px; height: 38px; border-radius: 12px; background: rgba(248,113,113,.1); color: var(--red); display: grid; place-items: center; flex-shrink: 0; }
.dev .del svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.slots { display: flex; gap: 6px; margin-top: 10px; }
.slots i { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); }
.slots i.on { background: var(--grad); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .e { font-size: 40px; display: block; margin-bottom: 8px; }

/* friends */
.ref-hero { text-align: center; padding: 26px 20px; }
.ref-big { font-size: 52px; font-weight: 800; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 14px 6px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 12px; }
.linkbox { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--line); margin-top: 12px; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #c4b5fd; }
.steps { counter-reset: s; display: grid; gap: 12px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 9px; background: var(--card-hi); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }

/* tabbar */
.tabbar { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b));
  width: calc(100% - 32px); max-width: 488px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px;
  border-radius: 24px; background: rgba(20, 18, 34, .78); border: 1px solid var(--line);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 20px 40px -10px rgba(0,0,0,.6); }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 700; transition: .2s; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.active { color: #fff; background: rgba(139,92,246,.2); }
.tabbar button.active svg { stroke: #c4b5fd; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 20; visibility: hidden; }
.sheet.open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .3s; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; max-width: 520px; margin: 0 auto;
  background: #12101f; border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(24px + var(--safe-b)); transform: translateY(100%); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.sheet.open .sheet-body { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.15); margin: 0 auto 14px; }
.seg { display: flex; padding: 4px; background: rgba(255,255,255,.05); border-radius: 14px; margin: 14px 0; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card-hi); color: #fff; }
.appi { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; }
.appi-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.appi-name { font-weight: 800; }
.appi-sub { color: var(--muted); font-size: 12px; }
.appi { flex-wrap: wrap; }
.appi .btns { width: 100%; display: flex; gap: 8px; }
.appi .btns .btn { flex: 1; }
.qr { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 20px; width: 220px; margin: 16px auto 4px; }

/* toast */
.toast { position: fixed; z-index: 30; left: 50%; top: 16px; transform: translate(-50%, -150%); padding: 12px 18px; border-radius: 16px;
  background: rgba(30, 27, 50, .95); border: 1px solid var(--line); font-weight: 700; font-size: 14px; transition: transform .35s cubic-bezier(.2,.8,.2,1); max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }

/* документы и согласие */
.docs { margin-top: 12px; }
.doc-link { display: block; width: 100%; text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
.doc-link:last-child { border-bottom: 0; }
.doc-link i { font-style: normal; display: inline-block; width: 28px; }
.consent { color: var(--muted); font-size: 12px; text-align: center; margin: 10px 8px 0; line-height: 1.5; }
.consent a { color: #c4b5fd; }
