/* Layout: one centred column; quiz cards on the home page, status then tables on the parents page */
/* Theme: always white, like the quiz pages, whatever the viewer's light/dark setting */
:root {
  color-scheme: light;
  --bg: #ffffff; --ink: #1f2733; --muted: #5a6779; --line: #dfe4ec;
  --accent: #2348a8; --accent-soft: #e6ecfb;
  --good: #1b7a4a; --good-soft: #def3e7; --bad: #b3261e; --bad-soft: #fbe3e1; --warn: #8a5a00; --warn-soft: #fbefd5;
  --font-display: "Fredoka", "Avenir Next", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(30px, 6vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:is(a, button, input, select, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 14px; }
.ok-msg { background: var(--good-soft); color: var(--good); border-radius: 10px; padding: 10px 14px; }

.topnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.topnav .brand { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); text-decoration: none; }
.topnav nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.linkish { background: none; border: none; padding: 4px 0; color: var(--accent); font-weight: 700; cursor: pointer; }
.topnav a { font-weight: 700; text-decoration: none; padding: 4px 0; }

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 16px 64px; display: flex; flex-direction: column; gap: 22px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.btn { border: none; border-radius: 10px; padding: 12px 20px; font-weight: 800; cursor: pointer; background: var(--accent); color: #fff; text-decoration: none; display: inline-block; text-align: center; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
input[type=text], input[type=password] { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 500; }

/* Login */
.login { max-width: 400px; margin: 0 auto; padding: 56px 16px; display: flex; flex-direction: column; gap: 18px; }
.login form { display: flex; flex-direction: column; gap: 14px; }

/* Home */
.quizzes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.quiz { border-top: 6px solid var(--c, var(--accent)); }
.quiz .subject { font-size: 14px; font-weight: 800; color: var(--c, var(--accent)); }
.quiz .btn { background: var(--c, var(--accent)); margin-top: auto; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--c, var(--accent)); }
.lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.lessons li { display: flex; justify-content: space-between; gap: 12px; }
.lessons .sc { white-space: nowrap; font-weight: 800; font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; font-weight: 700; font-size: 15px; color: var(--muted); }
details .lessons { margin-top: 8px; }

/* Parents */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.status { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.dot { width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--muted); }
.status.active .dot { background: var(--good); box-shadow: 0 0 0 6px var(--good-soft); }
.status.background .dot { background: var(--warn); box-shadow: 0 0 0 6px var(--warn-soft); }
.status .big { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.status .detail { flex: 1 1 260px; min-width: 0; }
.daynav { display: flex; gap: 6px; align-items: center; }
.daynav button, .filters button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.daynav button[disabled] { opacity: .4; cursor: default; }
.daynav .label { min-width: 120px; text-align: center; font-weight: 700; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border-radius: 999px; font-size: 15px; }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { gap: 2px; padding: 14px 16px; }
.tile .num { font-family: var(--font-display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 800; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.pill { font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.ko { background: var(--bad-soft); color: var(--bad); }
.pill.run { background: var(--accent-soft); color: var(--accent); }
.pill.left { background: var(--warn-soft); color: var(--warn); }
.pill.none { background: #eef1f5; color: var(--muted); }
.subj { font-size: 13px; color: var(--muted); font-weight: 700; }
.empty { color: var(--muted); padding: 8px 0; }
.pwform { display: flex; flex-direction: column; gap: 12px; max-width: 400px; }
