:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.55;
}
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; margin: 18px 0 6px; }
h2 { font-size: 21px; margin: 28px 0 10px; }
h3 { margin: 6px 0; }

/* Topbar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); }
.nav { display: flex; align-items: center; gap: 18px; }
.nav-user { color: var(--muted); font-size: 14px; }

/* Buttons */
.btn {
  display: inline-block; background: var(--blue); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.btn-ghost:hover { background: #eff6ff; }

/* Hero */
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: 38px; }
.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.hero-actions { margin-top: 18px; display: flex; gap: 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 28px 0; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h3, .card h4 { margin-top: 6px; }
.card-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Pills + badges */
.pill { display: inline-block; background: #eff6ff; color: var(--blue-dark); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.pill-soft { background: #f1f5f9; color: var(--muted); }
.badge { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--muted); }
.badge-pass { background: #dcfce7; color: var(--green); }
.badge-ok { background: #fef9c3; color: var(--amber); }
.badge-fail { background: #fee2e2; color: var(--red); }

/* Stats */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 18px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 22px; min-width: 150px; }
.stat-num { display: block; font-size: 30px; font-weight: 700; color: var(--blue-dark); }
.stat-label { color: var(--muted); font-size: 13px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); }

/* Readiness bars */
.readiness { margin: 10px 0; font-size: 13px; }
.readiness-bar, .mini-bar { background: #eef2f7; border-radius: 999px; height: 10px; overflow: hidden; }
.readiness-fill { background: var(--blue); height: 100%; }
.mini-bar { width: 120px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-fill { height: 100%; }
.status-strong { background: var(--green); }
.status-passing { background: var(--amber); }
.status-needs-work { background: var(--red); }
.domain-table td { vertical-align: middle; }

/* Forms / auth */
.auth-card { max-width: 380px; margin: 30px auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px; }
.auth-card label { display: block; margin: 12px 0 4px; font-size: 14px; font-weight: 600; }
.input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.checkbox { font-weight: 400 !important; }
.field-error { color: var(--red); font-size: 12px; }

/* Flashes */
.flashes { margin: 16px 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.flash-success { background: #dcfce7; color: var(--green); }
.flash-danger { background: #fee2e2; color: var(--red); }
.flash-warning { background: #fef9c3; color: var(--amber); }
.flash-info { background: #e0f2fe; color: #0369a1; }

/* Quiz taking */
.question-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 14px 0; }
.question-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qnum { font-weight: 700; color: var(--blue-dark); }
.question-text { font-size: 16px; font-weight: 500; }
.options { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.option:hover { background: #f8fafc; }
.submit-bar { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; display: flex; align-items: center; gap: 14px; }

/* Results */
.result-banner { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: 12px; margin: 16px 0; }
.result-pass { background: #dcfce7; }
.result-fail { background: #fee2e2; }
.result-score { font-size: 44px; font-weight: 800; }
.review-options { list-style: none; padding: 0; }
.review-options li { padding: 8px 12px; border-radius: 8px; margin: 4px 0; background: #f8fafc; }
.opt-correct { background: #dcfce7 !important; }
.opt-wrong { background: #fee2e2 !important; }
.explanation { background: #f1f5f9; border-radius: 8px; padding: 10px 12px; font-size: 14px; }

.callout { background: #e0f2fe; color: #0369a1; padding: 12px 16px; border-radius: 10px; margin: 14px 0; }
.callout-warn { background: #fef9c3; color: var(--amber); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auth-card-wide { max-width: 560px; margin: 16px 0; }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.form-row { display: flex; gap: 14px; }
.form-row label { flex: 1; }

/* Inline form buttons styled as links */
.link-btn, .link-danger {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--blue); text-decoration: none;
}
.link-btn:hover, .link-danger:hover { text-decoration: underline; }
.link-danger { color: var(--red); }

/* Email verification banner */
.verify-bar {
  background: #fef9c3; color: var(--amber); border: 1px solid #fde68a;
  border-radius: 8px; padding: 10px 14px; margin: 14px 0; font-size: 14px;
}
.verify-bar a { font-weight: 600; }

.assignment-card { border-left: 3px solid var(--blue); }
.meta-list { list-style: none; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); }
.cat-heading { color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: .05em; margin-top: 18px; }
.cert-block { margin: 24px 0; }
.back-link { display: inline-block; margin: 14px 0; font-size: 14px; }
.error-page { text-align: center; padding: 60px 0; }
.error-page h1 { font-size: 64px; color: var(--blue); }
.footer { margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
