/* QuizMyBook production styles: logo palette and the pieces the old beta didn't have. */
.portal {
  --school-primary: #0b4f9c; /* logo blue */
  --school-accent: #2f7d14;  /* darker logo green, readable as a button color */
  --qmb-yellow: #f5b21b;
  --qmb-green: #5ba521;
  display: flex;
  flex-direction: column;
}
.portal .content { flex: 1; width: min(1160px, 100%); }

/* Header: white bar so the colored logo reads well */
.topbar { background: #fff; color: #172033; border-bottom: 1px solid #dfe5ed; }
.brand { color: inherit; text-decoration: none; }
.logoMark { width: 54px; height: 45px; }
.wordmark {
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Varela Round", system-ui, sans-serif;
  font-weight: 900; font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -.01em; color: var(--school-primary); line-height: 1;
}
.wmMy { color: var(--qmb-yellow); }
.wmBook { color: var(--qmb-green); }
.wmCom { font-size: .6em; }
.brandText small { display: block; color: #647087; font-size: 12px; font-weight: 600; margin-top: 4px; }
.topActions { display: flex; align-items: center; gap: 10px; }

/* Hero uses the logo blue with a hint of green */
.hero { background: linear-gradient(120deg, #0b4f9c, #1d6fc4); }
.hero .streak strong { color: #fff; }

/* Student "my book" card */
.myBook { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; }
.myBook img { width: 64px; height: 96px; object-fit: cover; border-radius: 6px; box-shadow: 0 1px 4px #0002; }
.myBook .miniCover { width: 64px; height: 96px; border-radius: 6px; }
.myBook h2 { margin: 6px 0 2px; }
.myBook .actions { display: grid; gap: 8px; justify-items: end; }
.badge.quiz { background: #e7f4dc; color: #2a6a10; }
.book .secondary[aria-pressed="true"] { background: var(--school-accent); }

/* Name prompt + login cards */
.nameCard, .loginCard { max-width: 480px; margin: 30px auto; background: #fff; border: 1px solid #dfe5ed; border-radius: 15px; padding: 26px; }
.nameCard h1, .loginCard h1 { margin: 6px 0 8px; font-size: 26px; }
.nameCard form, .loginCard form { display: grid; gap: 14px; margin-top: 16px; }
.nameCard label, .loginCard label { display: grid; gap: 6px; font-size: 13px; color: #647087; font-weight: 600; }
.nameCard input, .loginCard input { border: 1px solid #c9d3e0; border-radius: 10px; padding: 12px 14px; font-size: 17px; color: #172033; background: #fff; }
.nameCard input:focus, .loginCard input:focus { outline: 3px solid #b7d4f5; border-color: var(--school-primary); }

/* Teacher dashboard bits */
.saveState { font-size: 13px; color: #647087; min-height: 20px; }
.saveState.ok { color: #126342; }
.saveState.bad { color: #b42318; }
.panelHead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panelHead h2 { margin: 0; }
.panelHead select { border: 1px solid #dfe5ed; border-radius: 9px; padding: 8px 10px; background: #fff; }
.resultsTable td.scoreCell { font-weight: 800; }
.scoreCell.good { color: #16845b; }
.scoreCell.mid { color: #a15c00; }
.scoreCell.low { color: #b42318; }
.insight { display: grid; gap: 10px; margin-top: 10px; }
.insight li { display: grid; grid-template-columns: 1fr 160px 48px; gap: 12px; align-items: center; font-size: 14px; }
.bar { height: 10px; background: #e8edf3; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--qmb-green); }
.bar.low span { background: #e5484d; }
.danger { color: #b42318; }

/* Footer */
.siteFooter { border-top: 1px solid #dfe5ed; background: #fff; color: #647087; font-size: 13px; padding: 18px clamp(16px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.siteFooter a { color: var(--school-primary); font-weight: 650; }

@media (max-width: 760px) {
  .myBook { grid-template-columns: 56px 1fr; }
  .myBook .actions { grid-column: 1 / -1; justify-items: stretch; }
  .insight li { grid-template-columns: 1fr 90px 40px; }
}
@media (max-width: 480px) {
  .brandText small { display: none; }
  .logoMark { width: 44px; height: 37px; }
}

.feedbackDialog select { border: 1px solid #dfe5ed; border-radius: 9px; padding: 9px 10px; background: #fff; font: inherit; color: #172033; }
.panel h3 { margin: 18px 0 4px; font-size: 16px; }
.panelHead .saveState { margin: 0; }
/* Keep footer links clear of the floating Feedback button */
.siteFooter { padding-right: 160px; }
@media (max-width: 480px) { .siteFooter { padding-right: 16px; padding-bottom: 80px; } }

/* ---- Added 2026-10-11: read-aloud, pass marks, points, class code, printable result ---- */
.speakButton { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 8px 14px; border: 1px solid #c9d3e0; border-radius: 999px; background: #fff; color: var(--school-primary); font-weight: 700; font-size: 14px; }
.speakButton:hover { background: #eef5fd; }
.resultBadge { display: inline-block; margin: 0 0 10px; padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: 15px; }
.resultBadge.pass { background: #e7f4dc; color: #2a6a10; }
.resultBadge.notYet { background: #fff1d6; color: #7a4a00; }
.quizCard .success { margin: 12px 0 18px; }

/* Teacher dashboard: five stat tiles, class code form, result row actions */
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.gateForm { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 14px; margin-top: 12px; }
.gateForm label { display: grid; gap: 6px; font-size: 13px; color: #647087; font-weight: 600; }
.gateForm .checkLine { display: flex; align-items: center; gap: 8px; flex-basis: 100%; font-size: 15px; color: #172033; }
.gateForm input[name="code"] { border: 1px solid #c9d3e0; border-radius: 10px; padding: 10px 12px; font-size: 16px; width: 170px; text-transform: uppercase; letter-spacing: .08em; color: #172033; }
.gateForm .wide { flex-basis: 100%; margin: 0; }
.rowActions { white-space: nowrap; }
.rowActions .muted { font-size: 13px; }

/* The printable result is hidden on screen and is the only thing on the printed page. */
.printSlip { display: none; }
@media print {
  .topbar, .siteFooter, .feedbackFab, .quizCard, dialog { display: none !important; }
  body, .portal, .portal .content { background: #fff !important; margin: 0; padding: 0; width: auto; }
  .printSlip { display: block; max-width: 6.5in; margin: .6in auto; padding: .5in .6in; text-align: center; color: #172033; border: 2px solid #0b4f9c; border-radius: 14px; font-size: 14pt; }
  .printSlip.certificate { border: 6px double #0b4f9c; padding: .8in .6in; }
  .printSlip h2 { font-size: 24pt; margin: 14pt 0 18pt; color: #0b4f9c; }
  .printSlip .slipBrand { font-size: 11pt; font-weight: 700; letter-spacing: .04em; color: #647087; margin: 0; }
  .printSlip .slipName { font-size: 30pt; font-weight: 800; margin: 6pt 0; }
  .printSlip .slipBook { font-size: 18pt; font-weight: 700; font-style: italic; margin: 6pt 0 14pt; }
  .printSlip .slipScore { font-size: 20pt; font-weight: 800; margin: 8pt 0; }
  .printSlip .slipDate { font-size: 11pt; color: #647087; margin-top: 18pt; }
}
