/* TEST4U web assessment - tokens copied from the app's Theme.Light.xaml / Theme.Dark.xaml */
:root {
  --brand800:#7A3410; --brand700:#98461A; --brand600:#B45A22; --brand500:#D0793E; --brand300:#EDBD9B;
  --brand100:#FBEDE3; --brand50:#FEF8F4; --brandText:#98461A;
  --accent700:#8A5A08; --accent600:#B0790F; --accent500:#D9A320; --accent100:#FBF0D5; --accent50:#FEFAF0;
  --danger:#D92D20; --dangerBg:#FEF3F2; --dangerBd:#FECDCA; --warn:#B0790F; --warnBg:#FBF0D5;
  --ok:#12805A; --okBg:#ECFDF3; --markPass:#5C7CFA;
  --n900:#111927; --n800:#1D2939; --n700:#344054; --n600:#475467; --n500:#667085; --n400:#98A2B3;
  --n300:#D0D5DD; --n200:#E4E7EC; --n100:#F2F4F7; --n50:#F8FAFC;
  --appBg:#F8FAFC; --surface:#FFFFFF; --surface2:#F8FAFC; --paper:#FFFFFF; --paperBorder:#E4E7EC;
  --rowSelectedBg:#F7DFCC;
  --word:#2B579A; --excel:#217346;
  --radius:12px; --shadow:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand100:#3A2415; --brand50:#2A1A0F; --brandText:#EDBD9B;
  --accent600:#D9A320; --accent100:#37290A; --accent50:#281D07;
  --danger:#F97066; --dangerBg:#3A1614; --dangerBd:#5A2320; --warn:#E3B546; --warnBg:#37290A;
  --ok:#7BD1AC; --okBg:#0C2E21; --markPass:#8DA2FB;
  --n900:#F2F4F7; --n800:#E4E9F0; --n700:#C7D0DB; --n600:#A9B4C4; --n500:#8494A8; --n400:#667C96;
  --n300:#2E3E56; --n200:#243247; --n100:#1B2536; --n50:#161F2E;
  --appBg:#0A0F1A; --surface:#111927; --surface2:#161F2E; --paper:#FFFFFF; --paperBorder:#C7D0DB;
  --rowSelectedBg:#3A2415; --word:#7FA6E0; --excel:#6CC496;
  --shadow:0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}
:root[data-large="1"] { font-size: 18px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 0.875rem/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--appBg); color: var(--n900); }
button { font: inherit; cursor: pointer; }
a { color: var(--brandText); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 650; }
.muted { color: var(--n500); }
.hidden { display: none !important; }

