/* ==========================================================================
   SIMULASI TKA JENJANG SD - CBT PUSMENDIK / ANBK THEME
   Super Lightweight, Ultra Fast, Zero External Dependencies
   ========================================================================== */

:root {
  --primary-blue: #1d68f2;
  --primary-hover: #1557d0;
  --header-dark: #0a4699;
  --header-light: #1b6bd6;
  --header-poly-1: #1355b8;
  --header-poly-2: #0e48a1;
  --header-poly-3: #2275e6;
  --accent-yellow: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-label: #334155;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --exam-font-scale: 1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   TOP HEADER (Pusmendik ANBK Polygonal Banner)
   ========================================================================== */
.anbk-header {
  position: relative;
  background: linear-gradient(135deg, var(--header-dark) 0%, var(--header-poly-1) 50%, var(--header-poly-3) 100%);
  color: #ffffff;
  padding: 16px 28px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

/* Geometric Polygon Facet Overlay */
.anbk-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255,255,255,0.08) 0%, transparent 40%),
    linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.06) 40%, rgba(255,255,255,0.06) 60%, transparent 60%),
    linear-gradient(-35deg, transparent 55%, rgba(0,0,0,0.12) 55%, rgba(0,0,0,0.12) 80%, transparent 80%);
  pointer-events: none;
}

.anbk-header-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.anbk-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.anbk-logo-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  flex-shrink: 0;
  padding: 3px;
}

.anbk-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.anbk-title-box {
  display: flex;
  flex-direction: column;
}

.anbk-title-main {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.2;
}

.anbk-title-sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.2px;
}

.anbk-user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.anbk-user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.anbk-user-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.anbk-logout-btn {
  background: rgba(239, 68, 68, 0.85);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.anbk-logout-btn:hover {
  background: #dc2626;
  text-decoration: none;
}

/* ==========================================================================
   CONFIRMATION CARD (Matching user's reference screenshot!)
   ========================================================================== */
.confirm-hero-section {
  position: relative;
  background: linear-gradient(135deg, var(--header-dark) 0%, var(--header-poly-1) 50%, var(--header-poly-3) 100%);
  padding-bottom: 90px;
  overflow: hidden;
}

.confirm-hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 10% 40%, rgba(255,255,255,0.09) 0%, transparent 40%),
    linear-gradient(55deg, transparent 35%, rgba(255,255,255,0.06) 35%, rgba(255,255,255,0.06) 65%, transparent 65%),
    linear-gradient(-35deg, transparent 50%, rgba(0,0,0,0.12) 50%, rgba(0,0,0,0.12) 80%, transparent 80%);
  pointer-events: none;
}

.confirm-page-container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px 50px 16px;
  background-color: #ffffff;
}

.confirm-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 38px 44px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.7);
  overflow: hidden;
  margin-top: -65px;
  z-index: 20;
}

/* Tut Wuri Watermark background in the card */
.confirm-card-watermark {
  position: absolute;
  top: 10%;
  right: -30px;
  width: 330px;
  height: 330px;
  background-image: url('../images/tutwuri.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.07;
  pointer-events: none;
  z-index: 1;
}

.confirm-card-body {
  position: relative;
  z-index: 2;
}

.confirm-card-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 26px;
  letter-spacing: -0.3px;
}

.confirm-item {
  margin-bottom: 22px;
}

.confirm-item-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}

.confirm-item-value {
  font-size: 1.2rem;
  font-weight: 500;
  color: #0f172a;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #e2e8f0;
}

/* The Blue Pill "Mulai" Button */
.btn-mulai {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 13px 28px;
  background: #2563eb;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease-in-out;
}

.btn-mulai:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  color: #ffffff;
  text-decoration: none;
}

.btn-mulai:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Exam Selector if multiple exams */
.exam-switch-box {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  font-size: 0.85rem;
}
.exam-select-dropdown {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  margin-top: 6px;
  background: #ffffff;
}

/* ==========================================================================
   LOGIN PAGE STYLING
   ========================================================================== */
.login-page-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(circle at 50% 20%, #eef2ff 0%, var(--bg-page) 70%);
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  padding: 38px 40px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--header-dark), var(--primary-blue), #38bdf8);
}

.login-header-group {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-circle {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px auto;
  border-radius: 50%;
  background: #f0f7ff;
  border: 2px solid #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.login-logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-label);
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--primary-blue);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 104, 242, 0.28);
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-login:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.demo-account-box {
  margin-top: 24px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  font-size: 0.825rem;
}

