/* Shared dark-mode palette + base widgets. Imported by every page. */
:root {
  --bg: #292929;
  --bg-2: #1f1f1f;
  --bg-3: #353535;
  --bg-input: #1a1a1a;
  --border: #444;
  --border-hover: #666;
  --text: #f0f0f0;
  --text-dim: #aaa;
  --text-faint: #777;
  --gold: #edb713;
  --gold-dark: #c89a0a;
  --green: #4caf50;
  --amber: #ff9800;
  --blue: #4a90e2;
  --red: #e53935;
  --grey-thumb: #555;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  height: 100%;
  overflow: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header (shared) */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  height: 56px;
  flex-shrink: 0;
}
.app-header h1 {
  font-size: 16px; margin: 0; font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.app-header nav {
  display: flex; gap: 16px; align-items: center;
}
.app-header nav a {
  color: var(--text-dim);
  font-size: 13px;
}
.app-header nav a.active { color: var(--gold); }
.app-header .user {
  color: var(--text-faint); font-size: 12px;
}
.app-header .user .logout {
  margin-left: 10px;
  color: var(--text-dim);
  font-size: 12px;
  text-decoration: underline;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  padding: 0;
}

/* Buttons */
button.btn {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
button.btn:hover:not(:disabled) { background: var(--bg-input); border-color: var(--border-hover); }
button.btn:disabled { opacity: 0.4; cursor: not-allowed; }
button.btn.primary {
  background: var(--gold);
  color: #1f1f1f;
  border-color: var(--gold);
  font-weight: 700;
}
button.btn.primary:hover:not(:disabled) { background: var(--gold-dark); }
button.btn.subtle {
  background: transparent;
}

/* Toast */
.toasts {
  position: fixed; top: 70px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--bg-3);
  border-left: 4px solid var(--gold);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  min-width: 220px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  animation: toast-in 0.18s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--text-faint);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
}
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 14px 40px rgba(0,0,0,0.4);
}
.login-card h1 {
  color: var(--gold);
  font-size: 22px;
  margin: 0 0 8px;
}
.login-card .muted {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 18px;
}
.login-card .muted code {
  background: var(--bg-input);
  padding: 1px 4px;
  border-radius: 3px;
}
.login-card label {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.login-card input[type=email] {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 11px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 14px;
}
.login-card input[type=email]:focus {
  outline: none; border-color: var(--gold);
}
.login-card .notice {
  background: var(--bg-input);
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 3px;
  font-size: 13px;
}
.login-card .notice.success { border-left-color: var(--green); }
.login-card .notice.error   { border-left-color: var(--red); color: var(--red); }
.login-card .small { font-size: 12px; }
.login-card .btn {
  width: 100%;
}
