/* ============================================================
   TOEFL iBT Test Interface — ETS-Authentic Styling
   ============================================================
   This stylesheet replicates the official ETS TOEFL iBT exam
   interface. It is intentionally separate from the landing page
   design system (navy/teal/gold). All colors, spacing, and
   typography match the real test environment.
   ============================================================ */

/* ----- CSS Custom Properties -------------------------------- */
:root {
  --toolbar-bg: #3b3b3b;
  --toolbar-text: #ffffff;
  --content-bg: #e8e8e8;
  --panel-bg: #ffffff;
  --border-color: #cccccc;
  --selected-blue: #1a73e8;
  --btn-primary: #1a73e8;
  --btn-text: #ffffff;
  --review-answered: #4caf50;
  --review-unanswered: #f44336;
  --review-not-seen: #9e9e9e;
  --timer-text: #ffffff;
  --font-main: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;
  --toolbar-height: 48px;
  --nav-height: 48px;
}


/* ----- Reset & Base ----------------------------------------- */
.test-interface,
.test-interface *,
.test-interface *::before,
.test-interface *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.test-interface {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.55;
  color: #222222;
  background: var(--content-bg);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* =============================================================
   1. TEST TOOLBAR — Fixed top bar
   ============================================================= */
.test-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--toolbar-height);
  min-height: var(--toolbar-height);
  background: var(--toolbar-bg);
  color: var(--toolbar-text);
  padding: 0 16px;
  z-index: 100;
  user-select: none;
  flex-shrink: 0;
}

.test-toolbar__section-name {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.test-toolbar__center {
  display: flex;
  align-items: center;
  gap: 24px;
}

.test-toolbar__question-counter {
  font-size: 13px;
  font-weight: 400;
  color: #d0d0d0;
}

.test-toolbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Volume icon button */
.test-toolbar__volume-btn {
  background: none;
  border: none;
  color: var(--toolbar-text);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  display: flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.test-toolbar__volume-btn:hover {
  opacity: 1;
}

/* Help / Hide Timer buttons */
.test-toolbar__icon-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  color: var(--toolbar-text);
  font-size: 12px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.test-toolbar__icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}


/* =============================================================
   7. TIMER DISPLAY
   ============================================================= */
.test-timer {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--timer-text);
  letter-spacing: 1px;
  min-width: 56px;
  text-align: center;
}

.test-timer--hidden {
  visibility: hidden;
}

.test-timer--warning {
  color: #ff6b6b;
  animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}


/* =============================================================
   2. SPLIT-SCREEN LAYOUT
   ============================================================= */
.test-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Question panel (left) */
.test-panel--question {
  flex: 1 1 50%;
  min-width: 320px;
  background: var(--panel-bg);
  overflow-y: auto;
  padding: 28px 32px;
  border-right: 1px solid var(--border-color);
}

/* Passage panel (right) */
.test-panel--passage {
  flex: 1 1 50%;
  min-width: 320px;
  background: var(--panel-bg);
  overflow-y: auto;
  padding: 28px 32px;
}

/* Divider / resizer */
.test-divider {
  width: 6px;
  cursor: col-resize;
  background: var(--border-color);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.15s;
}

.test-divider:hover,
.test-divider--active {
  background: var(--selected-blue);
}

.test-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 32px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 1px;
}

/* Full-width panel (listening / speaking / writing) */
.test-panel--full {
  flex: 1;
  background: var(--panel-bg);
  overflow-y: auto;
  padding: 36px 48px;
  max-width: 860px;
  margin: 0 auto;
}


/* =============================================================
   3. RADIO BUTTONS — Custom 20 px circles
   ============================================================= */
.test-radio-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.test-radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background 0.12s, border-color 0.12s;
}

.test-radio:hover {
  background: #f0f4ff;
  border-color: #d4e0f7;
}

.test-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.test-radio__circle {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #888888;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
  margin-top: 1px;
}

.test-radio__circle::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.test-radio--selected .test-radio__circle {
  border-color: var(--selected-blue);
}

.test-radio--selected .test-radio__circle::after {
  background: var(--selected-blue);
}