.demo-account-box p {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.demo-btn-pill {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #bae6fd;
  cursor: pointer;
  transition: all 0.15s;
}
.demo-btn-pill:hover {
  background: #bae6fd;
}

.alert-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 18px;
}
.alert-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ==========================================================================
   EXAM INTERFACE (CBT Pusmendik ANBK Layout)
   ========================================================================== */
.exam-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #f1f5f9;
}

/* Top Toolbar: Soal No, Font Size, Sisa Waktu, Daftar Soal */
.exam-subbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.soal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e2e8f0;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.font-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-font {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-font:hover, .btn-font.active {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-label);
  background: #f8fafc;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.timer-countdown {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0284c7;
}

.timer-warning .timer-countdown {
  color: var(--accent-red);
  animation: pulse 1s infinite;
}

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

.btn-daftar-soal {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  transition: background 0.15s;
}
.btn-daftar-soal:hover {
  background: #0369a1;
}

/* Exam Content Area */
.exam-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 20px auto;
  padding: 0 16px;
  display: flex;
  gap: 20px;
  position: relative;
}

.question-sheet {
  flex: 1;
  background: #ffffff;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
  font-size: calc(1rem * var(--exam-font-scale));
}

.stimulus-card {
  background: #f8fafc;
  border-left: 4px solid var(--primary-blue);
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 22px;
  line-height: 1.6;
  white-space: pre-line;
  color: #334155;
  font-size: 0.95em;
}

.question-text {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 20px;
  line-height: 1.5;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.option-item:hover {
  background: #f8fafc;
  border-color: #93c5fd;
}

.option-item.selected {
  background: #eff6ff;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 1px var(--primary-blue);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85em;
  color: #475569;
  flex-shrink: 0;
  transition: all 0.15s;
}

.option-item.selected .option-letter {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #ffffff;
}

.option-text {
  flex: 1;
  color: #1e293b;
  line-height: 1.4;
  padding-top: 2px;
}

/* Exam Bottom Action Bar */
.exam-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 14px 28px;
  margin-top: auto;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
}

.exam-footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-nav {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.925rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-nav:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-next {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
}
.btn-next:hover:not(:disabled) {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-finish {
  background: var(--accent-green);
  color: #ffffff;
  border-color: var(--accent-green);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-finish:hover {
  background: #059669;
}

.ragu-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #b45309;
  font-size: 0.9rem;
  user-select: none;
}

.ragu-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-yellow);
  cursor: pointer;
}

/* Question Grid Drawer / Modal */
.drawer-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 100;
}

.question-drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 101;
  transition: right 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
}

