/* ═══════════════════════════════════════════════════════════════
   Jes-VPN — Design System
   Palette: dark navy + glassmorphism + accent blue
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:         #070d1c;
  --surface:    #0f1830;
  --border:     #1c2840;
  --accent:     #2563eb;
  --accent-lt:  #5b9bff;
  --text:       #f3f6ff;
  --text-sec:   #9aabcf;
  --text-muted: #5b6f9c;
  --glass-bg:   rgba(15, 24, 48, 0.55);
  --glass-bd:   rgba(255,255,255,0.10);
  --radius:     14px;
  --radius-sm:  8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent-lt); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Glow bg ── */
.glow-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.glow-bg::before {
  content: '';
  position: absolute;
  top: -120px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.30), transparent 70%);
  filter: blur(12px);
}

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-bd);
  padding: 14px 0;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px;
  background: rgba(15,24,48,0.80);
  border: 1px solid var(--glass-bd);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; color: var(--accent-lt); }
.logo-jes  { color: var(--text); }
.logo-vpn  { color: var(--accent-lt); font-weight: 400; }

nav { display: flex; gap: 28px; }
nav a { color: var(--text-sec); font-size: .95rem; }
nav a:hover { color: var(--text); text-decoration: none; }

.header-actions { display: flex; gap: 12px; align-items: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 500; cursor: pointer;
  border: none; transition: all .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
.btn-sm { padding: 7px 16px; font-size: .875rem; }

/* ── Hero ── */
.hero {
  position: relative; z-index: 1;
  padding: 96px 0 80px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero h1 span { color: var(--accent-lt); }
.hero p {
  color: var(--text-sec);
  font-size: 1.15rem;
  max-width: 520px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Features ── */
.features {
  position: relative; z-index: 1;
  padding: 0 0 72px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.feature-icon {
  width: 44px; height: 44px;
  background: rgba(37,99,235,0.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--accent-lt);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-sec); font-size: .9rem; }

/* ── Tariffs ── */
.tariffs {
  position: relative; z-index: 1;
  padding: 0 0 80px;
}
.section-title {
  text-align: center;
  font-size: 1.8rem; font-weight: 700;
  margin-bottom: 40px;
}
.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
}
.tariff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  transition: border-color .2s;
}
.tariff-card:hover { border-color: rgba(91,155,255,0.4); }
.tariff-card.popular {
  border-color: var(--accent-lt);
}
.badge-popular {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: .75rem; font-weight: 600;
  padding: 3px 14px;
  border-radius: 20px;
}
.tariff-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.tariff-price {
  font-size: 2rem; font-weight: 800;
  color: var(--accent-lt);
  margin-bottom: 4px;
}
.tariff-price sub { font-size: 1rem; font-weight: 400; }
.tariff-meta { color: var(--text-sec); font-size: .875rem; margin-bottom: 20px; }
.tariff-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Auth modal ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(7,13,28,0.75);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%; max-width: 400px;
  position: relative;
}
.modal h2 { font-size: 1.3rem; margin-bottom: 6px; }
.modal p { color: var(--text-sec); font-size: .9rem; margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.3rem; line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: .875rem; color: var(--text-sec); margin-bottom: 6px; }
input[type=email], input[type=text], input[type=number], select {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus { border-color: var(--accent-lt); }
.btn-full { width: 100%; justify-content: center; }
.form-error { color: #f87171; font-size: .85rem; margin-top: 8px; }
.form-success { color: #34d399; font-size: .85rem; margin-top: 8px; }
.auth-divider { display:flex; align-items:center; gap:12px; margin:16px 0 12px; color:var(--text-muted); font-size:.85rem; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.btn-tg { background:#229ED9; color:#fff; display:flex; align-items:center; justify-content:center; gap:8px; }
.btn-tg:hover { background:#1a8fc4; }

/* ── Dashboard ── */
.page {
  position: relative; z-index: 1;
  padding: 48px 0;
}
.page-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 32px; }
.keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.key-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.key-card-title {
  font-weight: 600; margin-bottom: 4px;
}
.key-card-meta { color: var(--text-sec); font-size: .875rem; margin-bottom: 16px; }
.badge {
  display: inline-block;
  padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.badge-active { background: rgba(52,211,153,0.15); color: #34d399; }
.badge-expired { background: rgba(248,113,113,0.15); color: #f87171; }

/* ── Key page ── */
.key-sub-url {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: monospace; font-size: .85rem;
  word-break: break-all;
  color: var(--accent-lt);
  margin-bottom: 12px;
  cursor: pointer;
}

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 64px 0; color: var(--text-sec);
}
.empty-state svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }

/* ── Footer ── */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted); font-size: .875rem;
}

/* ── Toast ── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 24px; font-size: .9rem;
  opacity: 0; transition: opacity .3s; pointer-events: none;
  z-index: 500;
}
#toast.show { opacity: 1; }

@media (max-width: 640px) {
  nav { display: none; }
  .hero { padding: 64px 0 48px; }
}
