/* Get the Hour Back – course app. Colours and type from the chosen Option A design. */
:root {
  --accent: #F26B1D;
  --accent-soft: #FDE3D2;
  --ink: #1F1A17;
  --muted: #5F5853;
  --line: #F1E4DA;
  --cream: #FFF8F3;
  --link: #B4460A;
  --good: #1F7A4D; --good-bg: #E7F5EC;
  --bad: #B42318;  --bad-bg: #FDECEA;
  --radius: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Poppins, system-ui, -apple-system, sans-serif; color: var(--ink); background: #fff; font-size: 15px; line-height: 1.6; }
a { color: var(--link); }
a:hover { color: #8A3507; }
h1, h2, h3 { line-height: 1.25; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
form.inline { display: inline; margin: 0; }

/* ---------- Top bar ---------- */
.topbar { background: var(--accent); padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: .5px; color: #fff; text-decoration: none; }
.wordmark:hover { color: #fff; }
.wordmark .pill { background: #fff; color: var(--ink); border-radius: 999px; padding: 2px 12px; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.topnav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; padding: 10px 14px; border-radius: 999px; }
.topnav a.on { background: rgba(255,255,255,.9); }
.avatar { width: 44px; height: 44px; border-radius: 999px; border: none; background: var(--ink); color: #fff; font: 700 15px Poppins, sans-serif; cursor: pointer; margin-left: 4px; }

.flash { margin: 16px auto 0; max-width: 1100px; padding: 12px 18px; border-radius: 12px; background: var(--good-bg); color: var(--ink); font-weight: 500; }
.flash.warn { background: var(--bad-bg); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font: 600 14px Poppins, sans-serif; text-decoration: none; cursor: pointer; border: 2px solid transparent; }
.btn.primary { background: var(--accent); color: var(--ink); font-weight: 700; }
.btn.primary:hover { background: #E85D04; color: var(--ink); }
.btn.outline { background: #fff; border-color: var(--ink); color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.wide { width: 100%; margin-top: 18px; }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

/* ---------- Cards and forms ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.tint { background: var(--cream); }
.label { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--link); }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text], input:not([type]) { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #D9CBC0; border-radius: 12px; font: 15px Poppins, sans-serif; color: var(--ink); background: #fff; }
input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.error { color: var(--bad); background: var(--bad-bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.notice { background: var(--good-bg); padding: 10px 14px; border-radius: 10px; }

/* ---------- Login screens ---------- */
.auth { min-height: calc(100vh - 160px); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; background: var(--cream); }
.auth .card { width: 100%; max-width: 420px; padding: 32px; box-shadow: 0 8px 30px rgba(31,26,23,.06); border-radius: 22px; }
.auth h1 { margin: 0 0 6px; font-size: 26px; }

/* ---------- Classroom ---------- */
.classroom { display: flex; flex-wrap: wrap; align-items: stretch; }
.sidebar { flex: 1 1 300px; max-width: 360px; background: var(--cream); border-right: 1px solid var(--line); }
.sidebar-inner { padding: 24px 20px; }
.sidebar-toggle { display: none; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.course-title { margin: 0 0 16px; font-size: 19px; }
.progress-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 26px; }
.bar > div, .q-bar { height: 100%; background: var(--accent); transition: width .3s; }
.bar.thin { height: 6px; margin-bottom: 24px; }
.module { margin-bottom: 18px; }
.module-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.module-head h3 { margin: 0; font-size: 14px; }
.module-head span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.module ul { list-style: none; margin: 0; padding: 0; }
.lesson-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 10px; font-size: 13px; color: var(--ink); text-decoration: none; }
a.lesson-link:hover { background: #FBEDE3; color: var(--ink); }
.lesson-link .num { color: var(--muted); min-width: 26px; }
.lesson-link .t { flex: 1; }
.lesson-link .soon { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; background: #fff; }
.lesson-link.current { background: var(--accent-soft); font-weight: 600; }
.lesson-link.locked { color: #8C827B; }
.status-icon { flex: none; width: 18px; height: 18px; border-radius: 999px; border: 2px solid #A89D95; }
.done .status-icon { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F1A17' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat; }
.current .status-icon { border-color: var(--link); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l8 5-8 5z' fill='%23B4460A'/%3E%3C/svg%3E") center/12px no-repeat; }
.locked .status-icon { border-style: dashed; }

.lesson { flex: 999 1 560px; min-width: 0; padding: 28px 36px 48px; }
.lesson-inner { max-width: 860px; }
.crumb { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.player { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border-radius: 18px; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; }
.player-placeholder p { margin: 4px 0; font-weight: 600; }
.mini-mark { position: absolute; top: 18px; left: 22px; font-weight: 800; font-size: 13px; opacity: .85; }
.mini-mark span { background: var(--accent); color: var(--ink); border-radius: 999px; padding: 1px 8px; }
.lesson-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin: 22px 0 6px; }
.lesson-head h1 { margin: 0; font-size: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.badge.done { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--good-bg); color: var(--good); font-weight: 700; font-size: 13px; }
.summary { margin: 0 0 20px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.prose p { margin: 0 0 14px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.prompt { margin: 0 0 16px; white-space: pre-wrap; word-wrap: break-word; font: 14px/1.6 Poppins, sans-serif; }
.prompt-list { display: grid; gap: 16px; }
.dl { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.locked-card { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; padding: 36px; }
.locked-card h1 { margin-top: 0; }

/* ---------- Quiz ---------- */
.quiz-page { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }
.quiz-page h1 { margin: 0 0 22px; font-size: 28px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 14px; }
.quiz-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: 0 8px 30px rgba(31,26,23,.06); }
.q-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; gap: 8px; }
.q-text { margin: 0 0 18px; font-size: 20px; line-height: 1.4; }
.q-text:focus, .r-title:focus { outline: none; }
.options { display: flex; flex-direction: column; gap: 12px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; text-align: left; font: 500 15px Poppins, sans-serif; color: var(--ink); cursor: pointer; }
.opt:disabled { cursor: default; }
.opt .letter { flex: none; width: 30px; height: 30px; border-radius: 999px; background: #F7EEE7; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.opt .otext { flex: 1; }
.opt .mark { font-size: 13px; font-weight: 700; }
.opt.sel { border-color: var(--ink); background: #FFF1E7; }
.opt.sel .letter { background: var(--ink); color: #fff; }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.right .letter { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 14px; }
.feedback.good { background: var(--good-bg); }
.feedback.bad { background: var(--bad-bg); }
.feedback p { margin: 0; font-size: 14px; }
.feedback .fb-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.q-actions, .r-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; margin-top: 22px; }
.r-screen { text-align: center; }
.r-actions { justify-content: center; }
.ring { display: block; margin: 0 auto 14px; }
.ring-text { font: 800 30px Poppins, sans-serif; fill: var(--ink); }
.r-title { margin: 0 0 8px; font-size: 26px; }
.r-text { max-width: 460px; margin: 0 auto; }

/* ---------- Plain pages (downloads, admin) ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 28px 16px 48px; }
.page h1 { margin-top: 0; }
.file-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--cream); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0 26px; }
.stat strong { display: block; font-size: 28px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }

.foot { text-align: center; padding: 24px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .sidebar { max-width: none; flex-basis: 100%; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-inner { padding: 0; }
  .sidebar-inner[open] { padding-bottom: 16px; }
  .sidebar-toggle { display: flex; align-items: center; min-height: 52px; padding: 0 16px; font-weight: 700; cursor: pointer; }
  .sidebar-inner > :not(summary) { margin-left: 16px; margin-right: 16px; }
  .lesson { padding: 18px 16px 40px; }
  .lesson-head h1 { font-size: 23px; }
  .cards, .two-col { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; }
  .wordmark { font-size: 16px; }
  .quiz-card { padding: 20px; }
  .q-actions .btn { width: 100%; }
}
