/* Modern clean styling with lightweight animations for SMP English Quiz Assessment */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #4f46e5;
  --accent: #059669;
  --accent-light: #ecfdf5;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  position: relative;
  box-sizing: border-box;
  background-color: #f1f5f9;
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Prevent auto-zoom and shift on iOS Safari */
input, select, textarea, button {
  font-family: inherit;
  font-size: 16px;
}

/* SVG Icon Helper */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Lightweight Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes floatGently {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-pop-in {
  animation: popIn 0.25s ease-out forwards;
}

.shake-error {
  animation: shakeAnim 0.35s ease-in-out !important;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
}

/* Header Banner */
.quiz-header-banner {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: white;
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  animation: fadeIn 0.35s ease-out;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  width: 100%;
}

.header-title-box {
  flex: 1 1 300px;
  min-width: 0;
}

.header-title-box h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
  word-break: break-word;
}

.header-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Student Badge & Status Card */
.student-status-card {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease;
}

.student-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.student-name-display {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.student-meta-display {
  font-size: 0.85rem;
  opacity: 0.92;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-active {
  background-color: #fef08a;
  color: #854d0e;
}

.status-completed {
  background-color: #bbf7d0;
  color: #166534;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.3; transform: scale(0.85); }
}

/* Reading Passage Card */
.passage-card {
  width: 100%;
  max-width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 1.65rem;
  border-left: 5px solid #2563eb;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  box-sizing: border-box;
  scroll-margin-top: 16px;
  animation: fadeIn 0.35s ease-out;
}

.passage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.passage-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2563eb;
  background: var(--primary-light);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.passage-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
}

.passage-body p {
  margin-bottom: 0.85rem;
  font-size: 1rem;
  color: var(--gray-700);
  text-align: justify;
  line-height: 1.75;
}

.passage-body p:last-child {
  margin-bottom: 0;
}

/* Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.75rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

/* Section Header */
.section-card-header {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--gray-200);
  box-sizing: border-box;
  animation: fadeIn 0.3s ease-out;
}

.section-card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
}

.section-badge-info {
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--gray-300);
}

/* Question Card */
.question-card {
  width: 100%;
  max-width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--gray-200);
  box-sizing: border-box;
  scroll-margin-top: 16px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  animation: fadeIn 0.3s ease-out;
}

.question-card:hover {
  box-shadow: var(--shadow-md);
}

.question-card.answered {
  border-color: #93c5fd;
  background-color: #fafcff;
}

.question-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.question-number-badge {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.question-points {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 700;
  background: var(--gray-100);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
  white-space: pre-line;
  word-break: break-word;
}

/* Options */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.option-item {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  padding: 0.85rem 1.15rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  cursor: pointer;
  background: white;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

@media (hover: hover) and (pointer: fine) {
  .option-item:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
  }
}

.option-item.selected {
  border-color: #2563eb;
  background-color: #eff6ff;
  color: #1e40af;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.option-radio {
  margin-right: 0.85rem;
  accent-color: #2563eb;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.option-key {
  font-weight: 800;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.option-content {
  word-break: break-word;
}

/* True / False Buttons */
.tf-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.tf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: white;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .tf-btn:hover {
    border-color: var(--gray-400);
    background-color: var(--gray-50);
  }
}

.tf-btn.selected-true {
  border-color: #10b981;
  background-color: #ecfdf5;
  color: #065f46;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.tf-btn.selected-false {
  border-color: #ef4444;
  background-color: #fef2f2;
  color: #991b1b;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

/* Essay Textarea */
.essay-textarea {
  width: 100%;
  max-width: 100%;
  min-height: 110px;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 16px !important;
  color: var(--gray-800);
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.essay-textarea:focus {
  outline: none;
  border-color: #2563eb;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.essay-info-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.4rem;
}

/* Sidebar Navigator */
.sidebar-sticky {
  position: sticky;
  top: 1.5rem;
  width: 100%;
  max-width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  box-sizing: border-box;
  animation: fadeIn 0.35s ease-out;
}

.navigator-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-bar-container {
  background-color: var(--gray-200);
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  width: 100%;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #2563eb, #10b981);
  height: 100%;
  width: 0%;
  transition: width 0.35s ease;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.nav-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: white;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .nav-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
  }
}

.nav-btn.answered {
  background-color: #2563eb;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.nav-legend {
  font-size: 0.75rem;
  color: var(--gray-600);
  display: flex;
  justify-content: space-around;
  margin-bottom: 1.25rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--gray-100);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-answered {
  background: #2563eb;
}

.legend-unanswered {
  background: white;
  border: 1.5px solid var(--gray-400);
}

.btn-quick-passage {
  width: 100%;
  padding: 0.7rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
}

/* Submit Action Box */
.submit-box {
  width: 100%;
  max-width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-top: 2rem;
  border: 1px solid var(--gray-200);
  box-sizing: border-box;
  animation: fadeIn 0.35s ease-out;
}

.submit-box h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.submit-box p {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn-submit-main {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  border: none;
  padding: 0.95rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  box-sizing: border-box;
}

@media (hover: hover) and (pointer: fine) {
  .btn-submit-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
  }
}

/* Footer */
.quiz-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--gray-500);
  font-size: 0.85rem;
  border-top: 1px solid var(--gray-200);
  margin-top: 3rem;
  width: 100%;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-content {
  background: white;
  border-radius: 18px;
  max-width: 500px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  animation: popIn 0.25s ease-out;
}

.modal-content.large {
  max-width: 860px;
}

.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
}

