/* ================= MÀN HÌNH THI IELTS TRÊN MÁY =================
   Mô phỏng giao diện IELTS on Computer chính thức: nền xám trung tính, chữ đen,
   thanh số câu ở đáy, chia đôi màn hình cho Reading. Cố ý KHÔNG dùng màu brand
   để học viên quen mắt với phòng thi thật. */

.cd-exam {
  position: fixed; inset: 0; z-index: 9000;
  background: #fff; color: #111;
  font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.55;
  display: flex; flex-direction: column;
}
.cd-exam.fs-1 { font-size: 15px; }
.cd-exam.fs-2 { font-size: 17px; }
.cd-exam.fs-3 { font-size: 19.5px; }
.cd-exam * { box-sizing: border-box; }

/* ---- Thanh trên ---- */
.cd-top {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 14px; background: #f2f2f2; border-bottom: 1px solid #c8c8c8;
  flex: 0 0 auto; font-size: 13px;
}
.cd-top .cd-cand { font-weight: bold; }
.cd-top .cd-test { color: #555; }
.cd-timer {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-weight: bold; font-size: 15px;
}
.cd-timer .clock { min-width: 128px; text-align: right; }
.cd-timer.warn .clock { color: #b00; }
.cd-timer.danger .clock { color: #fff; background: #b00; padding: 2px 8px; border-radius: 4px; }
.cd-tools { display: flex; align-items: center; gap: 6px; }
.cd-tools button {
  border: 1px solid #9a9a9a; background: #fff; border-radius: 4px;
  padding: 3px 9px; cursor: pointer; font-size: 13px;
}
.cd-tools button:hover { background: #e8e8e8; }
.cd-vol { display: flex; align-items: center; gap: 5px; }
.cd-vol input { width: 92px; }

/* ---- Dải thông tin phần thi ---- */
.cd-partbar {
  padding: 7px 16px; background: #fff; border-bottom: 1px solid #ddd;
  font-size: 13.5px; flex: 0 0 auto;
}
.cd-partbar b { font-size: 15px; }

/* ---- Thân ---- */
.cd-body { flex: 1 1 auto; display: flex; min-height: 0; }
.cd-pane { overflow-y: auto; padding: 14px 20px 30px; }
.cd-left { flex: 0 0 50%; border-right: 1px solid #ccc; background: #fff; }
.cd-right { flex: 1 1 auto; }
.cd-body.single .cd-right { flex: 1 1 100%; max-width: 980px; margin: 0 auto; }
.cd-split {
  flex: 0 0 6px; cursor: col-resize; background: #e3e3e3;
  border-left: 1px solid #c6c6c6; border-right: 1px solid #c6c6c6;
}
.cd-split:hover { background: #cfd8e3; }

.cd-passage h3 { margin: 0 0 4px; font-size: 1.25em; }
.cd-passage .sub { color: #555; margin: 0 0 14px; font-style: italic; }
.cd-passage p { margin: 0 0 12px; text-align: justify; }
.cd-passage mark.hl { background: #ffe27a; padding: 0 1px; }
.cd-passage mark.hl.has-note { border-bottom: 2px solid #d08b00; cursor: help; }

/* ---- Câu hỏi ---- */
.cd-group { margin-bottom: 26px; }
.cd-instr {
  background: #f6f6f6; border: 1px solid #ddd; border-left: 4px solid #666;
  padding: 9px 13px; margin-bottom: 12px;
}
.cd-instr p { margin: 0 0 6px; } .cd-instr p:last-child { margin: 0; }
.cd-instr .limit { font-weight: bold; text-transform: uppercase; font-size: .92em; }

.cd-q { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dotted #e2e2e2; }
.cd-q:last-child { border-bottom: 0; }
.cd-qnum {
  flex: 0 0 30px; height: 26px; border: 1px solid #444; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 13px; background: #fff;
}
.cd-qbody { flex: 1 1 auto; }
.cd-qprompt { margin-bottom: 6px; }
.cd-opts { display: flex; flex-direction: column; gap: 3px; }
.cd-opts.row { flex-direction: row; gap: 18px; flex-wrap: wrap; }
.cd-opt { display: flex; gap: 7px; align-items: flex-start; cursor: pointer; padding: 2px 4px; border-radius: 3px; }
.cd-opt:hover { background: #eef3fa; }
.cd-opt input { width: 16px; height: 16px; min-width: 16px; max-width: 16px; flex: 0 0 auto; margin-top: 4px; padding: 0; }
.cd-opt .letter { font-weight: bold; min-width: 16px; }

.cd-review { font-size: 12px; color: #444; display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; margin-top: 4px; }
.cd-review input { width: 14px; height: 14px; min-width: 14px; max-width: 14px; flex: 0 0 auto; margin: 0; padding: 0; }

/* ô điền khuyết trong đoạn văn */
.cd-fill { line-height: 2.4; }
.cd-fill p { margin: 0 0 10px; }
.cd-gapwrap { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.cd-gapnum {
  display: inline-flex; width: 24px; height: 22px; border: 1px solid #444; border-radius: 3px;
  align-items: center; justify-content: center; font-size: 12px; font-weight: bold; background: #fff;
}
input.cd-gap, select.cd-sel {
  border: 1px solid #767676; border-radius: 3px; padding: 3px 6px;
  font-family: inherit; font-size: .95em; background: #fff; min-width: 130px;
}
select.cd-sel { min-width: 74px; }
input.cd-gap:focus, select.cd-sel:focus { outline: 2px solid #1a73c8; border-color: #1a73c8; }
input.cd-gap.filled, select.cd-sel.filled { background: #f0f6ff; }

/* ---- Thanh dưới ---- */
.cd-bottom {
  flex: 0 0 auto; background: #f2f2f2; border-top: 1px solid #c8c8c8;
  padding: 6px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cd-parttabs { display: flex; gap: 5px; }
.cd-parttabs button {
  border: 1px solid #999; background: #fff; border-radius: 4px;
  padding: 4px 11px; cursor: pointer; font-size: 13px;
}
.cd-parttabs button.active { background: #333; color: #fff; border-color: #333; }
.cd-nums { display: flex; gap: 3px; flex-wrap: wrap; flex: 1 1 auto; }
.cd-num {
  width: 27px; height: 25px; border: 1px solid #8a8a8a; background: #fff;
  border-radius: 3px; font-size: 12px; cursor: pointer; padding: 0;
}
.cd-num.answered { background: #333; color: #fff; border-color: #333; }
.cd-num.flagged { border: 2px solid #c88a00; border-radius: 50%; }
.cd-num.current { outline: 2px solid #1a73c8; outline-offset: 1px; }
.cd-bottom .cd-submit {
  background: #14532d; color: #fff; border: 0; border-radius: 4px;
  padding: 7px 16px; font-weight: bold; cursor: pointer;
}
.cd-bottom .cd-nav { border: 1px solid #999; background: #fff; border-radius: 4px; padding: 6px 11px; cursor: pointer; }

/* ---- Chế độ xem thử: đáp án hiện cạnh câu hỏi ---- */
.cd-ans {
  display: inline-block; margin-top: 5px; background: #e6f4ea; color: #14532d;
  border: 1px solid #b7dfc4; border-radius: 5px; padding: 1px 8px;
  font-size: 13px; font-weight: bold;
}
.cd-ans.inline { margin: 0 0 0 5px; vertical-align: middle; }

/* ---- Menu chuột phải ---- */
.cd-ctx {
  position: fixed; z-index: 9500; background: #fff; border: 1px solid #999;
  border-radius: 5px; box-shadow: 0 6px 20px rgba(0,0,0,.2); padding: 4px; min-width: 150px;
}
.cd-ctx button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; cursor: pointer; font-size: 13.5px; }
.cd-ctx button:hover { background: #eef3fa; }

/* ---- Hộp thoại trong phòng thi ---- */
.cd-modal-bg { position: fixed; inset: 0; z-index: 9600; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.cd-modal { background: #fff; border-radius: 8px; max-width: 560px; width: 92%; padding: 22px 24px; max-height: 86vh; overflow: auto; }
.cd-modal h3 { margin: 0 0 10px; }
.cd-modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.cd-modal button { border: 1px solid #999; background: #fff; border-radius: 4px; padding: 8px 15px; cursor: pointer; }
.cd-modal button.primary { background: #14532d; color: #fff; border-color: #14532d; font-weight: bold; }
.cd-warnbar {
  position: fixed; top: 44px; left: 50%; transform: translateX(-50%); z-index: 9400;
  background: #b00; color: #fff; padding: 9px 22px; border-radius: 6px; font-weight: bold;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* ---- Trình phát Listening ---- */
.cd-audio {
  display: flex; align-items: center; gap: 12px; background: #eef1f5;
  border: 1px solid #c9d2dd; border-radius: 6px; padding: 10px 14px; margin-bottom: 16px;
}
.cd-audio .state { font-weight: bold; }
.cd-audio .bar { flex: 1 1 auto; height: 7px; background: #d3dae3; border-radius: 4px; overflow: hidden; }
.cd-audio .bar i { display: block; height: 100%; background: #2c5f9e; width: 0; }
.cd-audio.missing { background: #fff6e5; border-color: #e2c489; }

/* ================= TRANG NGOÀI PHÒNG THI ================= */
.ielts-intro { max-width: 860px; }
.ielts-intro .card { background: var(--surface, #fff); border: 1px solid rgba(0,0,0,.08); border-radius: 14px; padding: 22px 26px; margin-bottom: 16px; }
.ielts-intro h3 { margin-top: 0; }
.ielts-intro ul { padding-left: 20px; }
.ielts-intro li { margin-bottom: 6px; }
.ielts-check { display: flex; gap: 9px; align-items: flex-start; margin: 14px 0; }

.band-box { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.band-big { font-size: 54px; font-weight: 800; line-height: 1; }
.band-sub { opacity: .75; font-size: 14px; }

.res-q { border-left: 4px solid #bbb; padding: 9px 14px; margin-bottom: 9px; border-radius: 0 8px 8px 0; background: rgba(0,0,0,.02); }
.res-q.ok { border-left-color: #1e874b; }
.res-q.bad { border-left-color: #c0392b; }
.res-q .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.res-q .num { font-weight: 700; min-width: 30px; }
.res-q .given { font-family: ui-monospace, monospace; }
.res-q .given.bad { text-decoration: line-through; opacity: .8; }
.res-q .exp { margin-top: 7px; font-size: 14.5px; }
.res-q .ev { margin-top: 5px; font-size: 14px; font-style: italic; opacity: .8; border-left: 3px solid rgba(0,0,0,.15); padding-left: 9px; }
.res-q .tnote { margin-top: 7px; font-size: 14px; background: rgba(200,161,75,.14); border-radius: 6px; padding: 7px 10px; }
.res-flag { font-size: 12px; border: 1px solid #c88a00; border-radius: 10px; padding: 0 7px; color: #a06f00; }

.skill-pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(0,0,0,.15); }
.skill-pill.reading { background: #e8f1fb; color: #16457a; }
.skill-pill.listening { background: #eaf6ec; color: #16603a; }
