/* ShadowVPN — shared brand styles for the user-facing site.
   Mirrors the desktop app palette (gui/dist/styles.css). */

:root {
  --bg: #0b1020;
  --bg2: #131a2e;
  --card: #182037;
  --card2: #1d2742;
  --line: #243154;
  --text: #e7ecf7;
  --muted: #8a96b4;
  --accent: #4f8cff;
  --accent2: #6ad7c5;
  --off: #5b6b8c;
  --on: #2ad17e;
  --warn: #ffb454;
  --danger: #ff5d6c;
  --radius: 14px;
  --maxw: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: radial-gradient(120% 80% at 50% -10%, #1a2540 0%, var(--bg) 55%) no-repeat;
  background-color: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* --- Brand / badges --- */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.brand .logo { font-size: 22px; }
.pill {
  font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #06241c;
  background: linear-gradient(135deg, var(--accent2), #8af0dd);
  padding: 3px 8px; border-radius: 999px;
}
.pill.admin { color: #2a0d12; background: linear-gradient(135deg, var(--warn), #ffd08a); }

/* --- Header --- */
header.site {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11,16,32,.78); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
header.site nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
header.site nav a { color: var(--muted); font-weight: 600; font-size: 14px; }
header.site nav a:hover { color: var(--text); text-decoration: none; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14px; padding: 10px 16px;
  background: var(--accent); color: #fff; transition: transform .1s ease, filter .2s ease, background .2s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--card); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--on); color: #06241c; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* --- Cards --- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}

/* --- Hero --- */
.hero { padding: 80px 0 50px; }
.hero .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 46px; line-height: 1.08; letter-spacing: -.5px; font-weight: 800; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lead { color: var(--muted); font-size: 18px; margin: 18px 0 26px; max-width: 42ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .trust { margin-top: 18px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero .trust b { color: var(--text); }

/* faux app window */
.appshot {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7);
}
.appshot .dot { width: 130px; height: 130px; border-radius: 50%; margin: 6px auto 14px;
  background: var(--bg2); border: 1px solid var(--line); display: grid; place-items: center;
  box-shadow: 0 0 40px rgba(42,209,126,.35), inset 0 0 0 3px rgba(42,209,126,.5); font-size: 44px; }
.appshot .stat-row { display: flex; gap: 10px; margin-top: 12px; }
.appshot .stat-row .s { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.appshot .stat-row .s .k { color: var(--muted); font-size: 11px; }
.appshot .stat-row .s .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.appshot .conn { text-align: center; color: var(--on); font-weight: 800; }
.appshot .meta { text-align: center; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* --- Section headings --- */
.section { padding: 56px 0; }
.section h2 { font-size: 30px; letter-spacing: -.3px; }
.section .sub { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.eyebrow { color: var(--accent2); font-weight: 800; letter-spacing: 1.5px; font-size: 12px; text-transform: uppercase; }

/* --- Feature grid --- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.feature .ic { font-size: 26px; }
.feature h3 { margin: 10px 0 6px; font-size: 17px; }
.feature p { color: var(--muted); font-size: 14px; }

/* --- Server list --- */
.servers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 26px; }
.srv { display: flex; align-items: center; gap: 12px; }
.srv .flag { font-size: 26px; }
.srv .nm { font-weight: 700; }
.srv .ct { color: var(--muted); font-size: 12.5px; }
.srv .load { margin-left: auto; text-align: right; }
.bar { height: 6px; width: 64px; border-radius: 4px; background: var(--bg2); overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--on), var(--accent2)); }

/* --- Pricing --- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 24px 60px -30px rgba(79,140,255,.6); }
.plan .tag { position: absolute; top: -11px; right: 16px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.plan h3 { font-size: 18px; }
.plan .price { font-size: 34px; font-weight: 800; margin: 10px 0 2px; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; margin: 16px 0; display: flex; flex-direction: column; gap: 9px; }
.plan li { color: var(--muted); font-size: 14px; padding-left: 24px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--on); font-weight: 800; }
.plan .btn { margin-top: auto; }

/* --- Forms / auth --- */
.auth-shell { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; }
.auth-card .muted { color: var(--muted); font-size: 14px; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
.form-actions .btn { flex: 1; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:hover { background: var(--card2); }

/* --- Badges / pills --- */
.tag2 { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag2.on { color: var(--on); border-color: rgba(42,209,126,.4); }
.tag2.warn { color: var(--warn); border-color: rgba(255,180,84,.4); }
.tag2.danger { color: var(--danger); border-color: rgba(255,93,108,.4); }
.tag2.accent { color: var(--accent2); border-color: rgba(106,215,197,.4); }

/* --- Dashboard --- */
.dash { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 28px 0; align-items: start; }
.dash .side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 4px; }
.dash .side a { padding: 10px 13px; border-radius: 10px; color: var(--muted); font-weight: 600; cursor: pointer; }
.dash .side a:hover { background: var(--card); color: var(--text); text-decoration: none; }
.dash .side a.active { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.panel { display: none; }
.panel.active { display: block; }
.panel h2 { font-size: 22px; margin-bottom: 4px; }
.panel .sub { color: var(--muted); margin-bottom: 18px; }
.rowcard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 10px; }
.rowcard .grow { flex: 1; min-width: 0; }
.rowcard .muted { color: var(--muted); font-size: 13px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi .k { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.code { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 12px; max-height: 220px; overflow: auto; }

/* --- Footer --- */
footer.site { border-top: 1px solid var(--line); margin-top: 40px; color: var(--muted); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; padding: 26px 22px; font-size: 13px; }
footer.site .tech { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--off); margin-left: auto; }

/* --- Toast --- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--danger); }
#toast.ok { border-color: var(--on); }

.alert { border-radius: 10px; padding: 11px 13px; font-size: 13.5px; margin-top: 14px; display: none; }
.alert.show { display: block; }
.alert.err { background: rgba(255,93,108,.12); border: 1px solid rgba(255,93,108,.4); color: #ffb3bb; }
.alert.ok { background: rgba(42,209,126,.1); border: 1px solid rgba(42,209,126,.4); color: #9af0c4; }

.hide { display: none !important; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }

@media (max-width: 860px) {
  .hero .grid, .features, .pricing { grid-template-columns: 1fr; }
  .hero { padding: 50px 0 30px; }
  .hero h1 { font-size: 34px; }
  .dash { grid-template-columns: 1fr; }
  .dash .side { position: static; flex-direction: row; flex-wrap: wrap; }
  header.site nav { gap: 12px; }
  header.site nav .hide-sm { display: none; }
}
