/* HatsuneWin VPN — violet design system */
:root {
  --bg: #0b0716;
  --bg-2: #120b24;
  --surface: rgba(28, 19, 51, 0.72);
  --surface-solid: #1a1230;
  --primary: #a78bfa;
  --primary-2: #8b5cf6;
  --primary-3: #7c3aed;
  --accent: #e9d5ff;
  --pink: #f0abfc;
  --text: #ece7fb;
  --text-dim: #a99cc9;
  --border: rgba(167, 139, 250, 0.18);
  --border-strong: rgba(167, 139, 250, 0.38);
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --radius: 18px;
  --shadow: 0 18px 50px -20px rgba(76, 29, 149, 0.9);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  pointer-events: none;
}
body::before {
  width: 620px; height: 620px;
  top: -260px; left: -180px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 65%);
}
body::after {
  width: 560px; height: 560px;
  bottom: -260px; right: -200px;
  background: radial-gradient(circle, #c026d3 0%, transparent 65%);
  opacity: 0.35;
}

a { color: var(--primary); }

/* ---------- header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(11, 7, 22, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(120deg, #f5d0fe, #a78bfa 55%, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.logo span { -webkit-text-fill-color: initial; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font-size: 1.15rem;
  cursor: pointer;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.18s, background 0.18s;
}
nav a:hover { color: var(--text); background: rgba(167, 139, 250, 0.1); }
nav a.active { color: var(--accent); background: rgba(167, 139, 250, 0.14); }

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-left: 0.4rem;
}
.nav-user b { color: var(--accent); font-weight: 600; }

/* ---------- layout ---------- */
main { flex: 1; }

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
}
.container.narrow { max-width: 460px; }

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.center { text-align: center; }
.muted { color: var(--text-dim); }
.small { font-size: 0.875rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(38, 26, 66, 0.82), rgba(16, 10, 30, 0.88));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--border-strong); }
.card.lift:hover { transform: translateY(-3px); }
.card h1, .card h2, .card h3 { margin-top: 0; }
.card h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.card.accent {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(147, 51, 234, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, rgba(45, 28, 82, 0.9), rgba(16, 10, 30, 0.92));
  border-color: rgba(192, 132, 252, 0.35);
}
.card.donate-gold {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(245, 197, 66, 0.28) 0%, transparent 55%),
    linear-gradient(160deg, rgba(70, 48, 12, 0.9), rgba(16, 10, 30, 0.92));
  border-color: rgba(245, 197, 66, 0.6);
  box-shadow: 0 0 26px -10px rgba(245, 197, 66, 0.6);
}
.donate-gold h2 {
  color: #f5c542;
}
.btn-gold {
  color: #2a1d00;
  border: 0;
  background: linear-gradient(135deg, #ffe27a, #f5c542 45%, #d9a21b);
  box-shadow: 0 6px 18px -8px rgba(245, 197, 66, 0.9);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #14061f;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, filter 0.16s;
  box-shadow: 0 10px 26px -10px rgba(139, 92, 246, 0.95);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(167, 139, 250, 0.1); }

.btn-soft {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
  border-color: var(--border);
  box-shadow: none;
}
.btn-soft:hover { background: rgba(167, 139, 250, 0.2); }

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #fb7185); color: #2a0710; }

/* ---------- forms ---------- */
.form-group { margin-bottom: 1rem; }
label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-dim);
}
input, textarea, select {
  width: 100%;
  padding: 0.72rem 0.95rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(10, 6, 20, 0.72);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: border-color 0.16s, box-shadow 0.16s;
}
input::placeholder, textarea::placeholder { color: #6f6490; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);
}
textarea { resize: vertical; min-height: 110px; }
select option { background: var(--surface-solid); }

.input-row { display: flex; gap: 0.5rem; align-items: stretch; }
.input-row input { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.85rem; }

/* ---------- alerts & status ---------- */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.alert-error { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.35); color: #fecdd3; }
.alert-ok { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); color: #a7f3d0; }
.alert-info { background: rgba(167, 139, 250, 0.1); border-color: var(--border); color: var(--accent); }
.alert-warn { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.35); color: #fde68a; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.status-ok { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); color: var(--success); }
.status-bad { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.35); color: var(--danger); }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2s infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.dot.off { animation: none; box-shadow: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-ok { background: rgba(52, 211, 153, 0.12); color: var(--success); border-color: rgba(52, 211, 153, 0.25); }
.badge-bad { background: rgba(244, 63, 94, 0.12); color: var(--danger); border-color: rgba(244, 63, 94, 0.25); }
.badge-dim { background: rgba(167, 139, 250, 0.12); color: var(--accent); border-color: var(--border); }
.badge-warn { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.25); }

