/* Key Person AI — Application styles */

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

:root {
  --bg-deep: #0a0e27;
  --bg-elev: #ffffff;
  --bg-soft: #f5f7fb;
  --ink: #0a0e27;
  --ink-soft: #4a5478;
  --muted: #7c8db5;
  --line: #e5eaf5;
  --accent: #5b8cff;
  --accent-deep: #3b6cdd;
  --good: #1f9d6a;
  --warn: #c8782a;
  --bad: #c64242;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-soft);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

.brand {
  font-size: .875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.brand-mark {
  font-size: .875rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.muted { color: var(--muted); }

/* ----- Auth pages (login, error, root loading) ----- */

body.auth-page {
  background: var(--bg-deep);
  color: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: left;
}

.auth-card .brand { color: #b8c5e0; margin-bottom: 2rem; }
.auth-card h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
.auth-card .muted { color: #b8c5e0; font-size: 1rem; margin-bottom: 2rem; }
.auth-card label { display: block; font-size: .875rem; font-weight: 500; color: #b8c5e0; margin-bottom: .5rem; }
.auth-card input[type="email"], .auth-card input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  padding: .875rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-family: inherit;
}
.auth-card input:focus { outline: none; border-color: var(--accent); }

/* Buttons */

.button {
  display: inline-block;
  background: #fff;
  color: #0a0e27;
  font-size: 1rem;
  font-weight: 600;
  padding: .875rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: opacity .15s ease;
}
.button:hover { opacity: .9; }
.button:disabled { opacity: .5; cursor: not-allowed; }

.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-deep); }

.link-button {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Auth-page form messages */

.auth-card .message {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: .9375rem;
}
.auth-card .message.success { background: rgba(31, 157, 106, 0.15); color: #6bd9a8; border: 1px solid rgba(31, 157, 106, 0.3); }
.auth-card .message.error { background: rgba(198, 66, 66, 0.15); color: #ff8a8a; border: 1px solid rgba(198, 66, 66, 0.3); }

/* ----- App pages (dashboard, learn, admin) ----- */

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: .9375rem;
}
.topbar-nav a, .topbar-nav .link-button { color: var(--ink-soft); text-decoration: none; }
.topbar-nav a:hover, .topbar-nav .link-button:hover { color: var(--ink); }

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--ink-soft);
}

/* Module list */

.modules-list {
  display: grid;
  gap: .75rem;
}
.module-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease;
}
.module-card:hover { border-color: var(--accent); color: var(--ink); }
.module-card .module-meta { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.module-card .module-num { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5rem; }
.module-card .module-title { font-size: 1rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-card .module-status { font-size: .8125rem; color: var(--muted); flex-shrink: 0; }
.module-card .module-status.completed { color: var(--good); }
.module-card .module-status.in-progress { color: var(--warn); }