/* ---- buttons, chips -------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
  border-radius: 8px; border: 1px solid var(--n300); background: var(--surface); color: var(--n800); font-weight: 600; }
.btn:hover { background: var(--n100); }
.btn.primary { background: var(--brand600); border-color: var(--brand600); color: #fff; }
.btn.primary:hover { background: var(--brand700); border-color: var(--brand700); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--n700); }
.btn.ghost:hover { background: var(--n100); }
.btn.danger { color: var(--danger); border-color: var(--dangerBd); background: transparent; }
.btn.danger:hover { background: var(--dangerBg); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem;
  font-weight: 600; border: 1px solid var(--n200); background: var(--surface); color: var(--n700); white-space: nowrap; }
.chip.ok { background: var(--okBg); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--dangerBg); color: var(--danger); border-color: transparent; }
.chip.warn { background: var(--warnBg); color: var(--warn); border-color: transparent; }
.chip.brand { background: var(--brand100); color: var(--brandText); border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button.chip.on { background: var(--brand100); color: var(--brandText); border-color: var(--brand300); }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--n600); }
.iconbtn:hover { background: var(--n100); color: var(--n900); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---- app shell with left rail (the app's 248px nav) ----------------------------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.nav { background: var(--surface); border-right: 1px solid var(--n200); display: flex; flex-direction: column; padding: 18px 14px; gap: 4px;
  position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 1.25rem; letter-spacing: .3px; color: var(--n900); }
.logo svg { width: 30px; height: 30px; }
.logo small { display: block; font-size: .7rem; font-weight: 600; color: var(--n500); letter-spacing: 0; }
.navitem { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--n700); font-weight: 600;
  border: 0; background: none; text-align: left; width: 100%; }
.navitem svg { width: 20px; height: 20px; color: var(--n500); }
.navitem:hover { background: var(--n100); }
.navitem.on { background: var(--brand100); color: var(--brandText); }
.navitem.on svg { color: var(--brand600); }
.nav .grow { flex: 1; }
.navfoot { border-top: 1px solid var(--n200); padding-top: 10px; display: flex; gap: 4px; align-items: center; }
.main { padding: 28px 32px 48px; max-width: 1180px; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--n200); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .hd { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--n200); flex-wrap: wrap; }
.card .bd { padding: 18px 20px; }

/* hero: start an evaluation */
.hero { padding: 24px; background: linear-gradient(135deg, var(--brand600), var(--brand800)); color: #fff; border: 0; }
.hero h1 { color: #fff; }
.hero p { color: #FBEDE3; margin: 6px 0 18px; max-width: 640px; }
.hero .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.hero label { display: grid; gap: 6px; font-size: .78rem; font-weight: 600; color: #FBEDE3; }
.hero input, .hero select { padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
  color: #fff; font: inherit; min-width: 200px; }
.hero input::placeholder { color: rgba(255,255,255,.65); }
.hero select option { color: #111927; }
.hero .btn.primary { background: #fff; color: var(--brand700); border-color: #fff; }
.hero .segctl { display: inline-flex; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 3px; }
.hero .segctl button { border: 0; background: transparent; color: #fff; padding: 6px 12px; border-radius: 6px; font-weight: 600; }
.hero .segctl button.on { background: #fff; color: var(--brand700); }

/* question browser rows */
.qrow { display: grid; grid-template-columns: 6px 64px 1fr auto auto; gap: 14px; align-items: center; padding: 12px 20px 12px 0;
  border-bottom: 1px solid var(--n100); }
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: var(--surface2); }
.qrow .stripe { align-self: stretch; border-radius: 0 3px 3px 0; }
.qrow .stripe.word { background: var(--word); } .qrow .stripe.excel { background: var(--excel); }
.qid { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--n600); }
.qid small { display: block; font-weight: 600; font-size: .7rem; }
.qid small.word { color: var(--word); } .qid small.excel { color: var(--excel); }
.qtext { color: var(--n800); }
.qtime { color: var(--n500); font-size: .8rem; white-space: nowrap; }

/* ---- test screen: editor + right rail (frmTestBar) ------------------------------------ */
/* layout of frmTestBar: Office area top-left, 272px rail top-right, 95px bar across the bottom */
.runner { display: grid; grid-template-columns: 1fr 272px; grid-template-rows: 1fr 95px; height: 100vh; }
.runner .stage { grid-column: 1; grid-row: 1; }
.runner .rail { grid-column: 2; grid-row: 1; }
.qbar { grid-column: 1 / 3; grid-row: 2; display: grid; grid-template-columns: 92px 1fr auto auto; align-items: stretch;
  background: var(--surface); border-top: 1px solid var(--n200); }
.barlogo { width: 70px; height: 70px; margin: 12px 10px 12px 12px; align-self: center; border-radius: 6px; }
.wording { margin: 10px 12px 10px 0; background: var(--paper); border: 1px solid var(--paperBorder); border-radius: 9px;
  padding: 6px 10px; color: #000; font: 15px/1.35 Arial, sans-serif; overflow-y: auto; }
.wording.big { margin: 0; font-size: 22px; line-height: 1.45; padding: 14px 16px; }
/* Digital Skills multiple choice: the options under the wording (ds.js) */
.dsopts { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.dsopt { display: flex; gap: 6px; align-items: flex-start; padding: 3px 9px; border: 1px solid var(--paperBorder);
  border-radius: 7px; cursor: pointer; background: #fff; }
.dsopt.on { border-color: #2f6fd6; background: #eaf1fd; }
.dsopt input { margin: 3px 0 0; }
/* question_html from the server: <p> blocks (browser default 1em margins pushed the text down) and
   Verdana 10pt spans - the card's own font and size win */
.wording p, .wording ul, .wording ol { margin: 0 0 .35em; }
.wording > :last-child { margin-bottom: 0; }
.wording span[style], .wording font { font-family: inherit !important; font-size: inherit !important; }
.barbtn { width: 45px; height: 35px; margin: 10px 10px 0 0; border: 1px solid var(--n200); border-radius: 8px; background: var(--surface);
  display: grid; place-items: center; cursor: pointer; }
.barbtn:hover { background: var(--n100); }
.barbtn img { width: 24px; height: 24px; }
.railhead .mode { flex: 1; font-size: .72rem; font-weight: 800; letter-spacing: .1em; color: var(--brandText); }
.arrow { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--n700);
  display: grid; place-items: center; padding: 0; }
.arrow:hover:not(:disabled) { background: var(--n100); }
.arrow:disabled { opacity: .35; cursor: default; }
.arrow svg { width: 20px; height: 20px; }
.arrow.next { background: var(--brand600); color: #fff; }
.arrow.next:hover:not(:disabled) { background: var(--brand700); }
.arrow.small { width: 22px; height: 22px; } .arrow.small svg { width: 16px; height: 16px; }
.meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: .75rem; color: var(--n500); font-weight: 600; }
.clock2 { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; font-size: .8rem; color: var(--n600); }
.clock2 i { flex: 1; border-bottom: 1px dashed var(--n300); transform: translateY(-3px); }
.clock2 b { font-variant-numeric: tabular-nums; color: var(--n800); }
.note { margin: 0; font-size: .8rem; color: var(--n600); }
.railbtn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--n200);
  background: var(--surface); color: var(--n800); font-weight: 700; font-size: .78rem; letter-spacing: .06em; }
.railbtn:hover { background: var(--n100); }
.railbtn svg { width: 18px; height: 18px; color: var(--n500); }
.railbtn.end { color: var(--danger); border-color: var(--dangerBd); }
.railbtn.end svg { color: var(--danger); }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.tally b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tally span { font-size: .7rem; color: var(--n500); font-weight: 600; }
/* the three actions the learner uses on every question (cmdUndo, cmdLater, cmdOK) */
.actions { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-width: 330px; background: var(--surface2);
  border-left: 1px solid var(--n200); }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 8px;
  font-weight: 600; border: 1px solid transparent; }
.act svg { width: 15px; height: 15px; }
.act.ghost { background: transparent; color: var(--n700); border-color: var(--n200); }
.act.ghost:hover:not(:disabled) { background: var(--n100); }
.act.primary { flex: 1; min-width: 130px; background: var(--brand600); color: #fff; font-size: .95rem; }
.act.primary svg { width: 17px; height: 17px; stroke-width: 2.6; }
.act.primary:hover:not(:disabled) { background: var(--brand700); }
.act:disabled { opacity: .45; cursor: default; }
.instr { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.stage { position: relative; background: var(--n100); min-width: 0; }
.stage #editor, .stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: var(--appBg); z-index: 5; }
.overlay .box { text-align: center; max-width: 420px; padding: 24px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--n200); border-top-color: var(--brand600);
  animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.rail { background: var(--surface); border-left: 1px solid var(--n200); display: flex; flex-direction: column; overflow-y: auto; }
.railhead { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--n200); }
.railhead .logo { padding: 0; font-size: 1.05rem; flex: 1; }
.railhead .logo svg { width: 24px; height: 24px; }
.railsec { padding: 14px 16px; border-bottom: 1px solid var(--n200); }
.railsec:last-child { border-bottom: 0; }
.sectitle { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--n500); margin-bottom: 8px; }
.qnav { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; text-align: center; }
.qnav b { font-size: 1.05rem; letter-spacing: .02em; }
.segs { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin-top: 10px; }
.seg { height: 8px; border-radius: 2px; background: var(--n200); border: 0; padding: 0; }
.seg.answered { background: var(--n600); }
.seg.skipped { background: var(--accent500); }
.seg.correct { background: var(--ok); } .seg.wrong { background: var(--danger); }
.seg.current { outline: 2px solid var(--brand600); outline-offset: 1px; }
.paper { background: var(--paper); border: 1px solid var(--paperBorder); border-radius: 10px; padding: 14px; color: #111927; font-size: .95rem; }
.paper .app { font-size: .72rem; font-weight: 700; margin-bottom: 6px; }
.paper .app.word { color: #2B579A; } .paper .app.excel { color: #217346; }
.clock { display: flex; justify-content: space-between; align-items: baseline; }
.clock b { font-size: 1.6rem; font-variant-numeric: tabular-nums; font-weight: 650; }
.clock small { color: var(--n500); }
.clock b.late { color: var(--danger); }        /* last minute of a timed evaluation */
.railbtns { display: grid; gap: 8px; }
.feedback { border-radius: 10px; padding: 12px 14px; font-weight: 650; display: flex; gap: 10px; align-items: center; }
.feedback.ok { background: var(--okBg); color: var(--ok); } .feedback.bad { background: var(--dangerBg); color: var(--danger); }
.feedback.warn { background: var(--warnBg); color: var(--warn); }
.feedback small { display: block; font-weight: 500; color: var(--n600); }

/* ---- results (frmResults) ------------------------------------------------------------- */
.results { max-width: 1040px; margin: 0 auto; padding: 28px 24px 96px; display: grid; gap: 18px; }
.verdict { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; padding: 22px; position: relative; overflow: hidden; }
.verdict::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tone); }
.ring { width: 170px; height: 170px; }
.ring text { font: 700 34px "Segoe UI", sans-serif; fill: var(--n900); }
.ring text.sub { font: 600 12px "Segoe UI", sans-serif; fill: var(--n500); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.tile { border: 1px solid var(--n200); border-radius: 10px; padding: 12px; background: var(--surface2); }
.tile small { color: var(--n500); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.tile b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.scale { position: relative; height: 10px; border-radius: 6px; background: var(--n200); margin-top: 14px; }
.scale .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--tone); }
.scale .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--markPass); }
.scale .marklbl { position: absolute; top: 14px; font-size: .7rem; color: var(--markPass); font-weight: 700; transform: translateX(-50%); }
.dist { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--n200); }
.dist span { display: block; height: 100%; }
.legend { display: flex; gap: 16px; margin-top: 10px; color: var(--n600); font-size: .8rem; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rrow { display: grid; grid-template-columns: 6px 40px 1fr 150px 110px; gap: 14px; align-items: center; padding: 12px 20px 12px 0;
  border-bottom: 1px solid var(--n100); }
.rrow:last-child { border-bottom: 0; }
.rrow .stripe { align-self: stretch; border-radius: 0 3px 3px 0; }
.tbar { height: 6px; border-radius: 3px; background: var(--n200); position: relative; margin-top: 4px; }
.tbar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--n200); padding: 12px 24px;
  display: flex; gap: 10px; justify-content: flex-end; z-index: 3; }

/* ---- dialog --------------------------------------------------------------------------- */
dialog { border: 1px solid var(--n200); border-radius: 14px; padding: 0; background: var(--surface); color: var(--n900); width: min(440px, 92vw);
  box-shadow: 0 20px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,15,26,.45); }
dialog .hd { padding: 16px 20px; border-bottom: 1px solid var(--n200); }
dialog .bd { padding: 16px 20px; display: grid; gap: 14px; }
dialog .ft { padding: 12px 20px; border-top: 1px solid var(--n200); display: flex; justify-content: flex-end; gap: 8px; }
dialog label { display: grid; gap: 6px; font-weight: 600; font-size: .85rem; }
dialog select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--n300); background: var(--surface); color: var(--n900); font: inherit; }
dialog .check { display: flex; gap: 10px; align-items: center; font-weight: 500; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .nav .grow { display: none; } .main { padding: 18px 16px 40px; }
  .qrow { grid-template-columns: 6px 54px 1fr; } .qrow .qtime, .qrow .act { grid-column: 3; }
  .verdict { grid-template-columns: 1fr; } .tiles { grid-template-columns: repeat(2, 1fr); }
  .rrow { grid-template-columns: 6px 34px 1fr; } .rrow .rt, .rrow .rc { grid-column: 3; }
}
@media print { .actionbar, .nav { display: none !important; } body { background: #fff; } }
