/* AZIMUT VPN — мини-кабинет.
   Идея: ночная карта и полевой компас. Тёмно-синяя «бумага» карты, контурные линии,
   латунь безеля как акцент, мятный «люминофор» — только для статуса «работает». */

@font-face {
  font-family: "Tektur";
  src: url("fonts/Tektur.ttf") format("truetype");
  font-weight: 400 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/Onest.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #0B1420;        /* фон: ночная карта */
  --panel: #111C2A;      /* поверхности */
  --panel-2: #16243A;
  --contour: #24364C;    /* линии, рамки */
  --contour-2: #2F4560;
  --brass: #D9A94E;      /* акцент: латунь компаса */
  --brass-hi: #ECC77D;
  --brass-deep: #A9792A;
  --paper: #ECEFF3;      /* основной текст */
  --mist: #8A99AD;       /* второстепенный текст */
  --lume: #8FE3B9;       /* статус «активна» */
  --signal: #F07A5A;     /* истекла / ошибка */
  --display: "Tektur", "Onest", system-ui, sans-serif;
  --body: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r-btn: 14px;
  --r-panel: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--ink); color: var(--paper); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.view {
  max-width: 520px; margin: 0 auto;
  padding: 14px 16px calc(96px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 16px;
}

/* ---------- верхняя строка ---------- */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.topbar img { width: 34px; height: 34px; border-radius: 9px; }
.wordmark {
  flex: 1; min-width: 0;
  font-family: var(--display); font-weight: 600; font-size: 19px; font-stretch: 118%;
  letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uid { color: var(--mist); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.uid b { color: var(--paper); font-weight: 600; }

/* ---------- компас ---------- */
.hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 4px 0 2px; }
.contours { position: absolute; inset: -30px -16px auto; height: 360px; width: calc(100% + 32px); pointer-events: none; opacity: .55; }
.dial { position: relative; width: min(78vw, 288px); height: auto; aspect-ratio: 1; }
.dial svg { width: 100%; height: 100%; stroke: none; }
.dial .tick { stroke: var(--contour-2); stroke-width: 1.4; }
.dial .tick.major { stroke: var(--mist); stroke-width: 2; }
.dial .bezel { fill: none; stroke: var(--contour); stroke-width: 1.5; }
.dial .track { fill: none; stroke: var(--panel-2); stroke-width: 8; }
.dial .arc {
  fill: none; stroke: var(--brass); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2, .7, .2, 1);
}
.dial .needle { transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.dial .needle path { fill: var(--brass-hi); }
.dial .card-letter { font-family: var(--display); font-size: 15px; font-weight: 600; fill: var(--mist); text-anchor: middle; dominant-baseline: central; }
.dial .card-letter.north { fill: var(--brass); }
.dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.dial-num { font-family: var(--display); font-weight: 700; font-size: clamp(56px, 19vw, 76px); line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.dial-cap { color: var(--mist); font-size: 15px; margin-top: 6px; }
.hero.is-expired .arc, .hero.is-expired .needle path { stroke: var(--signal); fill: var(--signal); }
.hero.is-expired .dial-num { color: var(--signal); }

.status { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; margin-top: 10px; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px; border: 1px solid var(--contour-2); font-weight: 600; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.on { color: var(--lume); border-color: rgba(143, 227, 185, .35); }
.chip.warn { color: var(--brass); border-color: rgba(217, 169, 78, .4); }
.chip.off { color: var(--signal); border-color: rgba(240, 122, 90, .4); }
.until { color: var(--mist); }

/* ---------- кнопки ---------- */
.actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 54px; padding: 12px 18px; border-radius: var(--r-btn);
  font-weight: 650; font-size: 16px; text-align: center; line-height: 1.25;
  transition: transform .12s ease, background-color .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--brass); color: #1A1305; }
.btn-primary:active { background: var(--brass-deep); }
.btn-ghost { border: 1.5px solid var(--contour-2); color: var(--paper); }
.btn-ghost:active { background: var(--panel); }
.btn-split { justify-content: space-between; text-align: left; }
.btn-split small { display: block; color: var(--mist); font-weight: 400; font-size: 13px; }
.btn-split .btn-text { display: flex; flex-direction: column; line-height: 1.25; }

/* ---------- приборная панель ---------- */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border: 1px solid var(--contour); border-radius: var(--r-panel); overflow: hidden; }
.gauge { padding: 14px 12px 13px; text-align: left; position: relative; min-width: 0; }
.gauge + .gauge { border-left: 1px solid var(--contour); }
.gauge-label { color: var(--mist); font-size: 13px; white-space: nowrap; }
.gauge-value { font-family: var(--body); font-weight: 650; font-size: 21px; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge-value small { color: var(--mist); font-family: var(--body); font-size: 14px; font-weight: 500; margin-left: 2px; }
button.gauge:active { background: var(--panel-2); }
.gauge .corner { position: absolute; top: 12px; right: 10px; width: 14px; height: 14px; color: var(--mist); }

/* ---------- промокод ---------- */
.promo { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1.5px dashed var(--contour-2); border-radius: var(--r-btn); }
.promo svg { color: var(--brass); }
.promo input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; padding: 10px 0; font-size: 16px; letter-spacing: .04em; }
.promo input::placeholder { color: var(--mist); letter-spacing: 0; }
.promo button { padding: 10px 14px; border-radius: 10px; font-weight: 600; color: var(--mist); background: var(--panel); }
.promo button.ready { color: #1A1305; background: var(--brass); }

/* ---------- полоса «Друзья» ---------- */
.strip { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; background: var(--panel); border: 1px solid var(--contour); border-radius: var(--r-panel); }
.strip:active { background: var(--panel-2); }
.strip-pct { font-weight: 800; font-size: 28px; color: var(--brass); letter-spacing: -0.02em; }
.strip-text { flex: 1; min-width: 0; line-height: 1.3; }
.strip-text b { display: block; font-weight: 650; }
.strip-text span { color: var(--mist); font-size: 14px; }
.chev { color: var(--mist); width: 18px; height: 18px; }

/* ---------- общие блоки ---------- */
/* Кириллица Tektur слишком декоративна для заголовков — они набраны Onest, Tektur остаётся для знака, цифр и сторон света. */
.h1 { font-family: var(--body); font-weight: 750; font-size: 28px; line-height: 1.15; margin: 8px 0 0; letter-spacing: -0.01em; }
.lead { color: var(--mist); margin: -6px 0 0; max-width: 34em; }
.panel { background: var(--panel); border: 1px solid var(--contour); border-radius: var(--r-panel); padding: 16px; }
.panel-flush { padding: 0 16px; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 0; text-align: left; }
.panel-flush .row + .row { border-top: 1px solid var(--contour); }
.row-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); color: var(--brass); flex: none; }
.row-ico svg { width: 20px; height: 20px; }
.row-text { flex: 1; min-width: 0; }
.row-text b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text span { display: block; color: var(--mist); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--mist); flex: none; border: 1px solid var(--contour); }
.icon-btn.danger { color: var(--signal); }
.icon-btn svg { width: 18px; height: 18px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; }
.kv + .kv { border-top: 1px solid var(--contour); }
.kv span { color: var(--mist); }
.kv b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- маршрут (шаги подключения) ---------- */
.route { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-left: 40px; }
.route::before { content: ""; position: absolute; left: 13px; top: 18px; bottom: 18px; border-left: 2px dashed var(--contour-2); }
.waypoint { position: relative; min-width: 0; }
.waypoint-mark {
  position: absolute; left: -40px; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); border: 2px solid var(--brass);
  font-family: var(--body); font-weight: 750; font-size: 13px; color: var(--brass);
}
.waypoint h3 { margin: 2px 0 4px; font-size: 18px; font-weight: 650; }
.waypoint p { margin: 0 0 12px; color: var(--mist); }
.platforms { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px 0; padding: 2px 16px 4px 0; scrollbar-width: none; }
.platforms::-webkit-scrollbar { display: none; }
.platform { flex: none; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--contour-2); color: var(--mist); font-weight: 600; font-size: 14px; white-space: nowrap; }
.platform.is-active { border-color: var(--brass); color: var(--brass); }

