:root {
  /* фирменные цвета CarbonVPN: чёрно-бирюзовый фон, ледяной голубой, серебро */
  --bg: #090f0f;
  --surface: #0f1718;
  --surface-2: #152021;
  --line: #1f2a2b;
  --line-2: #31403f;
  --text: #f4f4f8;
  --muted: #7c8c90;
  --accent: #8fd8e8;
  --accent-bg: #10282d;
  --glow: rgba(143, 216, 232, 0.35);
  --silver: #cdd3d6;
  --warn: #f0b45a;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

/* фон как на баннерах бота: мягкое свечение и тонкие круги */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 560px at 82% -6%, rgba(143, 216, 232, 0.08), transparent 62%),
    radial-gradient(1000px 640px at 6% 108%, rgba(143, 216, 232, 0.045), transparent 66%),
    repeating-radial-gradient(circle at 82% 8%, transparent 0 150px, rgba(255, 255, 255, 0.028) 150px 151px);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- каркас ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 32px 40px 72px; display: flex; flex-direction: column; gap: 28px; }
.page.narrow { max-width: 560px; min-height: 100vh; justify-content: center; }

.header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.brand-name span { color: var(--accent); }
.logo-img { display: block; width: 40px; height: 40px; flex: none; }
.logo-img.big { width: 112px; height: 112px; }
.brand-big { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.brand-name.big { font-size: 30px; }

.nav { display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px; }
.nav a { padding: 10px 18px; border-radius: 999px; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current="true"] { background: var(--accent); color: var(--bg); font-weight: 600; }
.nav a[aria-current="true"]:hover { color: var(--bg); }

.who { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.who-name { font-size: 15px; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; min-height: 44px; padding: 0 8px; }
.link-btn:hover { color: var(--text); }

/* ---------- карточки ---------- */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 45%), var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; }
.card.pad-s { padding: 28px; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.display { font-family: var(--font-display); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.muted { color: var(--muted); }

.row { display: flex; flex-wrap: wrap; gap: 24px; }
.grow { flex: 1 1 380px; min-width: 0; }
.grow-wide { flex: 1 1 520px; min-width: 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 0 22px; border-radius: 14px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; text-align: center;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
/* главная кнопка как на баннере «Автовыбор»: светлое серебро с тёмным текстом */
.btn.primary { background: linear-gradient(180deg, #f4f6f7, var(--silver)); border-color: #e6eaec; color: #0b1213; font-weight: 600; box-shadow: 0 8px 26px -12px var(--glow); }
.btn.primary:hover { filter: brightness(1.05); color: #0b1213; box-shadow: 0 8px 30px -8px var(--glow); }
.btn.big { min-height: 56px; border-radius: 16px; font-size: 17px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.dashed { border-style: dashed; }
.btn.danger { border-color: var(--warn); color: var(--warn); }

/* ---------- обзор ---------- */
.ring-wrap { position: relative; width: 200px; height: 200px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); display: block; width: 100%; height: 100%; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 16px; }
.ring-number { font-family: var(--font-display); font-weight: 700; font-size: 48px; line-height: 1; }
.ring-wrap svg circle:nth-child(2) { filter: drop-shadow(0 0 6px var(--glow)); }
.ring-label { font-size: 14px; color: var(--muted); margin-top: 6px; }

.overview { display: flex; flex-wrap: wrap; align-items: center; gap: 36px; }
.facts { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.fact { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.fact span:first-child { color: var(--muted); }
.fact span:last-child { font-weight: 500; text-align: right; }
.sub-title { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.2; margin-top: 4px; }

.badge { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.warn { background: var(--warn); }
.dot.off { background: var(--line-2); }

.cta-card { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row .btn { flex: 1 1 150px; }

/* ---------- серверы ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tile.best { border-color: var(--accent); box-shadow: 0 0 28px -14px var(--glow); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tile-name { font-weight: 600; font-size: 18px; }
.tile-sub { color: var(--muted); font-size: 14px; }
.recommend { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

/* ---------- устройства ---------- */
.dev { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.dev-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.dev-text { flex: 1 1 auto; min-width: 0; }
.dev-title { font-weight: 500; }
.dev-sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev .link-btn { padding: 0 12px; }
.dev .link-btn.confirm { color: var(--warn); }

/* ---------- друзья и тарифы ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--line); }
.progress > div { height: 8px; border-radius: 999px; background: var(--accent); }
.copy-box { display: flex; flex-wrap: wrap; gap: 8px; }
.copy-field { flex: 1 1 180px; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seg { display: flex; flex-wrap: wrap; gap: 10px; }
.seg button {
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.chip { font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--bg); color: var(--accent); }
.price-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.price { font-family: var(--font-display); font-weight: 700; font-size: 52px; line-height: 1.1; }
.note { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: 14px; }
.check { display: flex; align-items: center; gap: 12px; }

.help { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 24px 28px; }

.footer { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 14px; padding: 4px 4px 0; }

/* ---------- документы (соглашение, оплата и возврат, конфиденциальность) ---------- */
.doc-page { max-width: 760px; }
.doc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.doc { display: flex; flex-direction: column; gap: 16px; }
.doc h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.doc h2 { font-size: 18px; font-weight: 600; margin-top: 8px; }
.doc p, .doc li { line-height: 1.65; }
.doc ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.doc-meta { color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.doc-links { display: flex; flex-wrap: wrap; gap: 10px; }
.legal-line { color: var(--muted); font-size: 13px; text-align: center; }
.legal-line a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- вход ---------- */
.login { display: flex; flex-direction: column; gap: 24px; text-align: center; align-items: center; }
.word { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1.2; padding: 20px 28px; border: 1px solid var(--accent); border-radius: 20px; background: var(--accent-bg); color: var(--accent); box-shadow: 0 0 32px -12px var(--glow); }
.accent-line { width: 56px; height: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 14px var(--glow); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- окно подключения ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3, 6, 6, 0.78); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal { width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.step.on { border-color: var(--accent); }
.step-head { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.step-n { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; }
.step.on .step-n { border-color: var(--accent); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-size: 15px; cursor: pointer; }
.chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.code { word-break: break-all; font-size: 13px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; user-select: all; }

/* ---------- уведомление ---------- */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 18px; font-size: 15px; transition: opacity 0.2s, transform 0.2s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.skeleton { height: 220px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }

/* ---------- нижнее меню (телефон и Mini App) ---------- */
.tabbar { display: none; }

@media (max-width: 899px) {
  .page { padding: 20px 16px 120px; gap: 16px; }
  .nav { display: none; }
  .header { gap: 12px; }
  .card, .card.pad-s { padding: 20px; border-radius: 22px; }
  .ring-wrap { width: 128px; height: 128px; }
  .ring-number { font-size: 32px; }
  .ring-label { font-size: 12px; margin-top: 2px; }
  .overview { gap: 20px; flex-wrap: nowrap; }
  .desk-only { display: none !important; }
  .header { flex-wrap: nowrap; }
  .who-name { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 16px; gap: 10px; }
  .facts { gap: 6px; font-size: 14px; }
  .fact { flex-direction: column; gap: 0; border-top: 0; padding-top: 0; }
  .fact span:last-child { text-align: left; }
  .sub-title { font-size: 20px; }
  .price { font-size: 40px; }
  .section-title { font-size: 18px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; color: var(--muted); font-size: 12px; }
  .tabbar a[aria-current="true"] { color: var(--accent); font-weight: 600; }
  .toast { bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation: none; }
  .toast { transition: none; }
}
