/* Dental Nurse Mock Exams — styles */
:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --line: #e2e7ec;
  --ink: #0f2233;
  --ink2: #4f5f6c;
  --muted: #8a97a3;
  --teal: #1d6470;
  --teal-d: #154d57;
  --teal-l: #6fbcc6;
  --green: #1f7a45;
  --green-bg: #eaf4ee;
  --amber: #a8650b;
  --amber-bg: #fcf3e2;
  --red: #b83227;
  --red-bg: #fbecea;
  --r: 22px;
  --shadow: 0 2px 12px rgba(15, 34, 51, .06);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
html.large { font-size: 18.5px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.45;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.shell { max-width: 760px; margin: 0 auto; min-height: 100vh; padding: 26px 20px 120px; }
.shell.quiz { padding-bottom: 130px; }
.loading { color: var(--muted); }

/* Headings */
.brand { display: flex; align-items: center; gap: 10px; color: var(--teal); font-weight: 900; font-size: 1.05rem; }
.brand img { width: 30px; height: 30px; }
h1.big { font-size: 2.55rem; line-height: 1.1; font-weight: 900; letter-spacing: -.02em; margin: 14px 0 22px; }
h2 { font-size: 1.4rem; font-weight: 900; margin: 0 0 8px; }
.section-label { font-size: .82rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); margin: 32px 0 14px; }
.hint { color: var(--ink2); margin: -6px 0 16px; }
.small { font-size: .9rem; color: var(--ink2); }
.foot { color: var(--muted); font-size: .9rem; margin-top: 14px; }

