:root {
  --bg1: #eef2ff; --bg2: #faf5ff;
  --card: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e6e8f0;
  --accent: #6366f1; --accent2: #8b5cf6; --accent-ink: #ffffff;
  --field: #f8fafc; --ring: rgba(99, 102, 241, .32);
  --shadow: 0 24px 60px -24px rgba(30, 27, 75, .35);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg1: #0b1020; --bg2: #160f2b;
    --card: #141a2b; --ink: #e8ebf4; --muted: #94a3b8; --line: #29314c;
    --accent: #818cf8; --accent2: #a78bfa; --accent-ink: #0b1020;
    --field: #0f1626; --ring: rgba(129, 140, 248, .38);
    --shadow: 0 28px 70px -28px rgba(0, 0, 0, .65);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1100px 560px at 8% -12%, var(--bg2), transparent 60%),
    radial-gradient(900px 480px at 112% 8%, var(--bg1), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 30px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 22px -6px var(--ring);
}
.brand b { font-size: 15px; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

.auth-card h1 { font-size: 22px; margin: 4px 0 4px; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--field); color: var(--ink); font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }

.btn {
  width: 100%; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 650;
  cursor: pointer; border: 1px solid transparent; display: flex; align-items: center;
  justify-content: center; gap: 10px; transition: filter .15s, border-color .15s;
}
.btn-primary {
  color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 14px 26px -12px var(--ring); margin-top: 6px;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-oauth { background: var(--field); border-color: var(--line); color: var(--ink); margin-top: 10px; font-weight: 600; }
.btn-oauth:hover { border-color: var(--accent); text-decoration: none; }
.btn-oauth svg { width: 18px; height: 18px; flex: 0 0 auto; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.foot { margin-top: 20px; font-size: 13.5px; color: var(--muted); text-align: center; }
.tag-soon {
  font-size: 10px; background: var(--line); color: var(--muted);
  padding: 2px 7px; border-radius: 20px; margin-left: auto; font-weight: 600;
}

/* ---------- Landing ---------- */
.hero { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.hero-inner { max-width: 520px; }
.hero .logo-lg {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 20px;
  color: #fff; font-weight: 800; font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 18px 40px -14px var(--ring);
}
.hero h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: -.5px; }
.hero p { color: var(--muted); font-size: 16px; margin: 0 0 26px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-inline { display: inline-flex; width: auto; padding: 12px 22px; }

/* ---------- Generic page (notes / privacy / terms) ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 48px 20px; }
.page .card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; box-shadow: var(--shadow); }
.page h1 { margin-top: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar .brand { margin: 0; }
.spacer { flex: 1; }
.btn-ghost {
  display: inline-flex; width: auto; padding: 9px 15px; background: var(--field);
  border: 1px solid var(--line); color: var(--ink); border-radius: 10px; font-weight: 600;
  font-size: 13.5px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }
.pill { display: inline-block; background: var(--field); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; color: var(--muted); }
code { background: var(--field); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- Alerts / OTP ---------- */
.alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.alert-ok { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.alert-err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.otp-input { text-align: center; letter-spacing: .5em; font-size: 20px; font-weight: 700; }
.sess-list { list-style: none; padding: 0; margin: 14px 0 0; }
.sess-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sess-list li:last-child { border-bottom: none; }
@media (prefers-color-scheme: dark) {
  .alert-ok { background: #0b2e22; color: #34d399; border-color: #134e3a; }
  .alert-err { background: #3a1616; color: #f87171; border-color: #5b1d1d; }
}
