:root {
  --bg: #060b17;
  --bg-2: #0b1220;
  --card: rgba(20, 30, 50, 0.75);
  --card-solid: #0e1729;
  --border: rgba(120, 160, 220, 0.18);
  --text: #e6eefc;
  --muted: #8ba0c4;
  --brand: #4fc3f7;
  --brand-2: #3b82f6;
  --accent: #22d3ee;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ok: #10b981;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg: #eef3fb;
  --bg-2: #ffffff;
  --card: rgba(255, 255, 255, 0.85);
  --card-solid: #ffffff;
  --border: rgba(20, 40, 80, 0.12);
  --text: #0b1220;
  --muted: #5a6d8f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", "Noto Nastaliq Urdu", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1400px 900px at 15% -20%, rgba(59, 130, 246, 0.35), transparent 60%),
    radial-gradient(1200px 800px at 95% 120%, rgba(34, 211, 238, 0.22), transparent 60%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, button { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 22px;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.9), rgba(10, 18, 32, 0.6));
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.5px; color: var(--text); }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 15px var(--brand); }
.mainnav { display: flex; gap: 16px; flex: 1; justify-content: center; }
.mainnav a { color: var(--muted); font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.mainnav a:hover { color: var(--text); background: rgba(79, 195, 247, 0.08); text-decoration: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.lang-select, select, input, textarea {
  background: rgba(10, 18, 32, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  outline: none;
}
.lang-select { max-width: 150px; }
.user-chip { padding: 6px 12px; border-radius: 999px; background: rgba(79, 195, 247, 0.1); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  background: rgba(79, 195, 247, 0.12);
  color: var(--text); border: 1px solid var(--border);
  cursor: pointer; font-weight: 600;
  transition: all .15s ease;
}
.btn:hover { background: rgba(79, 195, 247, 0.22); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #041225; border: none; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.page { max-width: 1400px; margin: 0 auto; padding: 22px; padding-bottom: 100px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  margin-bottom: 18px;
}
.card h1, .card h2 { margin-top: 0; }
.muted { color: var(--muted); }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(79, 195, 247, 0.1); font-size: 12px; margin-right: 6px; }

.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.alert.err { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); }
.alert.ok  { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4); }

.auth-card { max-width: 420px; margin: 60px auto; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }

#toast { position: fixed; right: 20px; bottom: 80px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--card-solid); color: var(--text);
  padding: 12px 18px; border-radius: 10px;
  border: 1px solid var(--border);
  transform: translateX(120%); opacity: 0; transition: all .25s ease;
  max-width: 320px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.warn { border-color: rgba(245, 158, 11, 0.5); }
.toast.err  { border-color: rgba(239, 68, 68, 0.6); }

.mobile-nav { display: none; }

@media (max-width: 820px) {
  .mainnav { display: none; }
  .topbar { padding: 10px 14px; }
  .page { padding: 12px; padding-bottom: 90px; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(10, 18, 32, 0.95); border-top: 1px solid var(--border);
    backdrop-filter: blur(14px); z-index: 50;
    justify-content: space-around; padding: 8px 4px;
  }
  .mobile-nav a {
    display: flex; flex-direction: column; align-items: center;
    font-size: 10px; color: var(--muted); gap: 2px; text-decoration: none;
    flex: 1; padding: 4px 0;
  }
  .mobile-nav a:hover { color: var(--brand); }
  .mobile-nav a span { font-size: 10px; }
}