.test-radio--selected {
  background: #e8f0fe;
  border-color: #c5d7f5;
}

.test-radio__label {
  font-size: 15px;
  line-height: 1.5;
  color: #222222;
}

/* Answer letter markers (A, B, C, D) */
.test-radio__letter {
  font-weight: 600;
  margin-right: 4px;
  color: #555555;
}


/* =============================================================
   4. CHECKBOXES — Multi-select listening questions
   ============================================================= */
.test-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.test-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background 0.12s, border-color 0.12s;
}

.test-checkbox:hover {
  background: #f0f4ff;
  border-color: #d4e0f7;
}

.test-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.test-checkbox__box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #888888;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  margin-top: 1px;
}

.test-checkbox--selected .test-checkbox__box {
  background: var(--selected-blue);
  border-color: var(--selected-blue);
}

/* Checkmark */
.test-checkbox--selected .test-checkbox__box::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.test-checkbox__label {
  font-size: 15px;
  line-height: 1.5;
  color: #222222;
}


/* =============================================================
   5. NAVIGATION BAR — Bottom bar
   ============================================================= */
.test-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  min-height: var(--nav-height);
  background: var(--toolbar-bg);
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
}

.test-nav__left,
.test-nav__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-nav__btn {
  height: 32px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.test-nav__btn--primary {
  background: var(--btn-primary);
  color: var(--btn-text);
}

.test-nav__btn--primary:hover {
  background: #1565c0;
}

.test-nav__btn--secondary {
  background: #555555;
  color: var(--btn-text);
}

.test-nav__btn--secondary:hover {
  background: #666666;
}

.test-nav__btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.test-nav__btn--submit {
  background: var(--review-answered);
  color: var(--btn-text);
}

.test-nav__btn--submit:hover {
  background: #43a047;
}


/* =============================================================
   6. REVIEW SCREEN — Question status grid
   ============================================================= */
.test-review {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 24px;
}

.test-review__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #222222;
}

.test-review__subtitle {
  font-size: 14px;
  color: #666666;
  margin-bottom: 24px;
}

.test-review__legend {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #555555;
}

.test-review__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.test-review__legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.test-review__legend-dot--answered {
  background: var(--review-answered);
}

.test-review__legend-dot--unanswered {
  background: var(--review-unanswered);
}

.test-review__legend-dot--not-seen {
  background: var(--review-not-seen);
}

.test-review__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 48px);
  gap: 8px;
}

.test-review__item {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}

.test-review__item:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.test-review__item--answered {
  background: var(--review-answered);
}

.test-review__item--unanswered {
  background: var(--review-unanswered);
}

.test-review__item--not-seen {
  background: var(--review-not-seen);
}

.test-review__item--current {
  outline: 3px solid var(--selected-blue);
  outline-offset: 2px;
}


/* =============================================================
   8. AUDIO PLAYER
   ============================================================= */
.test-audio {
  background: #f5f5f5;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 20px 24px;
  max-width: 600px;
  margin: 24px auto;
}

.test-audio__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.test-audio__play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--btn-primary);
  color: var(--btn-text);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.test-audio__play-btn:hover {
  background: #1565c0;
}

.test-audio__play-btn--disabled {
  background: #999999;
  cursor: not-allowed;
}

.test-audio__progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.test-audio__progress-bar {
  width: 100%;
  height: 6px;
  background: #d0d0d0;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.test-audio__progress-fill {
  height: 100%;
  background: var(--selected-blue);
  border-radius: 3px;
  width: 0%;
  transition: width 0.25s linear;
}

.test-audio__time {
  font-size: 12px;
  color: #888888;
  font-variant-numeric: tabular-nums;
  display: flex;
  justify-content: space-between;
}

.test-audio__volume {
  display: flex;
  align-items: center;
  gap: 6px;
}

.test-audio__volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #d0d0d0;
  border-radius: 2px;
  outline: none;
}

.test-audio__volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--selected-blue);
  cursor: pointer;
}

.test-audio__volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--selected-blue);
  cursor: pointer;
  border: none;
}


/* =============================================================
   9. RECORDING INDICATOR — Speaking section
   ============================================================= */
