/* ==========================================================
   ExamLayout CSS (Screens & Components Implementation)
   ========================================================== */

/* ----------------------------------------------------------
   SCREEN 1: LAUNCHER & SYSTEM CHECK
   ---------------------------------------------------------- */
.launcher-container {
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #94a3b8;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.launcher-titlebar {
  background: #f1f5f9;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.launcher-body {
  padding: 24px 32px;
}

.launcher-mode-badge {
  text-align: center;
  margin-bottom: 20px;
}

.launcher-mode-text {
  font-size: 26px;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: 2px;
}

.launcher-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.check-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #1e293b;
}

.check-icon {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.check-label {
  width: 200px;
  font-weight: 600;
  color: #475569;
}

.check-colon {
  margin-right: 12px;
}

.check-val {
  font-weight: 500;
  color: #0f172a;
}

.launcher-footer {
  padding: 16px;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  display: flex;
  justify-content: center;
}

.btn-run {
  background: #0284c7;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 10px 48px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
  transition: all 0.15s;
}

.btn-run:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

/* ----------------------------------------------------------
   SCREEN 2: LOGIN PESERTA
   ---------------------------------------------------------- */
.login-card {
  max-width: 440px;
  padding: 36px 32px;
  margin: auto;
  border-radius: 16px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13.5px;
  color: #64748b;
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.4;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
}

.login-demo-box {
  margin-top: 24px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 12px;
  color: #475569;
  border: 1px dashed #cbd5e1;
}

/* ----------------------------------------------------------
   SCREEN 3 & 4: TWO-COLUMN CONFIRMATION PAGES
   ---------------------------------------------------------- */
.two-col-container {
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: auto;
  align-items: start;
}

@media (max-width: 840px) {
  .two-col-container {
    grid-template-columns: 1fr;
  }
}

.confirm-card {
  padding: 16px 22px 20px;
  border-radius: 12px;
}

.confirm-card-title {
  font-size: 17px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 12px;
  text-align: center;
}

.instructions-body {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.55;
}

.instructions-body ol, .instructions-body ul {
  padding-left: 18px;
  margin-top: 6px;
}

.instructions-body li {
  margin-bottom: 4px;
}

.dob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
}

.form-select {
  padding: 10px 12px;
  font-size: 13.5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1e293b;
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: #0084ff;
}

.meta-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.meta-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.meta-value {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}

/* ----------------------------------------------------------
   SCREEN 5: LEMBAR SOAL UTAMA (EXAM WORKSPACE)
   ---------------------------------------------------------- */
.exam-container {
  width: 100%;
  max-width: 1240px;
  margin: auto;
  height: calc(100vh - 64px - 32px);
  max-height: calc(100vh - 64px - 32px);
  display: flex;
  flex-direction: column;
}

.exam-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Sub-header inside exam card */
.exam-header-bar {
  flex: 0 0 auto;
  padding: 12px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  z-index: 5;
}

.question-number-box {
  display: flex;
  flex-direction: column;
}

.question-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.question-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.exam-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Red outline timer box matching screenshot */
.timer-box {
  border: 1.5px solid #ef4444;
  border-radius: 6px;
  padding: 5px 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.timer-value {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  font-family: monospace;
}

.timer-warning {
  border-color: #dc2626;
  background: #fef2f2;
  animation: pulseTimer 1s infinite;
}

@keyframes pulseTimer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Header pill buttons */
.btn-control-pill {
  background: #0090ff;
  color: #ffffff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-control-pill:hover {
  background: #0077e6;
}

/* Font scaler */
.font-scaler {
  font-size: 12.5px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.font-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "Times New Roman", Times, serif;
  font-weight: bold;
  color: #1e293b;
  padding: 0 3px;
  transition: color 0.15s;
}

.font-btn:hover, .font-btn.active {
  color: #0084ff;
  text-decoration: underline;
}

.font-btn.small { font-size: 13px; }
.font-btn.medium { font-size: 16px; }
.font-btn.large { font-size: 20px; }

/* Exam Content Area - Scrollable Question Display */
.exam-content-box {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 24px 28px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.exam-content-box::-webkit-scrollbar {
  width: 9px;
}
.exam-content-box::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}
.exam-content-box::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}
.exam-content-box::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Responsive Question Image + Click-to-Zoom */
.question-image-box {
  margin: 10px 0 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.question-image-img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(300px, 40vh);
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  object-fit: contain;
  background: #ffffff;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.question-image-img:hover {
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
}

.question-image-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  user-select: none;
}

.stimulus-card img,
.question-text-box img,
.option-text img {
  max-width: 100%;
  height: auto;
  max-height: min(280px, 38vh);
  object-fit: contain;
  cursor: zoom-in;
}

@media (max-height: 820px) {
  .exam-container {
    height: calc(100vh - 64px - 20px);
    max-height: calc(100vh - 64px - 20px);
  }
  .exam-header-bar {
    padding: 8px 20px 6px;
  }
  .exam-content-box {
    padding: 12px 20px 24px;
  }
  .stimulus-card {
    padding: 12px 16px;
    margin-bottom: 12px;
    max-height: 220px;
  }
  .question-image-img {
    max-height: min(230px, 34vh);
  }
  .exam-footer-bar {
    padding: 8px 20px;
  }
}

