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

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-input: #1a1a1a;
  --border: #262626;
  --text: #e5e5e5;
  --text-muted: #737373;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --error: #f87171;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

/* ── Nav ── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}

.nav-brand {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 2rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.hero-name {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  gap: 1.5rem;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.link:hover { color: var(--accent-hover); }

/* ── Auth ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 360px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
}

.auth-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--error);
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.field input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.auth-back {
  display: block;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.auth-back:hover { color: var(--text); }

/* ── Admin ── */
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-user {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-main {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.admin-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-links {
  margin-bottom: 1rem;
}

.endpoint-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.endpoint-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-code pre {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre;
}

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-input);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--accent);
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .nav, .admin-header { padding: 1rem; }
  .admin-main { padding: 1.5rem 1rem; }
}
