/* ===================================================
   ITBA JUNIOR KNOWLEDGE TEST - PREMIUM EDTECH THEME
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Be+Vietnam+Pro:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Color Palette - Modern Deep Indigo & Slate */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-light: #e0e7ff;
  
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.3);
  
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --amber-border: rgba(245, 158, 11, 0.3);
  
  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.12);
  --rose-border: rgba(244, 63, 94, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);
  --shadow-rose: 0 0 30px rgba(244, 63, 94, 0.35);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Be Vietnam Pro', 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Lighting */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  top: -10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
}
body::after {
  bottom: -10%;
  right: 15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1), transparent 70%);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
  z-index: 1;
}

/* Top Navigation Bar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-glow);
}

/* Base Button Styles */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glow);
}

.btn-block {
  width: 100%;
}

/* Card Container */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: border-color var(--transition-smooth);
}

/* ===================================================
   SCREEN 1: LOGIN / WELCOME
   =================================================== */
.login-screen {
  display: block;
}

.hero-banner {
  text-align: center;
  margin-bottom: 32px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.badge-tag.indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* Info Grid Pills */
.info-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.rule-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: transform var(--transition-fast);
}
.rule-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
}

.rule-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.rule-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.rule-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Login Form */
.login-form-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px;
}

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

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

.form-label span.required {
  color: var(--rose);
}

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

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-subtle);
  font-size: 1.1rem;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.8);
}
.form-input::placeholder {
  color: var(--text-subtle);
}

.error-message {
  color: var(--rose);
  font-size: 0.82rem;
  margin-top: 6px;
  display: none;
}

/* ===================================================
   SCREEN 2: TEST ARENA (ACTIVE QUIZ)
   =================================================== */
.quiz-screen {
  display: none;
}

