:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #16161d;
  --text-muted: #62626e;
  --border: #e6e6ec;
  --accent-1: #4f46e5;
  --accent-2: #14b8a6;
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --error: #d9376e;
  --success: #0d9488;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(20, 20, 30, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f14;
    --surface: #17171f;
    --text: #f2f2f5;
    --text-muted: #a3a3ae;
    --border: #2a2a35;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-greeting {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-right: 4px;
}

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; text-align: center; border: none; }

/* Hero */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(79, 70, 229, 0.08), transparent 60%);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px 24px 96px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Auth pages */
.auth-section {
  padding: 64px 24px;
  display: flex;
  justify-content: center;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
}

.auth-sub {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 0.95rem;
}

.auth-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 16px 0 6px;
}

.auth-card input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-card .btn-block { margin-top: 26px; }

.field-error {
  color: var(--error);
  font-size: 0.82rem;
  margin: 6px 0 0;
}

.auth-switch {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 18px;
}

.auth-switch a { color: var(--accent-1); font-weight: 600; text-decoration: none; }

/* Flash messages */
.flash-stack {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flash {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.flash-success { border-color: var(--success); color: var(--success); }
.flash-error { border-color: var(--error); color: var(--error); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}
