/* MyVPN — общий стиль (QazTriber-inspired: obsidian + gold) */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --obsidian: #0d0b0c;
  --surface: #151314;
  --surface-2: #211f20;
  --gold: #e6ca65;
  --gold-dark: #996515;
  --on-surface: #e7e1e2;
  --muted: #97907e;
  --border: rgba(255,255,255,0.08);
  --danger: #b45309;
  --ok: #14532d;
}
[data-theme="light"] {
  --obsidian: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efeae0;
  --gold: #996515;
  --gold-dark: #7a4f10;
  --on-surface: #231f1c;
  --muted: #6b6353;
  --border: rgba(0,0,0,0.1);
  --danger: #b91c1c;
  --ok: #166534;
}
body {
  font-family: -apple-system, 'Manrope', 'Inter', system-ui, sans-serif;
  background: var(--obsidian);
  color: var(--on-surface);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 600px at 15% -5%, rgba(230,202,101,0.08), transparent 60%),
    radial-gradient(800px 500px at 95% 110%, rgba(153,101,21,0.06), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] body::before { opacity: .5; }
.wrap { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 0 20px 48px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: 22px 0 14px; }
h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
h1 .gold, .brand-name {
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Buttons */
.btn, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1206; text-decoration: none; font-size: .92rem; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(153,101,21,0.25), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform .12s, box-shadow .12s, opacity .12s;
  font-family: inherit;
}
.btn:hover, .ghost:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(153,101,21,0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn:active, .ghost:active { transform: translateY(0); }
.btn:focus-visible, .ghost:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ghost {
  background: var(--surface-2); color: var(--on-surface);
  border: 1px solid var(--border); box-shadow: none; font-weight: 600;
}
.ghost:hover { background: var(--surface); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.btn.red { background: linear-gradient(135deg, #c2410c, #991b1b); color: #fff; box-shadow: 0 4px 14px rgba(153,27,27,0.3); }
.btn.wide { width: 100%; }

/* Cards */
.card, .dev {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  margin-bottom: .9rem;
}
.card h2 { font-size: 1.02rem; font-weight: 700; margin-bottom: .7rem; }
.dev-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; flex-wrap: wrap; }
.name { font-weight: 700; font-size: 1.06rem; }
.srv { font-size: .84rem; color: var(--muted); margin-top: .15rem; }
.btnrow { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }

/* Forms */
label { font-size: .8rem; color: var(--muted); display: block; margin-bottom: .3rem; }
input, select {
  padding: .65rem .8rem; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2); color: var(--on-surface);
  font-size: 1rem; width: 100%; font-family: inherit;
}
form.inline { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
form.inline > div { flex: 1; min-width: 140px; }
form.inline .btn { flex-shrink: 0; }

/* Alerts */
.alert { padding: .7rem 1rem; border-radius: 12px; margin: .6rem 0; font-size: .92rem; border: 1px solid var(--border); }
.alert.err { background: rgba(153,27,27,.18); border-color: rgba(185,28,28,.4); }
.alert.ok { background: rgba(20,83,45,.25); border-color: rgba(34,197,94,.3); }

/* Subscription */
.sub { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: .9rem 1.1rem; border-radius: 14px; font-size: .86rem; margin-top: 1rem; word-break: break-all; }
.sub code { color: var(--gold); }

.hint { font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* Password show/hide toggle */
.pw-wrap { position: relative; margin-bottom: .75rem; }
.pw-wrap input { margin-bottom: 0; padding-right: 3rem; }
.pw-toggle {
  position: absolute; right: .5rem; top: 0; height: 100%;
  width: 34px; border-radius: 8px;
  background: transparent; color: var(--muted);
  border: none; cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.pw-toggle:hover { color: var(--on-surface); }
.pw-toggle:active { color: var(--gold); }
.pw-toggle:focus-visible { outline: 2px solid var(--gold); }

/* Theme toggle */
.theme-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); color: var(--on-surface);
  border: 1px solid var(--border); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 769px) { .theme-toggle { top: 18px; right: 18px; } }

/* Users list (admin) */
.user { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; flex-wrap: wrap; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.user:last-child { border-bottom: none; }
.u-email { font-weight: 600; word-break: break-all; }
.u-meta { font-size: .8rem; color: var(--muted); }
.u-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
details.pw summary { list-style: none; }
details.pw summary::-webkit-details-marker { display: none; }
details.pw form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
details.pw input { flex: 1; min-width: 120px; width: auto; }

/* Instructions page */
.inst h1 { margin: .5rem 0 1rem; }
.inst h2 { font-size: 1.1rem; margin: 1.8rem 0 .6rem; }
.step { background: var(--surface); border: 1px solid var(--border); padding: .95rem 1.1rem; border-radius: 12px; margin: .6rem 0; }
.step b { color: var(--gold); }
.os-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.os-tabs button {
  background: var(--surface-2); color: var(--on-surface); border: 1px solid var(--border);
  padding: .55rem .95rem; border-radius: 10px; cursor: pointer; font-size: .9rem; font-family: inherit; font-weight: 600;
}
.os-tabs button.active { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #1a1206; border-color: transparent; }
.tab { display: none; }
.tab.active { display: block; }
code { background: var(--surface-2); padding: .15rem .45rem; border-radius: 6px; font-size: .88em; color: var(--gold); }
.note { background: rgba(20,83,45,.25); border: 1px solid rgba(34,197,94,.3); padding: .8rem 1rem; border-radius: 10px; margin: .7rem 0; font-size: .95rem; }
.warn { background: rgba(153,27,27,.18); border: 1px solid rgba(185,28,28,.4); padding: .8rem 1rem; border-radius: 10px; margin: .7rem 0; font-size: .95rem; }
a { color: var(--gold); }

/* Login */
.login-page { display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.login-card { width: 100%; max-width: 380px; padding: 2rem; }
.login-card h1 { text-align: center; margin-bottom: 1.4rem; }
.login-card input { margin-bottom: .75rem; }

/* Mobile */
@media (max-width: 560px) {
  .wrap { padding: 0 14px 40px; }
  .top { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: stretch; }
  .top-actions > * { flex: 1; text-align: center; }
  .btnrow { display: grid; grid-template-columns: 1fr 1fr; }
  .btnrow .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  form.inline > div { min-width: 100%; }
  .dev-top { flex-direction: column; }
  .dev-top form.inline { width: 100%; }
  .dev-top select { width: 100%; }
  .user { flex-direction: column; align-items: stretch; }
  .u-actions { justify-content: flex-start; }
  .login-page { padding-top: 6vh; }
}