.question-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.drawer-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.btn-close-drawer {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.q-btn {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.q-btn:hover {
  border-color: #3b82f6;
  transform: scale(1.05);
}

.q-btn.current {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px #0f172a;
}

.q-btn.answered {
  background: #3b82f6;
  color: #ffffff;
  border-color: #2563eb;
}

.q-btn.ragu {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
}

.q-ans-badge {
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 2px;
}

.drawer-legend {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.swatch-blank { background: #ffffff; border: 1.5px solid #cbd5e1; }
.swatch-answered { background: #3b82f6; }
.swatch-ragu { background: #f59e0b; }

/* Modal Confirm Submit */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.active {
  display: flex;
}
.modal-card {
  background: #ffffff;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   RESULT & REVIEW PAGE
   ========================================================================== */
.result-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 36px 40px;
  max-width: 800px;
  margin: 30px auto;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.score-banner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  padding: 24px;
  border-radius: 12px;
  margin: 24px 0;
  border: 1px solid #bfdbfe;
}

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--primary-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(29, 104, 242, 0.2);
}

.score-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-blue);
  line-height: 1;
}

.score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.review-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
  background: #ffffff;
}

.review-correct {
  border-left: 4px solid var(--accent-green);
}
.review-wrong {
  border-left: 4px solid var(--accent-red);
}

/* ==========================================================================
   INTERACTIVE QUESTION FORMATS (MENJODOHKAN & DRAG AND DROP)
   ========================================================================== */
.match-instructions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #166534;
  margin-bottom: 20px;
  line-height: 1.5;
}
.match-instructions .inst-icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* Matching Board (Mencocokkan Kiri dan Kanan) */
.matching-container {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

.col-header-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.matching-pairs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-premise-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.match-premise-row:hover {
  border-color: #cbd5e1;
}

.premise-text-box {
  flex: 1.2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 500;
}
.premise-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.match-arrow-indicator {
  color: #94a3b8;
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Target Dropzone */
.match-dropzone {
  flex: 1;
  min-height: 44px;
  border: 2px dashed #94a3b8;
  border-radius: 6px;
  padding: 4px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.match-dropzone.empty {
  border-color: #cbd5e1;
  background: #fafafa;
}
.match-dropzone.empty:hover {
  border-color: var(--primary-blue);
  background: #eff6ff;
}
.match-dropzone.drag-over {
  border-color: #0284c7 !important;
  background: #e0f2fe !important;
  transform: scale(1.02);
}
.match-dropzone.target-highlight {
  border-color: #2563eb !important;
  background: #dbeafe !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.match-dropzone.has-item {
  border: 2px solid #0d9488;
  background: #f0fdfa;
}

.dropzone-placeholder {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  font-style: italic;
  pointer-events: none;
}

.match-placed-card {
  width: 100%;
  background: #ccfbf1;
  border: 1px solid #5eead4;
  color: #0f766e;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: grab;
}
.match-placed-card:active {
  cursor: grabbing;
}
.btn-remove-pair {
  background: none;
  border: none;
  color: #0f766e;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}
.btn-remove-pair:hover {
  background: #99f6e4;
  color: #115e59;
}

/* Right Answer Pool */
.match-bank-pool {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
}

.match-bank-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  cursor: grab;
  user-select: none;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.match-bank-card:active {
  cursor: grabbing;
}
.match-bank-card:hover:not(.is-used) {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(2, 132, 199, 0.15);
}
.match-bank-card.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px #2563eb;
}
.match-bank-card.is-used {
  opacity: 0.35;
  background: #e2e8f0;
  border-color: #cbd5e1;
  cursor: not-allowed;
  text-decoration: line-through;
}
.bank-card-bullet {
  color: #0284c7;
  font-size: 0.8rem;
}
.bank-card-text {
  flex: 1;
}
.bank-card-drag-hint {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Drag and Drop Category Layout */
.dragdrop-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dd-targets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.dd-target-box {
  background: #f8fafc;
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  cursor: pointer;
  min-height: 140px;
}
.dd-target-box:hover {
  border-color: var(--primary-blue);
  background: #f1f5f9;
}
.dd-target-box.drag-over {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  transform: scale(1.01);
}
.dd-target-box.target-highlight {
  border-color: #2563eb !important;
  background: #dbeafe !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.dd-target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}
.dd-target-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}
.dd-target-count {
  font-size: 0.75rem;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.dd-target-dropzone {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  min-height: 60px;
}

.dd-empty-placeholder {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8rem;
  font-style: italic;
  min-height: 50px;
  pointer-events: none;
}

.dd-placed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.dd-placed-chip:active {
  cursor: grabbing;
}
.btn-remove-chip {
  background: none;
  border: none;
  color: #1e40af;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 50%;
}
.btn-remove-chip:hover {
  background: #bfdbfe;
  color: #1e3a8a;
}

/* Pool of Draggable Items */
.dd-pool-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.dd-pool-header {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 12px;
}

.dd-items-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  cursor: grab;
  user-select: none;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dd-chip:active {
  cursor: grabbing;
}
.dd-chip:hover:not(.is-assigned) {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
}
.dd-chip.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px #2563eb;
}
.dd-chip.is-assigned {
  opacity: 0.35;
  background: #f1f5f9;
  border-color: #cbd5e1;
  cursor: not-allowed;
  text-decoration: line-through;
}
.chip-grab-icon {
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .matching-container {
    grid-template-columns: 1fr;
  }
  .confirm-card {
    padding: 28px 24px;
  }
  .confirm-card-watermark {
    width: 200px;
    height: 200px;
    right: -40px;
  }
  .anbk-header {
    padding: 12px 16px;
  }
  .anbk-title-main {
    font-size: 1.1rem;
  }
  .exam-subbar {
    padding: 8px 14px;
    flex-wrap: wrap;
  }
  .question-sheet {
    padding: 20px 18px;
  }
  .exam-footer {
    padding: 12px 14px;
  }
}

