@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:         #0f0f1a;
  --surface:    #1a1a2e;
  --surface2:   #111827;
  --accent:     #4361ee;
  --accent-h:   #3451d1;
  --accent2:    #7eb8f7;
  --green:      #4caf50;
  --gold:       #f59e0b;
  --text:       #e0e0e0;
  --text-muted: #9a9a9a;
  --text-dim:   #8a8a8a;
  --border:     #2a2a4d;
  --radius:     10px;
}

/* ── Base reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 3px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

/* ── Nav ────────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  text-decoration: none;
}
.nav-logo span { color: var(--accent2); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 14px; color: var(--text-muted); transition: color 0.15s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.btn-nav {
  padding: 7px 16px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-nav:hover { background: var(--accent-h); text-decoration: none !important; }

/* ── Auth: loading + login states ───────────────────────────────────────── */
#state-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#state-login {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-card h1 {
  font-size: 22px; font-weight: 800; color: #fff;
  margin-bottom: 10px; letter-spacing: -0.3px;
}
.login-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.6; }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 20px;
  background: #fff; color: #333; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; font-family: inherit;
}
.btn-google:hover { background: #f0f0f0; }
.btn-google:disabled { opacity: 0.6; cursor: default; }
.g-icon { width: 18px; height: 18px; flex-shrink: 0; }
.login-error {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(239,83,80,0.1); border: 1px solid rgba(239,83,80,0.3);
  border-radius: 6px; font-size: 13px; color: #f88; text-align: center;
}

/* ── App footer ─────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.footer-links {
  display: flex; justify-content: center; gap: 24px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.footer-links a { font-size: 13px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { font-size: 12px; color: var(--text-dim); }

/* ── Ads ────────────────────────────────────────────────────────────────────── */
.ad-inline {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

.ad-sidebar {
  position: fixed;
  left: calc(50% + 500px); /* 480px = half of 960px content max-width, +20px gap */
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  z-index: 10;
  display: none;
}

@media (min-width: 1640px) {
  .ad-sidebar { display: block; }
}