/* ---------- друзья ---------- */
.pct-hero { display: flex; align-items: baseline; gap: 12px; }
.pct-hero b { font-weight: 800; font-size: 60px; line-height: 1; color: var(--brass); letter-spacing: -0.03em; }
.pct-hero span { color: var(--mist); max-width: 14em; line-height: 1.35; }
.linkbox { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: var(--r-btn); background: var(--ink); border: 1px solid var(--contour); }
.linkbox code { flex: 1; min-width: 0; font-family: var(--body); font-size: 14px; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauges.two { grid-template-columns: repeat(2, 1fr); }

/* ---------- профиль ---------- */
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--panel-2) center/cover no-repeat; border: 2px solid var(--brass); font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--brass); }

/* ---------- пусто / состояния ---------- */
.empty { text-align: center; padding: 28px 18px; }
.empty h2 { font-family: var(--body); font-weight: 750; font-size: 21px; margin: 12px 0 6px; }
.empty p { color: var(--mist); margin: 0 auto 18px; max-width: 26em; }
.empty .mark { width: 56px; height: 56px; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--mist); font-weight: 600; padding: 6px 0; }
.back svg { width: 18px; height: 18px; }
.note { color: var(--mist); font-size: 14px; margin: 0 4px; }

/* ---------- док-панель ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(11, 20, 32, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--contour);
}
.dock-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--mist); font-size: 12px; font-weight: 600; }
.dock-btn svg { width: 24px; height: 24px; padding: 0; }
.dock-btn.is-active { color: var(--brass); }
.dock-btn.is-active svg { background: rgba(217, 169, 78, .14); border-radius: 999px; width: 52px; height: 28px; padding: 2px 14px; }

/* ---------- тост / загрузка ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + var(--safe-bottom)); z-index: 20;
  max-width: 488px; margin: 0 auto; padding: 12px 16px; border-radius: 12px;
  background: var(--paper); color: var(--ink); font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: none; }
.boot { display: grid; place-items: center; height: 70vh; }
.boot span { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--contour); border-top-color: var(--brass); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .dial .arc, .dial .needle { transition: none; }
  .boot span { animation-duration: 3s; }
}
@media (max-width: 350px) {
  .gauge-value { font-size: 19px; }
  .wordmark { font-size: 17px; }
}

/* ---------- правки: пустой компас, выбор приложения ---------- */
.dial-idle { width: 76px; height: 76px; opacity: .9; }
.dial-idle .mark, .dial-idle svg { width: 100%; height: 100%; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.app-chip { display: inline-flex; align-items: center; gap: 6px; }
.btn-quiet { min-height: 46px; font-weight: 600; color: var(--mist); border-color: var(--contour); }

/* ---------- профиль: группы, история платежей, документы ---------- */
.group { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.section-label { margin: 0 4px; font-family: var(--body); font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }
.row .chev { flex: none; }
/* длинные названия («Пользовательское соглашение») переносятся, а не обрезаются */
.group .row-text b, .group .row-text span { white-space: normal; overflow-wrap: anywhere; }
.group .row-text b { line-height: 1.3; }
.pay { align-items: flex-start; }
.pay .row-ico { margin-top: 1px; }
.pay .row-text b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.pay .row-text span { margin-top: 2px; }
.pay-amount { flex: none; padding-top: 1px; font-weight: 650; white-space: nowrap; }
.pay.is-in .pay-amount { color: var(--lume); }
.pay.is-in .row-ico { color: var(--lume); background: rgba(143, 227, 185, .1); }
.doc { padding: 18px 18px 20px; line-height: 1.6; overflow-wrap: anywhere; }
.doc b, .doc strong { font-weight: 650; }
.doc a { color: var(--brass); text-decoration: underline; text-underline-offset: 3px; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc blockquote { margin: 8px 0; padding: 4px 0 4px 12px; border-left: 2px solid var(--brass); color: var(--mist); }
.doc code, .doc pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--ink); border-radius: 6px; }
.doc code { padding: 1px 5px; }
.doc pre { margin: 8px 0; padding: 10px 12px; white-space: pre-wrap; }
.doc pre code { padding: 0; background: none; }
