/* ==========================================================================
   Zenith Evalyx — Online Assessment UI
   Colours sampled directly from the supplied reference screenshots.
   ========================================================================== */

:root {
  /* Top navigation gradient (sampled left -> right across the header) */
  --nav-from:        #003b73;
  --nav-mid:         #004f91;
  --nav-to:          #0662a5;

  /* Blues */
  --accent:          #0b6bcb;   /* side nav arrows */
  --accent-dark:     #0959ac;
  --navy:            #164072;   /* selected radio, active underline */
  --link:            #1a6bb5;

  /* Surfaces */
  --subbar-bg:       #f2f3f7;
  --page-bg:         #ffffff;
  --card-bg:         #ffffff;
  --card-bg-active:  #f2f5f9;

  /* Lines */
  --line:            #dfe3e8;
  --line-soft:       #e9ecf0;
  --line-strong:     #cfd5dc;

  /* Text */
  --text:            #2b2f33;
  --text-soft:       #4a5158;
  --muted:           #6b7480;
  --muted-light:     #9aa3ad;

  /* Status */
  --green:           #00a20a;
  --green-soft:      #17a673;
  --red:             #e0483d;
  --gray-icon:       #414141;

  --radius:          4px;
  --topbar-h:        74px;
  --subbar-h:        50px;
  --helpbar-h:       40px;
  --sysbar-h:        42px;

  --font: 'Lato', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

.ic { width: 16px; height: 16px; display: block; flex: none; }
.ic-sm { width: 14px; height: 14px; }

/* ==========================================================================
   SETUP DIALOG
   ========================================================================== */
.setup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 25% 20%, rgba(11,107,203,.30), transparent 55%),
    linear-gradient(135deg, #002d5c 0%, #004f91 55%, #0662a5 100%);
}
.setup-backdrop[hidden] { display: none; }

.setup-dialog {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 20, 45, .40);
  overflow: hidden;
  animation: pop .28s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.setup-head {
  background: linear-gradient(90deg, var(--nav-from) 0%, var(--nav-mid) 55%, var(--nav-to) 100%);
  padding: 20px 26px 18px;
  color: #fff;
}
.setup-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .2px;
}
.setup-logo b { font-weight: 900; opacity: .92; }
.setup-logo .brand-mark { width: 30px; height: 15px; }
.setup-sub {
  margin: 7px 0 0;
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255,255,255,.78);
}

.setup-body { padding: 22px 26px 26px; }

.fld { display: block; margin-bottom: 16px; }
.fld-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.fld-label i { color: var(--red); font-style: normal; }
.fld input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fld input::placeholder { color: var(--muted-light); }
.fld input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,107,203,.14);
}
.fld.invalid input { border-color: var(--red); }
.fld-err {
  display: none;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--red);
}
.fld.invalid .fld-err { display: block; }

.setup-btn {
  width: 100%;
  height: 40px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--nav-mid), var(--nav-to));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  border: 0;
  border-radius: var(--radius);
  transition: filter .15s, transform .1s;
}
.setup-btn:hover  { filter: brightness(1.08); }
.setup-btn:active { transform: translateY(1px); }

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app[hidden] { display: none; }

