:root {
  color-scheme: light;

  /* Review My eLearning brand */
  --brand-blue: #2196f3;
  --brand-blue-deep: #0378b8;
  --brand-green: #6bab3a;
  --brand-purple: #8e1b6e;

  --page: #f7f8fa;
  --surface-1: #ffffff;
  --text-primary: #111827;
  --text-secondary: #475569;
  --muted: #7c8899;
  --gridline: #e8ecf1;
  --baseline: #cbd5e1;
  --border: rgba(17, 24, 39, 0.1);

  /* Sequential ramp for score meters, validated against the light surface. */
  --track: #e8ecf1;
  --fill-low: #86b6ef;
  --fill-mid: #3987e5;
  --fill-high: #1c5cab;

  /* Status palette: fixed, never themed. Always paired with an icon and label. */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 16px 64px;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 880px;
  margin: 0 auto;
}

/* Masthead ---------------------------------------------------------------- */

.masthead {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand img {
  display: block;
  width: 280px;
  height: auto;
}

.masthead-cta {
  color: var(--brand-green);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.masthead-cta:hover {
  text-decoration: underline;
}

/* Intro ------------------------------------------------------------------- */

.intro {
  padding: 24px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-green) 14%, transparent);
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lede {
  margin: 0;
  color: var(--text-secondary);
  max-width: 62ch;
}

/* Upload ------------------------------------------------------------------ */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.dropzone {
  border: 2px dashed var(--baseline);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  background: var(--surface-1);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.dragover {
  border-color: var(--brand-blue);
  background: color-mix(in srgb, var(--brand-blue) 6%, var(--surface-1));
}

.dropzone p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand-blue);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--brand-blue-deep);
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

#choose {
  background: transparent;
  color: var(--brand-blue);
  border-color: currentColor;
}

#choose:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-blue) 8%, transparent);
  color: var(--brand-blue-deep);
}

.filename {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.status {
  padding: 16px 0;
  color: var(--text-secondary);
}

.error {
  color: var(--critical);
  font-weight: 600;
}

/* Report header ----------------------------------------------------------- */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-number {
  margin: 0;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-number .unit {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 4px;
  letter-spacing: 0;
}

.hero-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.meta {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--page);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.badge .icon {
  font-weight: 700;
}

/* Findings ---------------------------------------------------------------- */

h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
  margin: 32px 0 12px;
}

.finding {
  padding: 16px 0;
  border-top: 1px solid var(--gridline);
}

.finding:first-child {
  border-top: none;
}

.finding-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.finding-label {
  font-weight: 600;
}

.finding-value {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  white-space: nowrap;
}

.meter {
  margin-top: 10px;
  height: 8px;
  background: var(--track);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 4px;
}

.level {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.flag {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 3px solid var(--warning);
  padding-left: 10px;
}

.dist {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.dist li {
  display: grid;
  grid-template-columns: minmax(120px, 30%) 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.dist .name {
  color: var(--text-secondary);
}

.dist .bar {
  height: 8px;
  background: var(--track);
  border-radius: 4px;
  overflow: hidden;
}

.dist .bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--fill-low);
}

.dist li.selected .bar span {
  background: var(--fill-high);
}

.dist li.selected .name {
  color: var(--text-primary);
  font-weight: 600;
}

.dist .pct {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--gridline);
}

th {
  color: var(--muted);
  font-weight: 600;
}

td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 0;
}

details {
  margin-top: 24px;
}

summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-blue);
  background: var(--page);
  color: var(--text-secondary);
  font-size: 14px;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--gridline);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer a {
  color: var(--brand-blue);
  font-weight: 600;
}

@media (max-width: 640px) {
  h1 {
    font-size: 30px;
  }

  .brand img {
    width: 220px;
  }

  .hero {
    gap: 16px 28px;
  }

  .dist li {
    grid-template-columns: minmax(90px, 40%) 1fr auto;
  }
}
