/* Ported 1:1 from the reference exam interface (test_system.html / Next.js exam.module.css).
   Layout, positions, and colors must not change — this is the protected exam UI. */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; background: #f0f0f0; color: #222; }

/* START SCREEN */
#start-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #1a3a5c;
  position: relative;
}
.exam-back {
  position: absolute; top: 24px; left: 24px;
  color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 600;
  text-decoration: none; padding: 6px 10px; border-radius: 4px; transition: background .15s;
}
.exam-back:hover { background: rgba(255,255,255,0.12); }
.start-card {
  background: #fff; border-radius: 8px; padding: 48px 56px; max-width: 540px; width: 90%;
  text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.start-card h1 { font-size: 22px; font-weight: 700; color: #1a3a5c; line-height: 1.4; margin-bottom: 8px; }
.start-card .subtitle { font-size: 14px; color: #666; margin-bottom: 32px; }
.start-form label { display: block; text-align: left; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 4px; margin-top: 16px; }
.start-form input, .start-form select {
  width: 100%; padding: 10px 14px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.start-form input:focus, .start-form select:focus { border-color: #1a8fc1; }
.btn-start {
  margin-top: 28px; width: 100%; padding: 14px; background: #1a8fc1; color: #fff; border: none; border-radius: 4px;
  font-size: 16px; font-weight: 700; cursor: pointer; letter-spacing: 0.5px; transition: background 0.2s;
}
.btn-start:hover:not(:disabled) { background: #1479a8; }
.btn-start:disabled { background: #aaa; cursor: default; }

/* TEST SCREEN */
#test-screen { display: none; min-height: 100vh; background: #f0f0f0; }
.test-header {
  background: #fff; border-bottom: 2px solid #e0e0e0; padding: 14px 32px; text-align: center;
  font-size: 18px; font-weight: 700; color: #1a3a5c; letter-spacing: 0.3px;
}
.test-body { display: flex; gap: 24px; max-width: 1100px; margin: 28px auto; padding: 0 20px; align-items: flex-start; }

.question-panel { flex: 1; background: #fff; border-radius: 6px; border: 1px solid #ddd; overflow: hidden; }
.question-text { padding: 22px 24px 18px; font-size: 15px; font-weight: 600; line-height: 1.55; color: #1a3a5c; border-bottom: 1px solid #eee; }
.options-list { padding: 10px 0; }
.option-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 24px; cursor: pointer; border-bottom: 1px solid #f0f0f0; transition: background 0.15s; }
.option-item:last-child { border-bottom: none; }
.option-item:hover { background: #f5fafd; }
.option-item.selected { background: #e8f4fb; }
.option-item.correct { background: #e6f9ee; }
.option-item.wrong { background: #fdecea; }

.option-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #aaa; flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s; }
.option-item.selected .option-radio { border-color: #1a8fc1; }
.option-item.selected .option-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #1a8fc1; }
.option-item.correct .option-radio { border-color: #27ae60; }
.option-item.correct .option-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #27ae60; }
.option-item.wrong .option-radio { border-color: #e74c3c; }
.option-item.wrong .option-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #e74c3c; }
.option-text { font-size: 14px; line-height: 1.5; color: #333; }

.btn-answer {
  display: block; width: calc(100% - 48px); margin: 18px 24px 22px; padding: 14px; background: #1a8fc1; color: #fff;
  border: none; border-radius: 4px; font-size: 15px; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: background 0.2s;
}
.btn-answer:hover:not(:disabled) { background: #1479a8; }
.btn-answer:disabled { background: #aaa; cursor: default; }

.sidebar { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.sidebar-box { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 16px; text-align: center; }
.timer-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.timer-value { font-size: 36px; font-weight: 700; color: #1a3a5c; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer-value.warning { color: #e67e22; }
.timer-value.danger { color: #e74c3c; }

.progress-text { font-size: 13px; color: #555; line-height: 1.6; }
.progress-text span { font-weight: 700; color: #1a3a5c; }

.btn-finish { width: 100%; padding: 12px; background: #e74c3c; color: #fff; border: none; border-radius: 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; cursor: pointer; transition: background 0.2s; }
.btn-finish:hover { background: #c0392b; }

.nav-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-nav { width: 44px; height: 44px; background: #27ae60; color: #fff; border: none; border-radius: 4px; font-size: 20px; font-weight: 700; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-nav:hover:not(:disabled) { background: #219150; }
.btn-nav:disabled { background: #bbb; cursor: default; }
.nav-counter { font-size: 15px; font-weight: 700; color: #1a3a5c; white-space: nowrap; }

/* RESULT SCREEN */
#result-screen { display: none; min-height: 100vh; background: #1a3a5c; align-items: center; justify-content: center; position: relative; }
.result-card { background: #fff; border-radius: 8px; padding: 48px 56px; max-width: 520px; width: 90%; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.2); }
.result-card h2 { font-size: 24px; color: #1a3a5c; margin-bottom: 8px; }
.result-score { font-size: 64px; font-weight: 700; margin: 20px 0 4px; }
.result-score.pass { color: #27ae60; }
.result-score.fail { color: #e74c3c; }
.result-verdict { font-size: 18px; font-weight: 600; margin-bottom: 24px; }
.result-verdict.pass { color: #27ae60; }
.result-verdict.fail { color: #e74c3c; }
.result-details { font-size: 14px; color: #666; margin-bottom: 32px; line-height: 1.8; }
.btn-restart { padding: 14px 40px; background: #1a8fc1; color: #fff; border: none; border-radius: 4px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.btn-restart:hover { background: #1479a8; }

/* Modal confirm */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-box { background: #fff; border-radius: 8px; padding: 36px 40px; max-width: 380px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.modal-box h3 { font-size: 18px; color: #1a3a5c; margin-bottom: 12px; }
.modal-box p { font-size: 14px; color: #666; margin-bottom: 28px; line-height: 1.5; }
.modal-btns { display: flex; gap: 12px; justify-content: center; }
.modal-btns button { padding: 10px 28px; border: none; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.modal-confirm { background: #e74c3c; color: #fff; }
.modal-confirm:hover { background: #c0392b; }
.modal-cancel { background: #eee; color: #333; }
.modal-cancel:hover { background: #ddd; }

@media (max-width: 700px) {
  .test-body { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .sidebar-box { flex: 1; min-width: 140px; }
  .nav-box { justify-content: center; }
}