/* Cards & lists */
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 20px; }
.list-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 16px 18px; margin-bottom: 12px; background: var(--card);
  border: 0; border-radius: 18px; box-shadow: var(--shadow);
}
.list-card:hover { box-shadow: 0 4px 18px rgba(15, 34, 51, .10); }
.list-card .lc-main { flex: 1; min-width: 0; }
.list-card .lc-title { font-weight: 900; font-size: 1.2rem; line-height: 1.2; }
.list-card .lc-sub { color: var(--ink2); font-size: .92rem; margin-top: 3px; }
.icon-tile {
  width: 52px; height: 52px; border-radius: 13px; flex: none;
  background: linear-gradient(170deg, #6fbcc6 0%, #2c7f8b 100%);
  display: grid; place-items: center;
}
.icon-tile.lg { width: 72px; height: 72px; border-radius: 18px; }
.icon-tile svg { width: 28px; height: 28px; }
.icon-tile.lg svg { width: 38px; height: 38px; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-tile svg { stroke: #fff; }

/* Progress ring */
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring .ring-bg { stroke: #dfe9eb; stroke-width: 7; }
.ring .ring-fg { stroke: var(--teal); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring span { position: relative; font-weight: 900; font-size: .82rem; }
.ring.xl .ring-bg, .ring.xl .ring-fg { stroke-width: 12; }
.ring.xl span { font-size: 2.2rem; }
.ring.empty span { color: var(--muted); }

/* Resume banner */
.resume { background: var(--ink); color: #fff; border-radius: var(--r); padding: 20px; margin-bottom: 8px; }
.resume .r-title { font-weight: 900; font-size: 1.2rem; }
.resume .r-sub { opacity: .75; margin: 2px 0 14px; }
.resume .row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
  padding: 12px 18px; font-weight: 800;
}
.btn:hover:not(:disabled) { border-color: #c5d0d8; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--teal-d); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.light { background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger-fill { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: .45; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--teal); color: #fff; border: 0; border-radius: 999px;
  padding: 17px 40px; font-weight: 900; font-size: 1.1rem; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(29, 100, 112, .3);
}
.pill-btn:hover { background: var(--teal-d); }
.pill-btn svg { width: 22px; height: 22px; }
.center { text-align: center; }
.grow { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--teal); font-weight: 800; padding: 6px 0; }
.back svg { width: 20px; height: 20px; }

/* Segmented control */
.segmented { display: flex; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 5px; margin-bottom: 8px; }
.seg { flex: 1; border: 0; background: none; padding: 13px 10px; border-radius: 13px; font-weight: 900; font-size: 1.1rem; color: var(--ink2); }
.seg small { font-size: .85em; opacity: .7; margin-left: 6px; }
.seg.active { background: var(--ink); color: #fff; }

/* Topic tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--green-bg); border-radius: 14px; padding: 16px 16px 14px; min-height: 104px; }
.tile .pct { font-size: 1.7rem; font-weight: 900; color: var(--green); line-height: 1.1; }
.tile .tname { font-weight: 700; margin-top: 4px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .tcount { font-size: .8rem; color: var(--ink2); margin-top: 4px; }
.tile.mid { background: var(--amber-bg); } .tile.mid .pct { color: var(--amber); }
.tile.low { background: var(--red-bg); } .tile.low .pct { color: var(--red); }
.tile.none { background: #eceff2; } .tile.none .pct { color: var(--muted); }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } h1.big { font-size: 2.1rem; } }

/* Accordion rows (topics / review) */
.acc { background: #fff; border: 1.5px solid var(--line); border-radius: 20px; margin-bottom: 12px; overflow: hidden; }
.acc-head { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; padding: 20px 22px; text-align: left; }
.acc-head .t { flex: 1; font-weight: 900; font-size: 1.2rem; min-width: 0; }
.acc-head .p { font-weight: 900; font-size: 1.3rem; color: var(--green); }
.acc-head .p.mid { color: var(--amber); } .acc-head .p.low { color: var(--red); } .acc-head .p.none { color: var(--muted); }
.acc-head .chev { color: var(--ink2); transition: transform .2s; font-size: .9rem; }
.acc.open .chev { transform: rotate(180deg); }
.acc-body { padding: 0 22px 20px; }
.bar { height: 8px; background: #e4eaee; border-radius: 4px; overflow: hidden; margin: 6px 0 14px; }
.bar > div { height: 100%; background: var(--teal); border-radius: 4px; }

/* Mode choice */
.modes { display: grid; gap: 12px; margin: 10px 0 26px; }
.mode { display: flex; gap: 16px; align-items: flex-start; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 18px; width: 100%; }
.mode .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #b8c4cc; flex: none; margin-top: 2px; display: grid; place-items: center; }
.mode.sel { border-color: var(--teal); background: #f2f9fa; }
.mode.sel .dot { border-color: var(--teal); }
.mode.sel .dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); }
.mode .m-title { font-weight: 900; font-size: 1.15rem; }
.mode .m-sub { color: var(--ink2); }
.rules { margin: 0; padding-left: 20px; color: var(--ink2); }
.rules li { margin: 4px 0; }
.start-head { display: flex; align-items: center; gap: 18px; margin: 18px 0 18px; }
.start-head h1 { margin: 0; font-size: 2.1rem; font-weight: 900; line-height: 1.1; }
.start-head .meta { color: var(--ink2); font-weight: 700; margin-top: 4px; }
.warn { background: var(--amber-bg); color: #6b4308; border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; }

/* Quiz */
.qtop { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--teal); flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.qcount { flex: 1; font-weight: 900; font-size: 1.1rem; }
.qcount small { display: block; font-weight: 700; color: var(--ink2); font-size: .82rem; }
.timer { background: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 900; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; color: var(--teal); }
.timer svg { width: 18px; height: 18px; }
.timer.amber { background: var(--amber-bg); color: var(--amber); }
.timer.red { background: var(--red); color: #fff; }
.progress { height: 6px; background: #dfe6ea; border-radius: 3px; overflow: hidden; margin-bottom: 20px; }
.progress > div { height: 100%; background: var(--teal); transition: width .3s; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #e3f0f2; color: var(--teal); font-weight: 800; font-size: .85rem; border-radius: 999px; padding: 6px 12px; }
.chip.flag { background: var(--amber-bg); color: var(--amber); }
.chip svg { width: 15px; height: 15px; }
.qcard { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; margin: 12px 0 16px; }
.stem { font-size: 1.12rem; margin: 0 0 12px; }
.qtext { font-size: 1.15rem; font-weight: 900; margin: 0; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 1.05rem;
}
.opt:hover:not(:disabled) { border-color: #b9c6ce; }
.opt .letter { width: 36px; height: 36px; border-radius: 50%; background: #eef2f4; display: grid; place-items: center; font-weight: 900; flex: none; color: var(--ink2); }
.opt .otext { flex: 1; }
.opt .mark { width: 26px; height: 26px; flex: none; }
.opt.selected { border-color: var(--ink); background: #f5f8fa; }
.opt.selected .letter { background: var(--ink); color: #fff; }
.opt.correct { border-color: var(--green); background: var(--green-bg); }
.opt.correct .letter { background: var(--green); color: #fff; }
.opt.correct .mark { color: var(--green); }
.opt.wrong { border-color: var(--red); background: var(--red-bg); }
.opt.wrong .letter { background: var(--red); color: #fff; }
.opt.wrong .mark { color: var(--red); }
.opt.dim { opacity: .6; }
.opt:disabled { color: var(--ink); }
.explain { border-radius: 18px; padding: 18px 20px; margin-top: 16px; background: #fff; border-left: 6px solid var(--green); box-shadow: var(--shadow); }
.explain.bad { border-left-color: var(--red); }
.explain .verdict { font-weight: 900; font-size: 1.1rem; margin-bottom: 6px; color: var(--green); }
.explain.bad .verdict { color: var(--red); }
.explain p { margin: 8px 0; }
.source { color: var(--muted); font-size: .88rem; margin-top: 10px; }
.check-row { margin-top: 16px; display: flex; justify-content: flex-end; }

.qnav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); }
.qnav .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; padding: 12px 20px 18px; }
.qnav .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.qnav .btn svg { width: 18px; height: 18px; }
.qnav .grow { flex: 1; }
.qnav .btn.flagged { background: var(--amber-bg); border-color: #f0d9a8; color: var(--amber); }

/* Question grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.cell { position: relative; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; }
.cell.ans { background: var(--ink); border-color: var(--ink); color: #fff; }
.cell.cur { outline: 3px solid var(--teal-l); outline-offset: 1px; }
.cell.flag::after { content: ""; position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #e3a008; }
.cell.ok { background: var(--green-bg); border-color: #b9dcc6; color: var(--green); }
.cell.bad { background: var(--red-bg); border-color: #efc2bd; color: var(--red); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink2); font-size: .9rem; margin: 12px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1.5px solid var(--line); }
.legend i.a { background: var(--ink); border-color: var(--ink); }
.legend i.f { background: #e3a008; border-color: #e3a008; border-radius: 50%; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.stat { background: #fff; border-radius: 16px; padding: 14px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.8rem; font-weight: 900; }
.stat span { color: var(--ink2); font-weight: 700; font-size: .9rem; }
.stat.warnc b { color: var(--amber); }

/* Results hero */
.hero { display: flex; align-items: center; gap: 26px; background: #fff; border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; flex-wrap: wrap; }
.hero .h-main { flex: 1; min-width: 200px; }
.badge { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 900; font-size: .9rem; letter-spacing: .04em; }
.badge.pass { background: var(--green-bg); color: var(--green); }
.badge.fail { background: var(--amber-bg); color: var(--amber); }
.badge.neutral { background: #e3f0f2; color: var(--teal); }
.hero .score { font-size: 1.5rem; font-weight: 900; margin: 10px 0 4px; }

/* Review items */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 16px; }
.fchip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; }
.fchip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.rv-badge { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.rv-badge svg { width: 18px; height: 18px; stroke-width: 3; }
.rv-badge.ok { background: var(--green); } .rv-badge.bad { background: var(--red); } .rv-badge.skip { background: #a4b0b9; }
.acc-head .t small { display: block; font-weight: 700; color: var(--ink2); font-size: .85rem; }
.your { font-weight: 800; margin: 12px 0 0; }
.empty { text-align: center; color: var(--ink2); padding: 30px 20px; }

/* Settings */
.set-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .s-main { flex: 1; }
.set-row .s-title { font-weight: 900; }
.set-row .s-sub { color: var(--ink2); font-size: .9rem; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper b { min-width: 56px; text-align: center; font-size: 1.2rem; }
.stepper .btn { padding: 8px 14px; }
.toggle { width: 54px; height: 32px; border-radius: 999px; background: #cfd8de; border: 0; position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on { background: var(--teal); }
.toggle.on::after { left: 25px; }
.warnlist { color: var(--red); font-size: .9rem; padding-left: 18px; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 5; }
.tabbar .inner { max-width: 760px; margin: 0 auto; display: flex; }
.tab { flex: 1; position: relative; border: 0; background: none; padding: 20px 0 22px; font-weight: 900; font-size: 1.1rem; color: #7b8994; }
.tab.active { color: var(--ink); }
.tab.active::before { content: ""; position: absolute; top: 8px; left: 50%; width: 32px; height: 4px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(15, 34, 51, .45); display: grid; place-items: center; padding: 20px; z-index: 20; animation: fade .15s; }
.modal { background: #fff; border-radius: var(--r); padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal p { color: var(--ink2); }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
