/* CODITECT WPP — DA8 / Draper Associates assessment site
   Light default; .dark on <html> flips the custom properties. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e6ec;
  --text: #1a1f29;
  --text-muted: #5a6573;
  --accent: #1f6feb;
  --accent-2: #7c3aed;
  --good: #1a7f47;
  --warn: #b7791f;
  --bad: #c0392b;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
  --radius: 10px;
  --maxw: 980px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html.dark {
  --bg: #0e1117;
  --surface: #161b22;
  --surface-2: #1c232d;
  --border: #2a313c;
  --text: #e6edf3;
  --text-muted: #97a3b3;
  --accent: #58a6ff;
  --accent-2: #bc8cff;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.site-header__logo { height: 34px; width: auto; }
.site-header__title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.site-header__subtitle { font-size: 12px; color: var(--text-muted); }
.site-header__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-header__actions a { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.site-header__actions a.active, .site-header__actions a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle::before { content: "\263E"; }      /* moon (light mode → offer dark) */
html.dark .theme-toggle::before { content: "\2600"; } /* sun */

/* ---------- Layout ---------- */
.site-main { display: flex; flex-direction: column; min-height: calc(100vh - 60px); }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 64px; flex: 1; }

/* ---------- Typography ---------- */
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 16px; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.lede { font-size: 17px; color: var(--text-muted); margin-bottom: 24px; }
.muted { color: var(--text-muted); }
small, .small { font-size: 12.5px; color: var(--text-muted); }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 90%; }

/* ---------- Cards / sections ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin: 0 0 18px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat__value { font-size: 24px; font-weight: 700; }
.stat__label { font-size: 12.5px; color: var(--text-muted); }

.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.pill.good { color: var(--good); border-color: var(--good); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.bad  { color: var(--bad);  border-color: var(--bad); }
.pill.accent { color: var(--accent); border-color: var(--accent); }

.banner {
  border-left: 4px solid var(--accent); background: var(--surface-2);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 18px; font-size: 14px;
}
.banner.internal { border-left-color: var(--warn); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 18px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { margin: 0; }

/* ---------- Forms ---------- */
.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
input[type=text], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-family: var(--sans); font-size: 14px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; background: var(--surface);
}
.radio-row input { accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 11px 20px; font-size: 15px; font-weight: 600; font-family: var(--sans);
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.form-status { font-size: 14px; margin-top: 12px; min-height: 20px; }
.form-status.ok { color: var(--good); }
.form-status.err { color: var(--bad); }

/* ---------- Footnotes / sources ---------- */
.sources { font-size: 12.5px; color: var(--text-muted); }
.sources li { margin-bottom: 4px; word-break: break-word; }
sup a { font-size: 11px; padding: 0 1px; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; color: var(--text-muted);
}
.site-footer__left { display: flex; align-items: center; gap: 10px; }
.site-footer__logo { height: 20px; opacity: .85; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 380px; text-align: center; }
.login-card img { height: 40px; margin-bottom: 14px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border); border-radius: 14px; padding: 28px 28px 24px; margin-bottom: 24px; }
.hero h1 { font-size: 30px; }
.nav-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 720px) { .nav-cards { grid-template-columns: 1fr; } }
.nav-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); box-shadow: var(--shadow); }
.nav-card:hover { border-color: var(--accent); text-decoration: none; }
.nav-card h3 { margin: 6px 0; }
.nav-card .pill { margin-bottom: 8px; }

/* ---------- Narrative / pull-quote ---------- */
.hero-tag { font-size: 19px; font-weight: 700; line-height: 1.3; margin: 0 0 10px; color: var(--text); }
.hero-tag em { color: var(--accent); font-style: normal; }

.pullquote {
  border-left: 4px solid var(--accent-2); padding: 14px 20px; margin: 0 0 22px;
  background: var(--surface-2); border-radius: 0 10px 10px 0;
  font-size: 20px; font-weight: 700; line-height: 1.3;
}
.pullquote span { display: block; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }

.narrative {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 22px 24px; margin: 0 0 20px; box-shadow: var(--shadow);
}
.narrative .kicker { font-size: 22px; font-weight: 800; line-height: 1.25; margin: 0 0 12px; }
.narrative p { font-size: 15px; }
.narrative .ask { margin: 14px 0; padding-left: 4px; list-style: none; }
.narrative .ask li { padding: 7px 0 7px 30px; position: relative; font-size: 15px; border-bottom: 1px solid var(--border); }
.narrative .ask li:last-child { border-bottom: none; }
.narrative .ask li::before {
  content: "?"; position: absolute; left: 0; top: 7px; width: 20px; height: 20px;
  background: var(--accent); color: #fff; border-radius: 50%; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.narrative .closer { font-weight: 700; font-size: 16px; color: var(--text); margin-bottom: 0; }
