/* Legion VPN — общий стиль главной и веб-приложения (REB-g).
   Графит + латунь, один акцент, никаких эффектов ради эффектов. */
:root {
  --bg: #0F1216;
  --surface: #151920;
  --surface-2: #1C2129;
  --line: rgba(241, 242, 238, .08);
  --line-2: rgba(241, 242, 238, .14);
  --text: #F1F2EE;
  --muted: #8A919A;
  --brass: #E6CB84;
  --brass-hover: #EFD9A0;
  --on-brass: #0F1216;
  --ok: #8FD19E;
  --err: #EE7B73;
  --radius: 16px;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ul { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(241,242,238,.35); }
.ul:hover { text-decoration-color: var(--brass); }

/* ── Знак и название ── */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand b { font-weight: 700; color: var(--brass); }
.mark { width: 30px; height: 30px; flex: none; }

/* ── Кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brass); color: var(--on-brass); }
.btn-primary:hover { background: var(--brass-hover); }
.btn-ghost { border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: rgba(230, 203, 132, .5); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ── Поверхности ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px;
  border: 1px solid var(--line-2); font: 500 12px var(--mono); color: var(--muted); white-space: nowrap;
}

/* ── Поля ── */
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit;
}
textarea.input { min-height: 112px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #5E656E; }
.input:focus { outline: none; border-color: var(--brass); }

/* ── Переключатель (сегменты) ── */
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 36px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg button small { color: var(--brass); font: 500 11px var(--mono); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ── Статус ── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: #4A515B; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(143, 209, 158, .14); }
.dot.warn { background: var(--brass); box-shadow: 0 0 0 4px rgba(230, 203, 132, .14); }
.dot.err { background: var(--err); box-shadow: 0 0 0 4px rgba(238, 123, 115, .14); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.bar.warn i { background: var(--brass); }
.bar.err i { background: var(--err); }

.note { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.note.ok { border-color: rgba(143, 209, 158, .35); }
.note.err { border-color: rgba(238, 123, 115, .4); color: #F6C1BC; }

.spinner { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 2px solid rgba(230, 203, 132, .25); border-top-color: var(--brass); animation: spin .8s linear infinite; }
.spinner.lg { width: 32px; height: 32px; border-width: 3px; margin: 0 auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px;
  font-size: 14px; font-weight: 600; transition: opacity .2s, transform .2s; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