.stimulus-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  margin-bottom: 24px;
  max-height: 480px;
  overflow-y: auto;
}

.stimulus-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  margin-bottom: 14px;
}

.stimulus-text {
  font-size: var(--font-scale-content);
  color: #334155;
  line-height: 1.7;
}

.stimulus-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: var(--font-scale-content);
}

.stimulus-table th, .stimulus-table td {
  border: 1px solid #94a3b8;
  padding: 8px 12px;
  text-align: left;
}

.stimulus-table th {
  background-color: #f1f5f9;
  font-weight: 700;
}

.question-text-box {
  font-size: var(--font-scale-content);
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Choices Styles */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #ffffff;
}

.option-item:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.option-item.selected {
  background: #eff6ff;
  border-color: #0084ff;
}

.option-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.option-item.selected .option-circle {
  border-color: #0084ff;
}

.option-circle-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}

.option-item.selected .option-circle-inner {
  background: #0084ff;
}

.option-label {
  font-weight: 700;
  color: #1e293b;
  font-size: var(--font-scale-content);
  margin-right: 4px;
}

.option-text {
  font-size: var(--font-scale-content);
  color: #334155;
  line-height: 1.5;
}

/* Multiple Choice Complex (Checkbox) */
.option-item.checkbox .option-circle {
  border-radius: 4px;
}
.option-item.checkbox.selected .option-circle-inner {
  border-radius: 2px;
}

/* 3. Pilihan Ganda Kompleks Kategori (Tabel Pernyataan Respons Biner) */
.pg-kategori-container {
  margin-top: 18px;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pg-kategori-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-scale-content);
  text-align: left;
}

.pg-kategori-table thead th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
}

.pg-kategori-table thead th:last-child {
  border-right: none;
}

.pg-kategori-table th.col-no {
  width: 50px;
  text-align: center;
}

.pg-kategori-table th.col-statement {
  width: auto;
}

.pg-kategori-table th.col-category {
  width: 120px;
  text-align: center;
  font-size: 13.5px;
  letter-spacing: 0.3px;
}

.pg-kategori-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.15s;
}

.pg-kategori-table tbody tr:last-child {
  border-bottom: none;
}

.pg-kategori-table tbody tr:hover {
  background: #f8fafc;
}

.pg-kategori-table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  border-right: 1px solid #e2e8f0;
}

.pg-kategori-table tbody td:last-child {
  border-right: none;
}

.pg-kategori-table td.cell-no {
  text-align: center;
  font-weight: 600;
  color: #64748b;
}

.pg-kategori-table td.cell-statement {
  color: #334155;
  line-height: 1.6;
}

.pg-kategori-table td.cell-radio {
  text-align: center;
  background: #fafafa;
}

.kategori-radio-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  padding: 6px;
}

.kategori-radio-label input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #0084ff;
}

.kategori-radio-text-mobile {
  display: none;
}

@media (max-width: 640px) {
  .pg-kategori-table th.col-category {
    width: 85px;
    font-size: 12.5px;
    padding: 10px 8px;
  }
  .pg-kategori-table tbody td {
    padding: 10px 8px;
  }
}

/* Exam Footer Navigation - Pinned at bottom */
.exam-footer-bar {
  flex: 0 0 auto;
  padding: 12px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  z-index: 5;
}

.btn-nav-prev {
  background-color: #ef4444;
  color: #ffffff;
  border-radius: 24px;
  padding: 10px 24px;
  font-weight: 700;
  font-size: 14px;
}
.btn-nav-prev:hover:not(:disabled) {
  background-color: #dc2626;
}
.btn-nav-prev:disabled {
  background-color: #fca5a5;
  opacity: 0.6;
}

.btn-nav-doubt {
  background-color: #f59e0b;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.15s;
}
.btn-nav-doubt:hover {
  background-color: #d97706;
}
.btn-nav-doubt input[type="checkbox"] {
  cursor: pointer;
  accent-color: #0284c7;
}

.btn-nav-next {
  background-color: #0090ff;
  color: #ffffff;
  border-radius: 24px;
  padding: 10px 24px;
  font-weight: 700;
  font-size: 14px;
}
.btn-nav-next:hover {
  background-color: #0077e6;
}

.btn-nav-finish {
  background-color: #0090ff;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 32px;
  font-weight: 800;
  font-size: 14px;
}
.btn-nav-finish:hover {
  background-color: #0077e6;
}

/* ----------------------------------------------------------
   QUESTION GRID MODAL (Daftar Soal Popup)
   ---------------------------------------------------------- */
.question-grid-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 10px 4px;
}

@media (min-width: 540px) {
  .question-grid-container {
    grid-template-columns: repeat(8, 1fr);
  }
}

.grid-cell {
  height: 48px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.grid-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.grid-cell.answered {
  background: #0084ff;
  color: #ffffff;
  border-color: #0077e6;
}

.grid-cell.doubt {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
}

.grid-cell.active-item {
  box-shadow: 0 0 0 3px #22c55e;
}

.grid-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.legend-badge {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
