/* ── Reset & Variables ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --primary: #4f6ef7;
  --primary-hover: #3d5be0;
  --text: #e2e4ec;
  --muted: #7b7f96;
  --success: #34d399;
  --danger: #f87171;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; line-height: 1.6; }

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

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar { display: flex; align-items: stretch; gap: 2rem; padding: 0 2rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; min-height: 4.4rem; }
.brand { font-weight: 700; color: var(--text); display: flex; margin-top: 7px; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; flex: 1; align-items: center; }
.nav-auth { display: flex; gap: 1rem; align-items: center; }
.nav-links a { display: flex; align-items: center; }
.nav-item:hover { color: #fff; text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary { display: inline-block; background: var(--primary); color: #fff; padding: .55rem 1.3rem; border-radius: var(--radius); border: none; cursor: pointer; font-size: .95rem; font-weight: 600; transition: background .18s; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-secondary { display: inline-block; background: transparent; border: 1px solid var(--primary); color: var(--primary); padding: .4rem 1rem; border-radius: var(--radius); cursor: pointer; font-size: .88rem; font-weight: 500; transition: all .18s; }
.btn-secondary:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-danger { display: inline-block; background: #e53935; color: #fff; padding: .55rem 1.3rem; border-radius: var(--radius); border: none; cursor: pointer; font-size: .95rem; font-weight: 600; transition: background .18s; }
.btn-danger:hover { background: #c62828; }
.btn-sm { padding: .35rem .8rem !important; font-size: .82rem !important; }
.btn-full { width: 100%; text-align: center; }
.btn-lg { padding: .8rem 2rem; font-size: 1.05rem; }
.btn-copy { display: inline-flex; align-items: center; gap: .3rem; background: transparent; border: 1px solid var(--border); color: var(--muted); padding: .35rem .8rem; border-radius: 6px; cursor: pointer; font-size: .82rem; transition: all .18s; white-space: nowrap; }
.btn-copy:hover { border-color: var(--primary); color: var(--primary); }
.btn-copy.copied { border-color: var(--success); color: var(--success); }

/* ── Container ────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 5rem 1rem 4rem; }
.hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 1rem; }
.hero-sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }

/* ── Pricing ──────────────────────────────────────────────────────────────── */
.pricing { padding: 3rem 0; text-align: center; }
.pricing h2 { font-size: 1.8rem; margin-bottom: 2rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; max-width: 700px; margin: 0 auto; }
.pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.pricing-card.featured { border-color: var(--primary); }
.pricing-card h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.proxy-desc { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.pricing-card ul { list-style: none; margin-bottom: 1.5rem; text-align: left; }
.pricing-card li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.badge { background: var(--primary); color: #fff; font-size: .7rem; padding: .1rem .4rem; border-radius: 4px; margin-left: .3rem; }

/* ── Features ─────────────────────────────────────────────────────────────── */
.features { padding: 3rem 0; }
.features h2 { text-align: center; font-size: 1.8rem; margin-bottom: 2rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.feature h4 { margin-bottom: .5rem; }
.feature p { color: var(--muted); font-size: .9rem; }

/* ── Auth card ────────────────────────────────────────────────────────────── */
.auth-card { max-width: 420px; margin: 4rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; }
.auth-card h2 { margin-bottom: 1.5rem; text-align: center; }
.auth-card label { display: block; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }
.auth-card input { display: block; width: 100%; margin-top: .3rem; padding: .6rem .8rem; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 1rem; }
.auth-card input:focus { outline: none; border-color: var(--primary); }
.auth-switch { text-align: center; margin-top: 1.2rem; color: var(--muted); font-size: .9rem; }
.error-msg { background: rgba(248,113,113,.15); color: var(--danger); border-radius: 6px; padding: .5rem .8rem; margin-bottom: .8rem; font-size: .9rem; }
.hidden { display: none; }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.dashboard { display: flex; gap: 2rem; align-items: flex-start; }
.sidebar { width: 200px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; position: sticky; top: 80px; }
.sidebar nav { display: flex; flex-direction: column; gap: .4rem; }
.sidebar a { padding: .5rem .8rem; border-radius: 6px; color: var(--text); font-size: .9rem; }
.sidebar a:hover, .sidebar a.active { background: var(--primary); color: #fff; text-decoration: none; }
.sidebar a.admin-link { color: var(--primary); }
.sidebar a.admin-link:hover { color: #fff; }
.dash-main { flex: 1; }
.dash-main h2 { font-size: 1.3rem; margin: 1.5rem 0 1rem; }

/* ── Proxy cards ──────────────────────────────────────────────────────────── */
.proxies-list, .proxy-list { display: flex; flex-direction: column; gap: 1rem; }
.proxy-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.5rem; }
.proxy-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.proxy-card-title { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; }
.proxy-meta { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.conn-block { font-family: monospace; font-size: .82rem; background: var(--bg); border: 1px solid var(--border); padding: .55rem .8rem; border-radius: 6px; word-break: break-all; color: var(--text); line-height: 1.5; }
.conn-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .65rem; }
.note-input { flex: 1 1 auto; min-width: 120px; padding: .55rem .8rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: .85rem; }
.note-status { font-size: .78rem; white-space: nowrap; }
.proxy-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.proxy-status.up { background: var(--success); }
.proxy-status.down { background: var(--danger); }

/* ── Stats grid ───────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.stat-card .value { font-size: 2rem; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: .85rem; }

/* ── Buy form ─────────────────────────────────────────────────────────────── */
.buy-form, .add-proxy-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; max-width: 500px; }
.buy-form label, .add-proxy-form label { font-size: .9rem; color: var(--muted); }
.buy-form select, .buy-form input, .add-proxy-form select, .add-proxy-form input { display: block; width: 100%; margin-top: .3rem; padding: .55rem .8rem; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 1rem; }
.price-display { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { text-align: center; padding: 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); margin-top: 4rem; }
.loading { color: var(--muted); }
