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

:root {
  --bg:        #0d0d0d;
  --surface:   #1a1a1a;
  --border:    #2e2e2e;
  --green:     #22c55e;
  --green-dim: #16a34a;
  --red:       #ef4444;
  --yellow:    #eab308;
  --text:      #f0f0f0;
  --muted:     #9ca3af;
  --radius:    8px;
}

html { font-size: 16px; }

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

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

/* ── Nav ──────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green);
  letter-spacing: 0.5px;
}

.nav-links { display: flex; gap: 1rem; align-items: center; }

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

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

.container--narrow {
  max-width: 460px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-align: center;
}

.btn--primary {
  background: var(--green);
  color: #000;
}
.btn--primary:hover { background: var(--green-dim); color: #000; text-decoration: none; }

.btn--outline {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn--outline:hover { background: rgba(34,197,94,0.08); text-decoration: none; }

.btn--danger {
  background: var(--red);
  color: #fff;
}

.btn--full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--green);
}
.form-group input::placeholder { color: var(--muted); }

.form-error {
  color: var(--red);
  font-size: 0.82rem;
  margin-top: 0.35rem;
  display: none;
}
.form-error.visible { display: block; }

/* ── Alert banners ────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: none;
}
.alert.visible { display: block; }

.alert--error   { background: rgba(239,68,68,0.12);  border: 1px solid var(--red);    color: #fca5a5; }
.alert--success { background: rgba(34,197,94,0.12);  border: 1px solid var(--green);  color: #86efac; }
.alert--info    { background: rgba(234,179,8,0.12);  border: 1px solid var(--yellow); color: #fde047; }

/* ── Hero section ─────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--green); }

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Status bar ───────────────────────────────────────── */
.status-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.status-item { text-align: center; }
.status-item .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.status-item .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── Rules list ───────────────────────────────────────── */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.rule-card .icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.rule-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; }
.rule-card p { font-size: 0.85rem; color: var(--muted); }

/* ── Page heading ─────────────────────────────────────── */
.page-heading {
  margin-bottom: 1.75rem;
}
.page-heading h1 { font-size: 1.6rem; font-weight: 700; }
.page-heading p { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Divider ──────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Utility ──────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ── Spinner ──────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .nav { padding: 0 1rem; }
  .container, .container--narrow { padding: 1.25rem 1rem; }
  .card { padding: 1.25rem; }
  .status-bar { gap: 1.25rem; }
}
