/* ========================================
   Auth+ Stylesheet — clean & minimal
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ap: #4f46e5;
  --ap-hover: #4338ca;
  --ap-light: #eef2ff;
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 10px;
}

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

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

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* Nav */
.nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
}
.nav-brand {
  font-size: 20px; font-weight: 700; color: var(--ap);
  text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 8px; font-size: 14px;
  font-weight: 500; border: none; cursor: pointer;
  transition: all 0.15s ease; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ap); color: #fff; }
.btn-primary:hover { background: var(--ap-hover); }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-social {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  width: 100%; padding: 10px 16px; gap: 10px; margin-bottom: 8px;
}
.btn-social:hover { background: var(--bg); }
.btn-social img { width: 20px; height: 20px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: #fff; color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--ap); box-shadow: 0 0 0 3px var(--ap-light); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hidden { display: none; }

/* Alert */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Hero */
.hero {
  padding: 80px 0; text-align: center;
}
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.1; margin-bottom: 16px; }
.hero h1 span { color: var(--ap); }
.hero p { font-size: 18px; color: var(--muted); max-width: 550px; margin: 0 auto 32px; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 40px 0; }
.feature-card { padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--muted); }
.feature-icon { font-size: 28px; margin-bottom: 12px; }

/* Code block */
.code-block {
  background: #1e1e2e; color: #cdd6f4; padding: 20px; border-radius: 8px;
  font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 13px;
  overflow-x: auto; line-height: 1.7; margin-top: 8px;
}

/* App list */
.app-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); margin-bottom: 10px; transition: box-shadow 0.15s;
}
.app-row:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.app-name { font-weight: 600; font-size: 15px; }
.app-key { font-size: 12px; color: var(--muted); font-family: monospace; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab.active { color: var(--ap); border-bottom-color: var(--ap); }

/* Toggle */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.toggle-label { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.toggle {
  width: 44px; height: 24px; border-radius: 12px; background: #d1d5db;
  position: relative; cursor: pointer; transition: background 0.2s; border: none;
}
.toggle.on { background: var(--ap); }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(20px); }

/* User table */
.user-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.user-table th {
  text-align: left; padding: 10px 12px; font-weight: 600; font-size: 12px;
  text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--border);
}
.user-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.user-table tr:hover td { background: var(--bg); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 9999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-email { background: #dbeafe; color: #1d4ed8; }
.badge-google { background: #fef3c7; color: #b45309; }
.badge-github { background: #f3f4f6; color: #374151; }

/* Auth page (end-user facing) */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--bg);
}
.auth-box {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 40px 32px; box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.auth-logo { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 20px; }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  font-size: 12px; color: var(--muted);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 768px) {
  .features { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
