/* Orbita VPN — кабинет. Токены совпадают с web/brand/tokens.css и макетом. */
:root {
  --royal-blue: #2160E9;
  --royal-azure: #1A59E3;
  --french-blue: #1C449C;
  --cool-horizon: #62A9F4;
  --ghost-white: #F2F2FB;
  --ink: #0E1B3D;
  --ink-2: #414A5E;
  --muted: #5B6478;
  --surface: #FFFFFF;
  --line: #DCDEEC;
  --line-soft: #ECEEF6;
  --line-strong: #C9CEE0;
  --track: #E4E8F5;
  --tint: #E8EFFD;
  --on-deep-muted: #DCE7FD;
  --ok: #1F7A45;
  --ok-dot: #1F9D55;
  --warn: #9A3412;
  --warn-bg: #FFF1E7;
  --warn-line: #F3C9AE;
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Onest', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ghost-white); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
a { color: var(--royal-blue); }
a:hover { color: var(--french-blue); }
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cool-horizon); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* ---------- типографика и утилиты ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.ink { color: var(--ink); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.deep { color: var(--french-blue); }
.center { text-align: center; }
.grow { flex-grow: 1; }
.lead { font-size: 16px; line-height: 1.5; color: var(--muted); }
.label { font-size: 14px; font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--french-blue); text-transform: uppercase; letter-spacing: .06em; }
.h-card { font-size: 17px; font-weight: 700; }
.h-small { font-size: 15px; font-weight: 600; }
.body-2 { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.stack-1, .stack-2, .stack-3, .stack-4, .stack-5 { display: flex; flex-direction: column; }
.stack-1 { gap: 2px; } .stack-2 { gap: 6px; } .stack-3 { gap: 10px; } .stack-4 { gap: 14px; } .stack-5 { gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; }
.icon { display: inline-flex; flex-shrink: 0; }
.icon svg { display: block; }
.icon--lg svg { width: 40px; height: 40px; stroke-width: 1.5; }

/* ---------- кнопки и поля ---------- */
.btn { min-height: 48px; padding: 0 18px; border-radius: var(--radius-sm); border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.btn:disabled { opacity: .6; cursor: default; }
.btn--lg { min-height: 56px; font-size: 17px; border-radius: 14px; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn--primary { background: var(--royal-blue); color: #fff; }
.btn--primary:hover { background: var(--royal-azure); color: #fff; }
.btn--deep { background: var(--french-blue); color: #fff; }
.btn--deep:hover { background: #173A87; color: #fff; }
.btn--secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn--secondary:hover { border-color: var(--french-blue); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn--light { background: #fff; color: var(--french-blue); font-weight: 700; }
.btn--light:hover { background: var(--tint); color: var(--french-blue); }
.btn--outline-light { background: transparent; color: #fff; border: 1.5px solid #6F8CD0; }
.btn--outline-light:hover { color: #fff; border-color: #fff; }
.link-btn { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--royal-blue); font-size: 14px; font-weight: 600; cursor: pointer; }
.link-btn:disabled { color: var(--muted); cursor: default; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--tint); color: var(--ink); }
.input { height: 52px; width: 100%; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 16px; }
.input:focus { border-color: var(--royal-blue); outline: none; box-shadow: 0 0 0 3px rgba(33, 96, 233, .18); }
.input[aria-invalid="true"] { border-color: #B4232A; }
.input--code { font-family: var(--mono); font-size: 24px; letter-spacing: .3em; text-align: center; }
.error { color: #B4232A; font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex-grow: 1; height: 1px; background: var(--line); }

/* ---------- каркас ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.content { flex-grow: 1; padding: 12px 20px 24px; }
.screen { display: flex; flex-direction: column; gap: 16px; }
.m-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.m-header__title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.back { margin-left: -12px; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand__mark { display: block; height: 32px; width: auto; }
.brand--sm .brand__mark { height: 28px; }
.brand__name { font-weight: 700; letter-spacing: -.02em; }
.brand__suffix { color: var(--muted); }
.brand--sm .brand__name, .brand--sm .brand__suffix { font-size: 18px; }
.brand--sm .brand__suffix { display: none; }
.brand--md .brand__name, .brand--md .brand__suffix { font-size: 20px; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill--soft { background: var(--tint); border-color: transparent; color: var(--french-blue); }
.pill--deep { background: var(--french-blue); border-color: transparent; color: #fff; }
.pill--warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }

.topnav { display: none; }
.tabbar { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.tabbar__item { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--muted); text-decoration: none; }
.tabbar__item[aria-current="page"] { color: var(--royal-blue); font-weight: 600; }
.tabbar--owner { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card--deep { background: var(--french-blue); border-color: var(--french-blue); color: #fff; }
.card--accent { border: 2px solid var(--royal-blue); }
.card--warn { border-color: var(--warn-line); }
.card--dashed { border: 1.5px dashed var(--line-strong); background: transparent; }
.on-deep-muted { color: var(--on-deep-muted); font-size: 15px; line-height: 1.5; }
.divided { border-top: 1px solid var(--line); padding-top: 20px; }

.status { display: flex; flex-direction: column; gap: 16px; }
.status__head { display: flex; align-items: center; gap: 10px; }
.status__title { font-size: 15px; font-weight: 600; }
.status__traffic { display: flex; flex-direction: column; gap: 4px; }
.status__foot { display: flex; justify-content: space-between; gap: 8px; }
.status__brand { display: flex; align-items: center; gap: 12px; }
.status__name { font-size: 16px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot--ok { background: var(--ok-dot); }
.big-number { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.big-number__unit { font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 4px; background: var(--royal-blue); }
.meter__fill--warn { background: var(--warn); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fact { display: flex; flex-direction: column; gap: 4px; }
.fact__label { font-size: 12px; color: #B9CEF8; }
.fact__value { font-size: 15px; font-weight: 600; white-space: nowrap; }
.gem { width: 44px; height: 44px; border-radius: 10px; background: #fff; color: var(--french-blue); display: inline-flex; align-items: center; justify-content: center; }
.hs-logo { border-radius: 10px; background: #fff; display: block; flex-shrink: 0; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; font-size: 14px; line-height: 1.5; }
.notice__icon { color: var(--french-blue); margin-top: 1px; }

.connect { display: flex; flex-direction: column; gap: 10px; }
.connect__title { font-size: 18px; font-weight: 700; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(step); width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--french-blue); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.list { padding: 8px 20px; }
.list__head { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.list__title { font-size: 15px; font-weight: 600; }
.list__items { margin: 0; padding: 0; list-style: none; }
.country { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line-soft); }
.country__code { width: 34px; font-family: var(--mono); font-size: 13px; color: var(--french-blue); }
.country__name { flex-grow: 1; font-size: 15px; }
.country--locked, .country--locked .country__code { color: var(--muted); }
.country__lock { display: inline-flex; color: var(--muted); }
.conditions .list__head { padding: 6px 0; }
.condition { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid var(--line-soft); }
.condition__label { flex-grow: 1; font-size: 15px; display: flex; flex-direction: column; }
.condition__value { font-size: 13px; }
.chip-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--royal-blue); background: var(--surface); color: var(--royal-blue); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip-btn:hover { background: var(--tint); color: var(--royal-blue); }
.link-form { display: flex; flex-direction: column; gap: 12px; padding: 12px 0 16px; border-top: 1px solid var(--line-soft); }
.conditions__hint { padding: 4px 0 12px; }
.condition .muted { color: var(--muted); }

.upsell { display: flex; flex-direction: column; gap: 14px; }
.upsell__head { display: flex; justify-content: space-between; align-items: baseline; }
.upsell__title { font-size: 20px; font-weight: 700; }
.upsell__price { font-size: 20px; }

.blocked { display: flex; flex-direction: column; gap: 14px; padding: 24px 20px; }
.blocked__title { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.blocked__text { font-size: 15px; line-height: 1.55; color: var(--ink-2); }

.page-head { display: flex; justify-content: space-between; align-items: baseline; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.devices { padding: 0 20px; }
.device { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.device + .device { border-top: 1px solid var(--line-soft); }
.device__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--tint); color: var(--french-blue); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.device__text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.plans { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; }
.plans__legend { font-size: 15px; font-weight: 600; margin-bottom: 10px; padding: 0; }
.plan { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 16px; cursor: pointer; }
.plan--selected { border: 2px solid var(--royal-blue); padding: 15.5px; }
.plan input { width: 20px; height: 20px; margin: 0; accent-color: var(--royal-blue); }
.plan__text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.plan__price { font-size: 17px; font-weight: 700; }
.compare { padding: 16px 20px; }
.compare table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare caption { text-align: left; font-size: 15px; font-weight: 600; padding-bottom: 8px; }
.compare thead th { color: var(--muted); font-size: 12px; font-weight: 500; padding: 6px 0; text-align: right; }
.compare thead th:first-child { text-align: left; }
.compare thead th.deep { color: var(--french-blue); font-weight: 600; }
.compare tbody tr { border-top: 1px solid var(--line-soft); }
.compare tbody th { text-align: left; font-weight: 400; padding: 10px 0; }
.compare td { text-align: right; white-space: nowrap; padding-left: 12px; }

.faq { padding: 4px 20px; }
.faq__item { border-top: 1px solid var(--line-soft); }
.faq__item:first-child { border-top: 0; }
.faq__item summary { min-height: 52px; display: flex; align-items: center; font-weight: 600; cursor: pointer; list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item p { padding-bottom: 14px; }

/* ---------- вход и загрузка ---------- */
.login { min-height: 100vh; max-width: 440px; margin: 0 auto; padding: 56px 24px 32px; display: flex; flex-direction: column; gap: 40px; }
.brand-logo { display: block; width: 180px; height: auto; }
.loading .brand-logo { width: 150px; }
.login__title { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; }
.toast--show { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: #7A1D22; }

.home-grid, .home-main, .home-aside { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 959px) {
  .desktop-only { display: none !important; }
}

/* ---------- десктоп ---------- */
@media (min-width: 960px) {
  .mobile-only, .m-header, .tabbar { display: none; }
  .topnav { display: flex; align-items: center; gap: 40px; height: 68px; padding: 0 48px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topnav__links { display: flex; gap: 28px; flex-grow: 1; }
  .topnav__link { color: var(--muted); text-decoration: none; font-size: 15px; padding: 22px 0; border-bottom: 2px solid transparent; }
  .topnav__link[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--royal-blue); }
  .topnav__user { font-size: 14px; color: var(--muted); }
  .content { padding: 36px 48px 48px; max-width: 1280px; width: 100%; margin: 0 auto; }
  .home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .home-main { grid-column: span 7; gap: 24px; }
  .home-aside { grid-column: span 5; gap: 24px; }
  .home-main .card, .home-aside .card { padding: 24px 28px; }
  .home-main .list, .home-aside .list { padding: 8px 24px; }
  .connect { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; gap: 16px; }
  .connect .btn--lg { align-self: flex-start; padding: 0 28px; }
  .connect .grid-2 { max-width: 420px; }
  .screen--narrow { max-width: 560px; }
  .toast { bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* ---------- Установка (#/setup) ---------- */
.os-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.os-tabs::-webkit-scrollbar { display: none; }
.os-tab { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.os-tab--active { background: var(--royal-blue); border-color: var(--royal-blue); color: #fff; }
.setup-steps { list-style: none; margin: 0; padding: 20px; display: grid; gap: 22px; }
.setup-step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.setup-step__num { width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--royal-blue); display: grid; place-items: center; font-weight: 700; }
.setup-step__body { display: grid; gap: 10px; min-width: 0; }
.setup-step__title { font-size: 17px; font-weight: 600; line-height: 32px; }
.setup-step .btn { width: 100%; }
.setup__brand { display: flex; justify-content: center; padding: 8px 0 18px; }
.setup__brand img { height: 44px; width: auto; }
.setup__footer { display: flex; justify-content: center; padding: 20px 0 8px; opacity: .8; }
.setup--standalone .page-title { text-align: center; margin-bottom: 14px; }
.setup--standalone .os-tabs { justify-content: center; flex-wrap: wrap; }
.setup--standalone > .muted { margin-top: 16px; }
.content--standalone { max-width: 560px; margin: 0 auto; padding: 24px 16px 32px; }
