:root {
  --bg-primary: #08090A;
  --bg-secondary: #0D0F12;
  --bg-card: #1C1E22;
  --bg-hover: #25272C;
  --border: #25262B;
  --border-subtle: #1C1D21;
  --border-active: #D4FC54;
  --text-primary: #F7F8F8;
  --text-secondary: #B4B6BC;
  --text-dim: #8A8F98;
  --accent: #D4FC54;
  --accent-bright: #E6FF7A;
  --accent-on: #08090A;
  --accent-glow: rgba(212, 252, 84, 0.22);
  --success: #D4FC54;
  --danger: #EF4444;
  --warning: #F59E0B;
  --system-font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono-font: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: var(--system-font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Site chrome */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.brand-icon {
  width: 22px;
  height: 22px;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg { width: 22px; height: 22px; }

/* Bigger, more readable base */
body { font-size: 16px; }
.site-nav a { font-size: 15px; }

.site-nav a { color: var(--text-secondary); text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--text-primary); }
.nav-links { display: flex; gap: 24px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { border-color: #3a3c42; text-decoration: none; background: #121316; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); font-weight: 600; }
.btn.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); box-shadow: 0 6px 24px var(--accent-glow); transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.large { padding: 14px 28px; font-size: 16px; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger); color: white; }

/* Form */
.form-card {
  max-width: 420px;
  margin: 60px auto;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.form-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.form-card .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.field input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

.form-error, .form-success {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
  display: none;
}
.form-error { background: rgba(229, 72, 77, 0.1); border: 1px solid rgba(229, 72, 77, 0.3); color: var(--danger); }
.form-error.visible { display: block; }
.form-success { background: rgba(61, 214, 140, 0.1); border: 1px solid rgba(61, 214, 140, 0.3); color: var(--success); }
.form-success.visible { display: block; }

/* Toasts */
#toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}
.toast.success { border-left-color: var(--success); }
.toast.warn { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }

@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modals */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.backdrop[hidden] { display: none; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

/* Utilities */
[hidden] { display: none !important; }

.offline-banner {
  padding: 12px 20px;
  background: rgba(240, 192, 0, 0.1);
  border-bottom: 1px solid rgba(240, 192, 0, 0.25);
  color: var(--warning);
  font-size: 13px;
  text-align: center;
}