/* Quiz Top Info Bar */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.candidate-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}
.candidate-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}
.candidate-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.candidate-class {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Circular & Bar Countdown Timer */
.timer-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.8);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.timer-circle-svg {
  width: 38px;
  height: 38px;
  transform: rotate(-90deg);
}
.timer-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}
.timer-circle-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-text-wrap {
  display: flex;
  flex-direction: column;
}
.timer-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  font-weight: 600;
}
.timer-digits {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

/* Timer Warning / Danger States */
.timer-container.warning {
  border-color: var(--amber-border);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}
.timer-container.warning .timer-circle-progress {
  stroke: var(--amber);
}
.timer-container.warning .timer-digits {
  color: var(--amber);
}

.timer-container.danger {
  border-color: var(--rose-border);
  box-shadow: var(--shadow-rose);
  animation: pulse-danger 1s infinite alternate;
}
.timer-container.danger .timer-circle-progress {
  stroke: var(--rose);
}
.timer-container.danger .timer-digits {
  color: var(--rose);
}

@keyframes pulse-danger {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* Progress Bar */
.progress-bar-wrapper {
  margin-bottom: 24px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Question Presentation Box (Chống copy) */
.question-box {
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  min-height: 380px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.question-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.level-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}
.level-badge.easy {
  background: var(--emerald-bg);
  color: #34d399;
  border: 1px solid var(--emerald-border);
}
.level-badge.medium {
  background: var(--amber-bg);
  color: #fbbf24;
  border: 1px solid var(--amber-border);
}
.level-badge.hard {
  background: var(--rose-bg);
  color: #fb7185;
  border: 1px solid var(--rose-border);
}

.topic-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.anti-copy-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.question-number-pill {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: #818cf8;
}

.question-content {
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 28px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.code-block-snippet {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: #a5f3fc;
  overflow-x: auto;
  margin: 14px 0 20px;
  white-space: pre-wrap;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Anti-copy warning toast notification */
.anti-copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(225, 29, 72, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(225, 29, 72, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
.anti-copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Options Grid */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.option-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(4px);
}

.option-item.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.option-item.selected .option-key {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.option-text {
  font-size: 0.96rem;
  color: var(--text-main);
  line-height: 1.5;
  padding-top: 3px;
  flex-grow: 1;
}

/* Action Controls Bar */
.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.auto-skip-notice {
  font-size: 0.82rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===================================================
   SCREEN 3: RESULT & PERFORMANCE REPORT
   =================================================== */
.result-screen {
  display: none;
}

.result-card-main {
  padding: 40px;
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.result-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

/* Radial / Circle Score Gauge */
.score-circle-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.score-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

.score-circle-bar {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 70;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-circle-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.score-max {
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-top: 4px;
}

.score-badge-rank {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 32px;
}
.rank-excellent {
  background: var(--emerald-bg);
  color: #34d399;
  border: 1px solid var(--emerald-border);
}
.rank-pass {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.rank-retry {
  background: var(--rose-bg);
  color: #fb7185;
  border: 1px solid var(--rose-border);
}

/* Statistics Grid */
.stat-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
  text-align: left;
}

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.stat-item-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-item-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Sync Status Box */
.sync-status-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 32px;
  font-size: 0.88rem;
  font-weight: 500;
}
.sync-status-box.success {
  background: var(--emerald-bg);
  color: #34d399;
  border: 1px solid var(--emerald-border);
}
.sync-status-box.pending {
  background: var(--amber-bg);
  color: #fbbf24;
  border: 1px solid var(--amber-border);
}
.sync-status-box.error {
  background: var(--rose-bg);
  color: #fb7185;
  border: 1px solid var(--rose-border);
}

/* Review Accordion Section */
.review-section {
  margin-top: 40px;
  text-align: left;
}

.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.review-section-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: border-color var(--transition-fast);
}
.review-card.correct-card {
  border-left: 4px solid var(--emerald);
}
.review-card.wrong-card {
  border-left: 4px solid var(--rose);
}

.review-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.review-q-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.review-answers-box {
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-ans-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-ans-label {
  color: var(--text-muted);
  width: 140px;
}
.review-ans-val {
  font-weight: 600;
}
.review-ans-val.correct {
  color: #34d399;
}
.review-ans-val.wrong {
  color: #fb7185;
}

.review-explanation {
  background: rgba(99, 102, 241, 0.08);
  border-left: 2px solid var(--primary);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #cbd5e1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===================================================
   MODAL: GOOGLE SHEET CONFIGURATION
   =================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  padding: 28px;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-main);
}

.step-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}
.step-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-light);
}
.step-list {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 20px;
  line-height: 1.7;
}

.code-copy-card {
  position: relative;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 10px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  max-height: 120px;
  overflow-y: auto;
}

.btn-copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-copy-code:hover {
  background: var(--primary);
}

/* Responsive Rules */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.65rem;
  }
  .question-box {
    padding: 20px;
  }
  .question-content {
    font-size: 1.05rem;
  }
  .login-form-wrapper {
    padding: 20px 10px;
  }
  .quiz-header {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .timer-container {
    justify-content: center;
  }
}

/* ===================================================
   ANTI-SCREENSHOT & ANTI-PRINT SECURITY SYSTEM
   =================================================== */

/* 1. Chống in ấn / Lưu PDF */
@media print {
  body * {
    visibility: hidden !important;
  }
  body::before {
    content: "TÀI LIỆU BẢO MẬT: BÀI THI ITBA JUNIOR - NGHIÊM CẤM IN ẤN HOẶC XUẤT FILE PDF DƯỚI MỌI HÌNH THỨC!" !important;
    visibility: visible !important;
    position: fixed;
    top: 40%;
    left: 10%;
    right: 10%;
    text-align: center;
    font-size: 24pt;
    font-weight: bold;
    color: #000;
  }
}

/* 2. Màn che bảo mật khi mất tiêu điểm (Snipping Tool, Win+Shift+S, chuyển tab) */
.screen-privacy-shield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  z-index: 99999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: #fff;
}
.screen-privacy-shield.active {
  display: flex;
}

.shield-icon-box {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.15);
  border: 2px solid rgba(244, 63, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  margin-bottom: 24px;
  animation: pulse-danger 1s infinite alternate;
}

.shield-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fb7185;
  margin-bottom: 12px;
}

.shield-desc {
  max-width: 580px;
  font-size: 1rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 28px;
}

.shield-violation-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: #facc15;
  font-weight: 600;
  margin-bottom: 24px;
}

.shield-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.shield-btn:hover {
  transform: translateY(-2px);
}

/* Hiệu ứng làm mờ thẻ câu hỏi khi nghi vấn chụp màn hình */
.question-box.blurred-screen {
  filter: blur(20px);
  pointer-events: none;
}

/* Huy hiệu cảnh báo vi phạm trực tiếp trên thanh làm bài thi */
.violation-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.25);
  animation: pulse-danger 1s infinite alternate;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 0 0 6px #fb7185;
}