/* ------------------------------- TOP BAR -------------------------------- */
.topbar {
  flex: none;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px 0 22px;
  color: #fff;
  background: linear-gradient(90deg,
              var(--nav-from) 0%, #004481 28%, var(--nav-mid) 62%, var(--nav-to) 100%);
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 40px; height: 20px; flex: none; }
.brand-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .1px;
}
.brand-pipe {
  width: 1px;
  height: 28px;
  margin: 0 6px;
  background: rgba(255,255,255,.45);
}
.brand-sub {
  position: relative;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.3px;
  padding-right: 15px;
}
.brand-bars {
  position: absolute;
  right: 0;
  bottom: 4px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 15px;
}
.brand-bars i { width: 2.5px; background: #fff; border-radius: 1px; }
.brand-bars i:nth-child(1) { height: 7px; }
.brand-bars i:nth-child(2) { height: 11px; }
.brand-bars i:nth-child(3) { height: 15px; }

.topbar-sep {
  width: 1px;
  height: 38px;
  background: rgba(255,255,255,.28);
  flex: none;
}

.test-meta { min-width: 0; flex: 1 1 auto; }
.candidate {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,.72);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}
.test-line {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.test-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.slash { color: rgba(255,255,255,.55); font-weight: 300; }
.ic-cloud { width: 16px; height: 16px; color: rgba(255,255,255,.72); }
.saved {
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: none;
}
.timer {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  white-space: nowrap;
}
.timer .ic { width: 17px; height: 17px; }
.timer-label { font-weight: 600; }
.timer-value { font-weight: 700; letter-spacing: .2px; }
.timer.warning { color: #ffd7a0; }
.timer.danger  { color: #ff9d92; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .45; } }

.ic-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: #fff;
  background: none;
  border: 0;
  border-radius: var(--radius);
  opacity: .92;
  transition: background .15s, opacity .15s;
}
.ic-btn .ic { width: 21px; height: 21px; }
.ic-btn:hover { background: rgba(255,255,255,.14); opacity: 1; }

.finish-btn {
  height: 38px;
  padding: 0 26px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
.finish-btn:hover { background: #fff; color: var(--nav-mid); }

/* ------------------------------- SUB BAR -------------------------------- */
.subbar {
  flex: none;
  position: relative;
  height: var(--subbar-h);
  display: flex;
  align-items: center;
  padding: 0 clamp(14px, 3.4vw, 66px);
  background: var(--subbar-bg);
  border-bottom: 1px solid var(--line-strong);
  z-index: 30;
}

.subbar-left  { display: flex; align-items: center; gap: 11px; flex: 1 1 0; min-width: 0; }
.subbar-right { display: flex; align-items: center; justify-content: flex-end; flex: 1 1 0; }
.subbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Section dropdown */
.section-select {
  position: relative;
  min-width: 250px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  outline: none;
}
.section-select:focus-visible { border-color: var(--accent); }
.section-select .ic { color: var(--muted); }

.section-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(20,40,70,.16);
  padding: 4px 0;
  display: none;
  z-index: 40;
}
.section-select.open .section-menu { display: block; }
.section-menu li {
  padding: 8px 12px;
  font-size: 14px;
  white-space: nowrap;
}
.section-menu li:hover { background: #eef4fb; }
.section-menu li.active { color: var(--navy); font-weight: 700; background: #eaf1f9; }

/* Square icon buttons (info + palette) */
.sq-btn {
  width: 36px; height: 34px;
  display: grid; place-items: center;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: background .15s, border-color .15s;
}
.sq-btn:hover { background: #eef4fb; border-color: var(--accent); }
.sq-btn.active { background: #e6eff9; border-color: var(--accent); }

/* Pager */
.pager-row { position: relative; display: flex; align-items: center; gap: 12px; }

.pg-arrow {
  width: 26px; height: 30px;
  display: grid; place-items: center;
  color: #45505c;
  background: none;
  border: 0;
  border-radius: 3px;
}
.pg-arrow .ic { width: 16px; height: 16px; }
.pg-arrow:hover:not(:disabled) { background: rgba(0,0,0,.06); }
.pg-arrow:disabled { opacity: .3; cursor: default; }

/* Pager strip — sampled from the reference:
   answered cells are shaded #e0e5eb, unanswered stay near-white,
   and the active cell carries a 2px navy underline across its full width. */
.pg-nums {
  display: flex;
  align-items: stretch;
  height: 34px;
  border: 1px solid #c8ced6;
  border-radius: 3px;
  background: #fbfcfd;
  overflow: hidden;
}
.pg-num {
  position: relative;
  min-width: 38px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: #fbfcfd;
  border: 0;
  border-right: 1px solid #cbd0d6;
  transition: background .12s;
}
.pg-num:last-child { border-right: 0; }
.pg-num.answered { background: #e0e5eb; }
.pg-num:hover { background: #d6dde5; }
.pg-num.current { font-weight: 400; }
.pg-num.current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--navy);
}

.grid-btn { margin-left: 4px; }

/* "Attempted" tab hanging below the sub bar — square at the top where it meets
   the toolbar rule, rounded on the two bottom corners only. */
.attempted {
  position: absolute;
  top: calc(var(--subbar-h) - 1px);
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 34px 3px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-soft);
  background: var(--subbar-bg);
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  white-space: nowrap;
  z-index: 2;
}

/* Previous / Next */
.pn-group {
  display: flex;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
}
.pn-btn {
  padding: 0 20px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  transition: background .12s;
}
.pn-btn:last-child { border-right: 0; }
.pn-btn:hover:not(:disabled) { background: #f0f5fa; }
.pn-btn:disabled { color: var(--muted-light); cursor: default; }

/* ------------------------------- CONTENT -------------------------------- */
.content {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--page-bg);
  overflow: hidden;
}

/* Diagonal tiled watermark */
.watermark {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.wm-inner {
  position: absolute;
  top: -70%;
  left: -35%;
  width: 180%;
  height: 240%;
  display: flex;
  flex-direction: column;
  gap: 68px;
  transform: rotate(-24deg);
}
.wm-row {
  display: flex;
  gap: 140px;
  white-space: nowrap;
}
.wm-row:nth-child(even) { margin-left: 190px; }
.wm-row span {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .3px;
  color: rgba(28, 40, 58, .145);
}

/* Side navigation arrows */
.side-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  z-index: 6;
  transition: background .15s;
}
.side-nav:hover:not(:disabled) { background: var(--accent-dark); }
.side-nav:disabled { opacity: .35; cursor: default; }
.side-nav-left  { left: 14px; }
.side-nav-right { right: 14px; }

/* Two panes */
.panes {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pane {
  min-width: 0;
  /* top padding clears the "Attempted" tab that hangs below the sub bar */
  padding: 36px 30px 24px;
  overflow-y: auto;
}
/* Horizontal padding mirrors the reference: the question column is inset ~5%
   of the viewport on the outer edge and ~3% against the centre divider. */
.pane-q { padding-left: clamp(44px, 5.1vw, 96px); padding-right: clamp(22px, 3vw, 58px); }
.pane-o {
  padding-left: clamp(24px, 3.2vw, 60px);
  padding-right: clamp(46px, 5.2vw, 98px);
  border-left: 1px solid var(--line-soft);
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
}

.q-title { display: flex; align-items: center; gap: 10px; }
.q-title h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .1px;
}
.ic-flag { width: 16px; height: 16px; color: #5b6470; }

.o-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .1px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-soft);
  background: none;
  border: 0;
  border-radius: 3px;
  transition: color .15s;
}
.link-btn:hover { color: var(--accent); }
.link-btn.on { color: var(--navy); font-weight: 700; }

.q-text {
  margin-top: 26px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  max-width: 780px;
}

/* Option cards */
.options { margin-top: 24px; display: flex; flex-direction: column; gap: 15px; }

.option {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 66px;
  padding: 14px 20px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .13s, border-color .13s;
}
.option:hover { background: #f7f9fc; border-color: var(--line-strong); }
.option.selected { background: var(--card-bg-active); border-color: var(--line-strong); }
.option input { position: absolute; opacity: 0; pointer-events: none; }

.mark {
  position: relative;
  width: 17px; height: 17px;
  flex: none;
  border: 1.7px solid #a8b1bb;
  border-radius: 50%;
  background: #fff;
  transition: border-color .13s;
}
.mark.square { border-radius: 3px; }
.option:hover .mark { border-color: #7d8894; }
.option.selected .mark { border-color: var(--navy); }
.option.selected .mark::after {
  content: "";
  position: absolute;
  inset: 2.4px;
  border-radius: 50%;
  background: var(--navy);
}
.option.selected .mark.square::after {
  inset: 0;
  border-radius: 2px;
  background: var(--navy);
  box-shadow: inset 0 0 0 2px #fff;
}
.option.selected .mark.square {
  background: var(--navy);
  border-color: var(--navy);
}
.option.selected .mark.square::after {
  inset: 0;
  background: none;
  box-shadow: none;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  width: 8px; height: 4px;
  margin: 3.5px 0 0 2.5px;
  border-radius: 0;
  transform: rotate(-45deg);
}

.option-text {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.45;
}

/* ------------------------------- HELP BAR ------------------------------- */
.helpbar {
  flex: none;
  height: var(--helpbar-h);
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 5.6vw, 108px);
  background: #fff;
  border-top: 1px solid var(--line-soft);
  position: relative;
  z-index: 4;
}
.help-left  { display: flex; align-items: center; gap: 26px; flex: 1 1 0; }
.help-right { flex: 1 1 0; }
.ic-wifi { width: 19px; height: 19px; color: #17a673; }
.ic-rec  { width: 17px; height: 17px; color: #e0483d; }

.help-center {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-soft);
  white-space: nowrap;
}
.help-center .flag {
  width: 19px; height: 13px;
  border-radius: 1px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.16);
  display: block;
  flex: none;
}
.help-center .num { margin-right: 14px; }

/* ------------------------------- SYS BAR -------------------------------- */
.sysbar {
  flex: none;
  height: var(--sysbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 10px;
  background: #f6f7f9;
  border-top: 1px solid #e2e5e9;
}
.sys-globe { width: 28px; height: 28px; display: block; }
.sys-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sys-batt  { width: 30px; height: 19px; display: block; }
.sys-power { width: 21px; height: 21px; display: block; }

/* ------------------------------- PALETTE -------------------------------- */
.palette {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 14px 38px rgba(20,40,70,.20);
  z-index: 60;
  overflow: hidden;
}
.palette[hidden] { display: none; }
.palette-head {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--nav-mid), var(--nav-to));
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 14px;
}
.pal-cell {
  height: 32px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  background: #eef1f5;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  transition: transform .1s;
}
.pal-cell:hover { transform: translateY(-1px); }
.pal-cell.answered { background: #d8f2e4; border-color: #8fd3b4; color: #12734f; }
.pal-cell.not      { background: #fde7e5; border-color: #f2b3ad; color: #a63a30; }
.pal-cell.review   { background: #ece2fb; border-color: #c1a9ef; color: #5a34a8; }
.pal-cell.current  { outline: 2px solid var(--accent); outline-offset: 1px; }

.palette-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  padding: 0 14px 14px;
  font-size: 11px;
  color: var(--text-soft);
}
.palette-legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 11px; height: 11px; border-radius: 2px; border: 1px solid var(--line-strong); flex: none; }
.lg-ans { background: #d8f2e4; border-color: #8fd3b4; }
.lg-not { background: #fde7e5; border-color: #f2b3ad; }
.lg-rev { background: #ece2fb; border-color: #c1a9ef; }
.lg-vis { background: #eef1f5; }

/* ------------------------------- MODAL ---------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 28, 50, .48);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 22px 55px rgba(0,20,45,.35);
  overflow: hidden;
  animation: pop .22s ease-out;
}
.modal-head {
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--nav-mid), var(--nav-to));
}
.modal-body {
  padding: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
  max-height: 55vh;
  overflow-y: auto;
}
.modal-body ul { list-style: disc; padding-left: 20px; margin: 8px 0 0; }
.modal-body li { margin-bottom: 6px; }
.modal-body .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.modal-body .stat-row b { color: var(--text); }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  background: #fafbfc;
}
.btn {
  height: 34px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-soft);
  transition: background .14s, color .14s, border-color .14s;
}
.btn:hover { background: #f0f4f8; }
.btn-primary {
  background: linear-gradient(90deg, var(--nav-mid), var(--nav-to));
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(90deg, var(--nav-mid), var(--nav-to)); }

/* Submitted screen */
.done-screen {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: #fff;
  text-align: center;
  padding: 30px;
}
.done-screen h1 { margin: 0 0 10px; font-size: 24px; color: var(--navy); }
.done-screen p  { margin: 0; font-size: 14px; color: var(--muted); }
.done-check {
  width: 66px; height: 66px;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #e2f6ec;
  color: #17a673;
  font-size: 32px;
}

/* ------------------------- FULL-SCREEN LOCK GUARD ----------------------- */
.fs-guard {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 30px;
  background: linear-gradient(135deg, #002d5c 0%, #004f91 55%, #0662a5 100%);
}
.fs-guard[hidden] { display: none; }

.fs-guard-box {
  max-width: 420px;
  text-align: center;
  color: #fff;
}
.fs-guard-icon {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  color: rgba(255,255,255,.85);
}
.fs-guard-box h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
}
.fs-guard-box p {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,.78);
}
.fs-guard-box .btn {
  height: 40px;
  padding: 0 26px;
  background: #fff;
  border-color: #fff;
  color: var(--nav-mid);
}
.fs-guard-box .btn:hover { background: #eaf1f9; }
.fs-guard-hint {
  margin: 18px 0 0 !important;
  font-size: 12px !important;
  color: rgba(255,255,255,.5) !important;
}

/* Transient status toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 520;
  max-width: 82vw;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: rgba(12, 32, 56, .94);
  border-radius: 20px;
  box-shadow: 0 8px 26px rgba(0, 20, 45, .32);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: toast-in .22s ease-out;
}
.toast[hidden] { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Load error */
.load-error {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #fff;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
}
.load-error[hidden] { display: none; }
.load-error code {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  background: #f1f3f6;
  border-radius: 3px;
  font-size: 13px;
  color: var(--navy);
}

/* ------------------------------ RESPONSIVE ------------------------------ */
@media (max-width: 1180px) {
  .pane-q { padding-left: 46px; }
  .pane-o { padding-right: 46px; }
  .candidate, .test-title { max-width: 220px; }
}

@media (max-width: 900px) {
  :root { --topbar-h: auto; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .topbar-sep { display: none; }
  .test-meta { flex-basis: 100%; order: 3; }
  .topbar-right { gap: 10px; }
  .subbar { height: auto; flex-wrap: wrap; gap: 10px; padding: 8px 12px 10px; }
  .subbar-center { position: static; transform: none; order: 3; flex-basis: 100%; }
  .attempted { position: static; transform: none; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 4px; }
  .subbar-left, .subbar-right { flex: 1 1 auto; }
  .panes { grid-template-columns: 1fr; overflow-y: auto; }
  .pane { overflow: visible; }
  .pane-o { border-left: 0; border-top: 1px solid var(--line-soft); }
  .pane-q, .pane-o { padding-left: 46px; padding-right: 46px; }
  .side-nav { top: auto; bottom: 14px; transform: none; }
  .help-center { white-space: normal; font-size: 10.5px; }
  .sys-net { display: none; }
}
