/* Candidate Dashboard */
.page { padding: 32px; max-width: 1200px; margin: 0 auto; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin: 0; }

.loading-center { display: flex; flex-direction: column; align-items: center; padding: 80px 20px; gap: 16px; }
.loading-text { font-size: 14px; color: var(--text-muted); }

.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.quiz-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; height: 100%; box-sizing: border-box; }
.quiz-card.taken { opacity: 0.85; }
.quiz-card-header { display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; }

.quiz-icon-wrap {
  width: 40px; height: 40px; border-radius: var(--radius-md); flex-shrink: 0;
  background: var(--accent-primary-light); display: flex; align-items: center; justify-content: center;
}
.quiz-icon-wrap .material-symbols-rounded { font-size: 22px; color: var(--accent-primary); }
.quiz-icon-wrap.completed { background: var(--success-light); }
.quiz-icon-wrap.completed .material-symbols-rounded { color: var(--success); }

.quiz-meta { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; justify-content: flex-start; align-items: center; min-width: 0; margin-left: 4px; width: 100%; }

.difficulty-badge { margin-left: auto; }

.quiz-meta .badge {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 15vw;
}
@media (max-width: 768px) {
  .quiz-meta .badge { max-width: 40vw; }
}

.quiz-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }

.quiz-details { display: flex; gap: 16px; margin-bottom: 8px; }
.quiz-detail { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); }
.quiz-detail .material-symbols-rounded { font-size: 16px; }

.quiz-result { display: flex; flex-direction: column; gap: 6px; }
.result-bar-track { width: 100%; height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; }
.result-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.fill-good { background: var(--success); }
.fill-avg { background: var(--warning); }
.fill-poor { background: var(--danger); }
.result-score { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.quiz-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

/* Start Assessment Button */
.start-assessment-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.start-assessment-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 110, 247, 0.35);
}
.start-assessment-btn .material-symbols-rounded { font-size: 18px; }

/* ════════════════════════════════════════════════════════
   Pre-Quiz Policy Modal
   ════════════════════════════════════════════════════════ */

.policy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: policyFadeIn 0.25s ease;
}

@keyframes policyFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes policySlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.policy-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255,255,255,0.05);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: policySlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

/* ── Header ── */
.policy-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.policy-shield-wrap {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-primary-light), rgba(124, 92, 252, 0.12));
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-color);
}
.policy-shield-icon {
  font-size: 28px !important;
  color: var(--accent-primary);
}
.policy-header-text { flex: 1; }
.policy-header-text h2 {
  margin: 0 0 4px;
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
}
.policy-header-text p {
  margin: 0;
  font-size: 13px; color: var(--text-muted);
}
.policy-close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.policy-close-btn:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger-border); }
.policy-close-btn .material-symbols-rounded { font-size: 20px; }

/* ── Warning Banner ── */
.policy-warning-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: var(--warning-light);
  border-bottom: 1px solid var(--warning-border);
  font-size: 13px;
  color: var(--warning);
  font-weight: 600;
  flex-shrink: 0;
}
.policy-warning-banner .material-symbols-rounded { font-size: 18px; flex-shrink: 0; }

/* ── Body ── */
.policy-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.policy-body::-webkit-scrollbar { width: 5px; }
.policy-body::-webkit-scrollbar-track { background: transparent; }
.policy-body::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

.policy-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-secondary);
  margin: 0 0 16px;
}
.policy-section-title .material-symbols-rounded { font-size: 18px; color: var(--accent-primary); }

/* ── Rule Cards Grid ── */
.policy-rules-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.policy-rule-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.policy-rule-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.policy-rule-card.danger-card {
  background: var(--danger-light);
  border-color: var(--danger-border);
}

/* Rule icon variants */
.rule-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.rule-icon-wrap .material-symbols-rounded { font-size: 20px; }
.rule-icon-wrap.fullscreen  { background: rgba(79, 110, 247, 0.12); color: var(--accent-primary); }
.rule-icon-wrap.fullscreen .material-symbols-rounded { color: var(--accent-primary); }
.rule-icon-wrap.tabs        { background: rgba(245, 158, 11, 0.12); }
.rule-icon-wrap.tabs .material-symbols-rounded { color: var(--warning); }
.rule-icon-wrap.window      { background: rgba(59, 130, 246, 0.12); }
.rule-icon-wrap.window .material-symbols-rounded { color: var(--info); }
.rule-icon-wrap.search      { background: rgba(124, 92, 252, 0.12); }
.rule-icon-wrap.search .material-symbols-rounded { color: #7c5cfc; }
.rule-icon-wrap.copy        { background: rgba(34, 197, 94, 0.12); }
.rule-icon-wrap.copy .material-symbols-rounded { color: var(--success); }
.rule-icon-wrap.auto-submit { background: rgba(239, 68, 68, 0.12); }
.rule-icon-wrap.auto-submit .material-symbols-rounded { color: var(--danger); }

.rule-content { flex: 1; min-width: 0; }
.rule-content h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.rule-content p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.rule-content kbd {
  display: inline-block;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg-tertiary); border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 600; color: var(--text-primary);
  font-family: monospace;
}

.violation-chip {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px; font-weight: 700;
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
}
.violation-chip.danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* ── Violation Tracker ── */
.policy-tracker {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 20px;
}
.tracker-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-muted);
  margin-bottom: 16px;
}
.tracker-steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.tracker-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  flex: 1;
}
.tracker-step small { display: block; color: var(--text-muted); font-size: 11px; font-weight: 400; }
.tracker-connector {
  height: 3px;
  flex: 0 0 40px;
  background: var(--border-color);
  border-radius: 2px;
  margin-bottom: 28px;
}
.tracker-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid var(--border-strong);
  background: var(--bg-card);
  transition: all 0.3s;
}
.tracker-dot.warn   { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 10px rgba(245,158,11,0.4); }
.tracker-dot.danger { background: var(--danger);  border-color: var(--danger);  box-shadow: 0 0 10px rgba(239,68,68,0.4);  }

/* ── Footer ── */
.policy-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.policy-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  transition: all 0.25s;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  user-select: none;
}
.policy-checkbox-label.checked {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  color: var(--text-primary);
}
.policy-checkbox-label:hover { border-color: var(--border-strong); }

.policy-checkbox {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid var(--border-strong);
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
}
.policy-checkbox.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.policy-checkbox .material-symbols-rounded { font-size: 15px !important; color: #fff; }

.policy-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.policy-begin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  font-size: 14px; font-weight: 700;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.policy-begin-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 110, 247, 0.4);
}
.policy-begin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.policy-begin-btn .material-symbols-rounded { font-size: 18px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .page { padding: 20px; }
  .quiz-grid { grid-template-columns: 1fr; }
  .policy-modal { max-height: 95vh; }
  .policy-modal-header { padding: 18px 20px; gap: 12px; }
  .policy-body { padding: 18px 20px; }
  .policy-footer { padding: 16px 20px; }
  .policy-actions { flex-direction: column-reverse; }
  .policy-actions .btn { width: 100%; justify-content: center; }
  .tracker-steps { gap: 4px; }
  .tracker-connector { flex: 0 0 20px; }
}