.modal-header p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
  width: 100%;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 16px !important;
  color: var(--gray-800);
  background-color: white;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  background-color: #2563eb;
  color: white;
  border: none;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background-color: #1d4ed8;
  }
}

/* Result Modal & Score Cards */
.result-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.score-display-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #bfdbfe;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.score-big {
  font-size: 3.5rem;
  font-weight: 900;
  color: #1e40af;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.score-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-parts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.score-part-item {
  background: white;
  border: 1px solid var(--gray-200);
  padding: 0.75rem 0.5rem;
  border-radius: 8px;
  text-align: center;
  box-sizing: border-box;
}

.score-part-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
}

.score-part-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-800);
}

.hidden {
  display: none !important;
}

/* Dashboard Guru styling */
.badge-class {
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: inline-block;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  text-align: left;
  font-size: 0.9rem;
}

.custom-table th {
  background: #f8fafc;
  padding: 0.9rem 1rem;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--gray-800);
}

.btn-danger {
  background-color: #fee2e2;
  color: #dc2626;
}

/* PIN Protection Modal & Keypad (Dashboard Guru) */
.pin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  box-sizing: border-box;
}

.pin-card {
  background: white;
  border-radius: 20px;
  max-width: 360px;
  width: 100%;
  padding: 2rem 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  text-align: center;
  box-sizing: border-box;
  animation: popIn 0.25s ease-out;
}

.pin-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.pin-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.3rem;
}

.pin-subtitle {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 1.35rem;
}

.pin-dots-display {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: white;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: #2563eb;
  border-color: #2563eb;
  transform: scale(1.15);
}

.pin-dot.error {
  background: #ef4444;
  border-color: #ef4444;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
  width: 100%;
}

.keypad-btn {
  aspect-ratio: 1.35;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-800);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.keypad-btn:active {
  background: #dbeafe;
}

.keypad-btn.action-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  background: transparent;
  border-color: transparent;
}

.pin-error-msg {
  font-size: 0.85rem;
  color: #dc2626;
  font-weight: 600;
  min-height: 1.25rem;
  margin-bottom: 0.5rem;
}

/* ======================================================== */
/* DEVICE MOBILE OPTIMIZATIONS (Eliminate Any Offset / Shift) */
/* ======================================================== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
  }

  .main-layout aside {
    order: 2;
    width: 100%;
  }

  .sidebar-sticky {
    position: static;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0.65rem 0.5rem;
    width: 100%;
    max-width: 100vw;
  }

  .quiz-header-banner {
    padding: 1.25rem 0.9rem;
    border-radius: 10px;
    margin-bottom: 1rem;
  }

  .header-top {
    flex-direction: column;
    gap: 0.9rem;
  }

  .header-title-box h1 {
    font-size: 1.3rem;
    line-height: 1.25;
  }

  .student-status-card {
    width: 100%;
    padding: 0.75rem 0.9rem;
  }

  .passage-card {
    padding: 1.15rem 0.9rem;
    margin-bottom: 1.15rem;
    border-radius: 10px;
  }

  .passage-title {
    font-size: 1.15rem;
  }

  .section-card-header {
    padding: 0.9rem;
    border-radius: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .section-card-header h2 {
    font-size: 1.05rem;
  }

  .question-card {
    padding: 1.15rem 0.85rem;
    border-radius: 10px;
    margin-bottom: 1rem;
  }

  .question-text {
    font-size: 0.98rem;
  }

  .option-item {
    padding: 0.75rem 0.85rem;
    font-size: 0.92rem;
  }

  .tf-container {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .tf-btn {
    padding: 0.85rem;
  }

  .submit-box {
    padding: 1.5rem 1rem;
    margin-top: 1.25rem;
    border-radius: 10px;
  }

  .btn-submit-main {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }

  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-content {
    padding: 1.25rem 1rem;
    border-radius: 14px;
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
  }

  .pin-card {
    padding: 1.4rem 1rem;
    max-width: 320px;
  }

  .score-parts-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .score-big {
    font-size: 2.75rem;
  }

  .guru-header {
    padding: 1.25rem 0.9rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .stat-card {
    padding: 0.9rem 0.75rem;
  }

  .stat-card-number {
    font-size: 1.6rem;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .tabs-bar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  .tab-pill {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
  }

  .search-wrap, .search-input {
    width: 100%;
  }
}