/* ---------- hero / landing ---------- */
.hero {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  position: relative;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero h1 {
  margin: 1.25rem auto 0;
  max-width: 20ch;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  background: linear-gradient(120deg, #ffffff 10%, #e9d5ff 45%, #a78bfa 75%, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  margin: 1.1rem auto 0;
  max-width: 56ch;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  color: var(--text-dim);
}
.hero .actions { margin-top: 2rem; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.feature-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 1.25rem;
  background: linear-gradient(140deg, rgba(139, 92, 246, 0.35), rgba(192, 38, 211, 0.2));
  border: 1px solid var(--border-strong);
  margin-bottom: 0.9rem;
}

.steps { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding-left: 3rem; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  color: #150a25;
  background: linear-gradient(135deg, var(--primary), var(--pink));
}
.step h3 { margin: 0.25rem 0 0.35rem; font-size: 1rem; color: var(--accent); }
.step p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 78vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { justify-content: center; font-size: 1.4rem; }
.auth-side-note { text-align: center; margin-top: 1.5rem; color: var(--text-dim); font-size: 0.92rem; }

/* ---------- misc components ---------- */
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed rgba(167, 139, 250, 0.14); font-size: 0.93rem; }
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--text-dim); }
.kv span:last-child { font-weight: 600; text-align: right; }

.server-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: 12px;
  background: rgba(10, 6, 20, 0.35);
  margin-bottom: 0.6rem;
}
.server-item:last-child { margin-bottom: 0; }
.server-name { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: 0.95rem; }
.server-meta { color: var(--text-dim); font-size: 0.8rem; }
.server-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; flex: none; }

.qr { text-align: center; }
.qr img {
  width: 100%;
  max-width: 210px;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
}

.code {
  display: block;
  padding: 0.7rem 0.9rem;
  background: rgba(8, 5, 16, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
  white-space: pre-wrap;
}
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.88em; color: var(--accent); }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid rgba(167, 139, 250, 0.12); font-size: 0.88rem; }
.table th { color: var(--text-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(167, 139, 250, 0.06); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(167, 139, 250, 0.06); }
.table .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8rem; }

.ticket {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(10, 6, 20, 0.35);
  color: inherit;
  text-decoration: none;
  margin-bottom: 0.7rem;
  transition: border-color 0.18s, background 0.18s;
}
.ticket:hover { border-color: var(--border-strong); background: rgba(167, 139, 250, 0.07); }
.ticket-title { font-weight: 600; font-size: 0.95rem; }
.ticket-preview { color: var(--text-dim); font-size: 0.84rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.chat { display: flex; flex-direction: column; gap: 0.7rem; }
.bubble {
  max-width: 86%;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, rgba(139, 92, 246, 0.55), rgba(167, 139, 250, 0.35)); border: 1px solid var(--border-strong); }
.bubble.them { align-self: flex-start; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); }
.bubble .meta { display: block; margin-top: 0.35rem; font-size: 0.72rem; color: rgba(236, 231, 251, 0.6); }

.stat { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat-label { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

.glow-text {
  background: linear-gradient(120deg, #e9d5ff, #a78bfa 60%, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  background: rgba(24, 15, 43, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

footer {
  padding: 1.75rem 1.25rem;
  text-align: center;
  color: #7c6f9e;
  font-size: 0.85rem;
  border-top: 1px solid rgba(167, 139, 250, 0.1);
  margin-top: auto;
}
footer a { color: #a78bfa; text-decoration: none; }

/* reveal animation */
.reveal { animation: fade-up 0.5s ease both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem 1rem 1rem;
    background: rgba(11, 7, 22, 0.98);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  nav.open { display: flex; }
  nav a { padding: 0.65rem 0.85rem; }
  .nav-user { margin: 0.35rem 0 0; align-self: flex-start; }
  .card { padding: 1.25rem; }
  .server-badges { align-items: flex-start; width: 100%; }
}
