:root {
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --border: #e5e9f2;
  --text: #1a2032;
  --text-dim: #667085;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef2ff;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.logo { font-weight: 700; font-size: 17px; }
.site-header-loc { color: var(--text-dim); font-size: 14px; }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  padding: 32px;
  margin-bottom: 24px;
}

/* ---------- hero / donation ---------- */

.hero h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-sub {
  margin: 0 0 26px;
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 56ch;
}

.progress-block { margin-bottom: 26px; }
.progress-numbers {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.progress-raised { font-size: 26px; font-weight: 800; color: var(--accent); }
.progress-goal { color: var(--text-dim); font-size: 14px; }
.progress-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.progress-meta { margin: 8px 0 0; font-size: 13px; color: var(--text-dim); }

.geo-block { margin-bottom: 8px; }
.geo-status {
  font-size: 14px;
  color: var(--text-dim);
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 10px;
  display: inline-block;
}

.blocked-block {
  background: var(--error-bg);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 4px;
}
.blocked-title { margin: 0 0 4px; font-weight: 700; color: var(--error); font-size: 15px; }
.blocked-detail { margin: 0; color: #991b1b; font-size: 14px; }

.donate-form { margin-top: 22px; }

.amount-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.amount-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}
.amount-btn:hover { background: #e0e4fd; }
.amount-btn.selected {
  background: var(--accent);
  color: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 520px) {
  .field-grid { grid-template-columns: 1fr; }
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--text);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.submit-btn {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.submit-btn:hover { background: var(--accent-dark); }
.submit-btn:disabled { opacity: 0.55; cursor: default; }

.error-line { color: var(--error); font-size: 14px; margin: 10px 0 0; }

.thanks-block {
  margin-top: 22px;
  background: var(--ok-bg);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 16px 18px;
}
.thanks-title { margin: 0 0 4px; font-weight: 700; color: var(--ok); }
.thanks-detail { margin: 0; color: #166534; font-size: 14px; }

/* ---------- leaderboard ---------- */

.leaderboard-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}
.muted { color: var(--text-dim); font-size: 14px; }

.leaderboard {
  max-height: 320px;
  overflow-y: auto;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.leaderboard-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-amount { font-weight: 700; color: var(--accent); flex-shrink: 0; }

/* ---------- secondary: wifi diagnostics terminal ---------- */

.diag-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b0f0c;
  border: 1px solid #1e2b22;
  margin-bottom: 24px;
}
.diag-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #11170f88;
  padding: 10px 14px;
  border-bottom: 1px solid #1e2b22;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.diag-title {
  margin-left: 8px;
  color: #6b8b76;
  font-size: 12.5px;
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
}
.diag-body {
  padding: 14px 16px;
  height: 240px;
  overflow-y: auto;
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #4dff88;
}
.diag-body .log-line { margin: 3px 0; white-space: pre-wrap; }
.diag-body .log-scan { color: #2f9c5e; }
.diag-body .log-issue { color: #ffbf47; }
.diag-body .log-fix { color: #b6ffd1; }
.diag-body .log-ok { color: #4dff88; }
.diag-body a {
  color: #7dd3fc;
  text-decoration: underline;
}
.diag-body a:hover { color: #bae6fd; }

/* ---------- footer ---------- */

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 8px;
}