.test-recording {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #fff5f5;
  border: 1px solid #ffcccc;
  border-radius: 6px;
  max-width: 320px;
  margin: 20px auto;
}

.test-recording__dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  background: #f44336;
  border-radius: 50%;
  animation: recording-pulse 1.2s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

.test-recording__text {
  font-size: 14px;
  font-weight: 600;
  color: #d32f2f;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-recording__waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  margin-left: auto;
}

.test-recording__bar {
  width: 3px;
  background: #f44336;
  border-radius: 1px;
  animation: waveform-bar 0.8s ease-in-out infinite;
}

.test-recording__bar:nth-child(1) { height: 8px;  animation-delay: 0.0s; }
.test-recording__bar:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.test-recording__bar:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.test-recording__bar:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.test-recording__bar:nth-child(5) { height: 10px; animation-delay: 0.4s; }
.test-recording__bar:nth-child(6) { height: 16px; animation-delay: 0.15s; }
.test-recording__bar:nth-child(7) { height: 8px;  animation-delay: 0.25s; }

@keyframes waveform-bar {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.35); }
}


/* =============================================================
   10. PREP / RESPONSE COUNTDOWN — Circular ring
   ============================================================= */
.test-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
}

.test-countdown__label {
  font-size: 16px;
  font-weight: 500;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.test-countdown__ring {
  position: relative;
  width: 160px;
  height: 160px;
}

.test-countdown__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.test-countdown__ring-bg {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 6;
}

.test-countdown__ring-fill {
  fill: none;
  stroke: var(--selected-blue);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.test-countdown__time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 42px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: #333333;
}

.test-countdown__sublabel {
  font-size: 13px;
  color: #888888;
}


/* =============================================================
   11. WRITING EDITOR
   ============================================================= */
.test-writing {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.test-writing__header {
  padding: 10px 16px;
  background: #f5f5f5;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: #666666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.test-writing__textarea {
  flex: 1;
  width: 100%;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  color: #222222;
  background: var(--panel-bg);
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
}

.test-writing__textarea::placeholder {
  color: #bbbbbb;
}

.test-writing__footer {
  padding: 8px 16px;
  background: #f5f5f5;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: #666666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.test-writing__word-count {
  font-variant-numeric: tabular-nums;
}

.test-writing__cut-paste {
  display: flex;
  gap: 12px;
}

.test-writing__tool-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 2px 10px;
  font-size: 12px;
  color: #555555;
  cursor: pointer;
  transition: background 0.12s;
}

.test-writing__tool-btn:hover {
  background: #e8e8e8;
}


/* =============================================================
   12. NOTEPAD OVERLAY — Floating, draggable
   ============================================================= */
.test-notepad {
  position: fixed;
  top: 80px;
  right: 40px;
  width: 340px;
  max-height: 400px;
  background: #fffde7;
  border: 1px solid #e0d88c;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.test-notepad--hidden {
  display: none;
}

.test-notepad__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f5f0c4;
  border-bottom: 1px solid #e0d88c;
  cursor: move;
  user-select: none;
}

.test-notepad__title {
  font-size: 13px;
  font-weight: 600;
  color: #5d5a2f;
}

.test-notepad__close {
  background: none;
  border: none;
  font-size: 18px;
  color: #888866;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.test-notepad__close:hover {
  color: #555533;
}

.test-notepad__body {
  flex: 1;
  overflow: hidden;
}

.test-notepad__textarea {
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 10px 12px;
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1.5;
  color: #333322;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
}


/* =============================================================
   13. SYSTEM CHECK SCREEN
   ============================================================= */
.test-syscheck {
  max-width: 560px;
  margin: 60px auto;
  padding: 36px 40px;
  background: var(--panel-bg);
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.test-syscheck__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #222222;
}

.test-syscheck__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.test-syscheck__item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #333333;
}

.test-syscheck__icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
}

.test-syscheck__icon--pass {
  background: #e8f5e9;
  color: var(--review-answered);
}

.test-syscheck__icon--fail {
  background: #ffebee;
  color: var(--review-unanswered);
}

.test-syscheck__icon--loading {
  background: #fff8e1;
  color: #f9a825;
  animation: syscheck-spin 1s linear infinite;
}

@keyframes syscheck-spin {
  to { transform: rotate(360deg); }
}

.test-syscheck__start-btn {
  margin-top: 28px;
  width: 100%;
  height: 40px;
  background: var(--btn-primary);
  color: var(--btn-text);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.test-syscheck__start-btn:hover {
  background: #1565c0;
}

.test-syscheck__start-btn:disabled {
  background: #999999;
  cursor: not-allowed;
}


/* =============================================================
   14. SECTION TRANSITION SCREEN
   ============================================================= */
.test-transition {
  position: fixed;
  inset: 0;
  background: var(--content-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
}

.test-transition__card {
  text-align: center;
  max-width: 520px;
  padding: 48px 40px;
  background: var(--panel-bg);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.test-transition__section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888888;
  margin-bottom: 8px;
}

.test-transition__section-name {
  font-size: 28px;
  font-weight: 600;
  color: #222222;
  margin-bottom: 12px;
}

.test-transition__info {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 28px;
}

.test-transition__continue-btn {
  height: 42px;
  padding: 0 36px;
  background: var(--btn-primary);
  color: var(--btn-text);
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.test-transition__continue-btn:hover {
  background: #1565c0;
}


/* =============================================================
   15. PAUSE OVERLAY
   ============================================================= */
.test-pause {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 900;
  color: #ffffff;
}

.test-pause__title {
  font-size: 32px;
  font-weight: 300;
  margin-bottom: 12px;
}

.test-pause__message {
  font-size: 14px;
  color: #bbbbbb;
  margin-bottom: 32px;
}

.test-pause__resume-btn {
  height: 44px;
  padding: 0 40px;
  background: var(--btn-primary);
  color: var(--btn-text);
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.test-pause__resume-btn:hover {
  background: #1565c0;
}


/* =============================================================
   16. CONFIRMATION DIALOG — Submit modal
   ============================================================= */
.test-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 950;
}

.test-confirm {
  background: var(--panel-bg);
  border-radius: 8px;
  padding: 32px 36px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.test-confirm__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #222222;
}

.test-confirm__message {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
  margin-bottom: 24px;
}

.test-confirm__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.test-confirm__btn {
  height: 36px;
  padding: 0 24px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.test-confirm__btn--yes {
  background: var(--btn-primary);
  color: var(--btn-text);
}

.test-confirm__btn--yes:hover {
  background: #1565c0;
}

.test-confirm__btn--no {
  background: #e0e0e0;
  color: #333333;
}

.test-confirm__btn--no:hover {
  background: #d0d0d0;
}


/* =============================================================
   17. DESKTOP-ONLY WARNING
   ============================================================= */
.test-desktop-warning {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--content-bg);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}

.test-desktop-warning__icon {
  font-size: 48px;
  margin-bottom: 20px;
  color: #999999;
}

.test-desktop-warning__title {
  font-size: 20px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 12px;
}

.test-desktop-warning__message {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

@media (max-width: 860px) {
  .test-desktop-warning {
    display: flex;
    flex-direction: column;
  }

  .test-interface > *:not(.test-desktop-warning) {
    display: none !important;
  }
}


/* =============================================================
   18. SENTENCE INSERTION MARKERS — Square markers in passage
   ============================================================= */
.test-insertion-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #333333;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 2px;
  margin: 0 3px;
  vertical-align: middle;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}

.test-insertion-marker:hover {
  background: var(--selected-blue);
}

.test-insertion-marker--selected {
  background: var(--selected-blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.3);
}


/* =============================================================
   19. VOCABULARY HIGHLIGHT — Highlighted word in passage
   ============================================================= */
.test-vocab-highlight {
  background: #c8e6ff;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 600;
  cursor: default;
  border-bottom: 2px solid var(--selected-blue);
}


/* =============================================================
   20. DRAG AND DROP — Prose summary questions
   ============================================================= */
.test-dnd {
  margin-top: 20px;
}

.test-dnd__instructions {
  font-size: 14px;
  color: #555555;
  margin-bottom: 16px;
  font-style: italic;
}

/* Source list of draggable items */
.test-dnd__source {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.test-dnd__item {
  padding: 12px 16px;
  background: #f9f9f9;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s;
  position: relative;
  user-select: none;
}

.test-dnd__item:hover {
  border-color: var(--selected-blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.test-dnd__item--dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.test-dnd__item--ghost {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: rotate(1deg);
  z-index: 600;
}

.test-dnd__handle {
  display: inline-flex;
  margin-right: 10px;
  color: #aaaaaa;
  font-size: 16px;
  vertical-align: middle;
}

/* Drop zone */
.test-dnd__drop-zone {
  min-height: 120px;
  padding: 16px;
  border: 2px dashed var(--border-color);
  border-radius: 6px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.test-dnd__drop-zone--active {
  border-color: var(--selected-blue);
  background: #e8f0fe;
}

.test-dnd__drop-zone--empty::after {
  content: "Drag answer choices here";
  color: #aaaaaa;
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

.test-dnd__drop-zone .test-dnd__item {
  background: #e8f0fe;
  border-color: #b8d4f0;
}

/* Remove button on placed items */
.test-dnd__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: #e0e0e0;
  color: #666666;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}

.test-dnd__remove:hover {
  background: #ffcdd2;
  color: #c62828;
}


/* =============================================================
   21. QUESTION TYPES — Specific layouts
   ============================================================= */

/* Question stem */
.test-question__stem {
  font-size: 15px;
  line-height: 1.6;
  color: #222222;
  margin-bottom: 8px;
}

.test-question__stem strong {
  font-weight: 600;
}

/* Question number */
.test-question__number {
  font-size: 13px;
  font-weight: 600;
  color: #888888;
  margin-bottom: 6px;
}

/* Direction text */
.test-question__directions {
  font-size: 13px;
  color: #888888;
  margin-bottom: 16px;
  font-style: italic;
  line-height: 1.5;
}

/* Passage title */
.test-passage__title {
  font-size: 18px;
  font-weight: 600;
  color: #222222;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* Passage body */
.test-passage__body {
  font-size: 15px;
  line-height: 1.75;
  color: #333333;
}

.test-passage__body p {
  margin-bottom: 16px;
  text-indent: 24px;
}

.test-passage__body p:first-child {
  text-indent: 0;
}

/* Passage paragraph highlight (for referenced paragraph) */
.test-passage__para--highlighted {
  background: #fff9c4;
  padding: 8px 12px;
  border-left: 3px solid #f9a825;
  margin-left: -12px;
  margin-right: -12px;
}

/* Table question type */
.test-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
}

.test-table th,
.test-table td {
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  text-align: left;
}

.test-table th {
  background: #f5f5f5;
  font-weight: 600;
  color: #333333;
}

.test-table td {
  background: var(--panel-bg);
}

/* Table cell with radio/checkbox centered */
.test-table__select-cell {
  text-align: center;
  width: 60px;
}

/* Listening image (lecture diagrams, etc.) */
.test-question__image {
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin: 16px 0;
}


/* =============================================================
   22. LOADING STATE
   ============================================================= */
.test-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px;
  color: #888888;
}

.test-loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--selected-blue);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.test-loading__text {
  font-size: 14px;
  color: #888888;
}


/* =============================================================
   23. PROGRESS SAVING INDICATOR — Toast
   ============================================================= */
.test-save-toast {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333333;
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-save-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.test-save-toast__check {
  color: var(--review-answered);
  font-size: 15px;
}


/* =============================================================
   UTILITY CLASSES
   ============================================================= */

/* Hidden but accessible */
.test-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll container */
.test-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c0c0c0 transparent;
}

.test-scroll::-webkit-scrollbar {
  width: 8px;
}

.test-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.test-scroll::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

.test-scroll::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Focus ring for keyboard navigation */
.test-interface *:focus-visible {
  outline: 2px solid var(--selected-blue);
  outline-offset: 2px;
}

/* Disable text selection on UI chrome */
.test-toolbar,
.test-nav,
.test-review__item,
.test-countdown {
  user-select: none;
}

/* Passage text remains selectable */
.test-passage__body {
  user-select: text;
}
