* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  background: #f4f6f9;
  color: #1f2937;
}

.exam-page h1 {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.exam-wrapper {
  min-height: 100vh;

  display: flex;
  justify-content: center;

  padding: 50px 20px;
}

.exam-container {
  width: 100%;
  max-width: 760px;
}

.exam-header {
  text-align: center;
  margin-bottom: 35px;
}

.exam-label {
  display: inline-block;

  margin-bottom: 10px;

  font-size: 0.8rem;
  font-weight: 700;

  letter-spacing: 0.12em;

  color: #6b7280;
}

.exam-header h1 {
  margin: 0;

  font-size: 2.6rem;

  color: #111827;
}

.exam-header p {
  margin-top: 12px;

  font-size: 1.05rem;

  color: #6b7280;
}

.exam-panel {
  background: white;

  padding: 34px;

  border-radius: 22px;

  border: 1px solid #e5e7eb;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.06);
}

.exam-section + .exam-section {
  margin-top: 35px;
}

.exam-section h2 {
  margin-top: 0;
  margin-bottom: 18px;

  font-size: 1.2rem;
}

#topicOptions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.option-row {
  position: relative;
  cursor: pointer;
}

.option-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-row span {
  display: flex;
  align-items: center;

  min-height: 44px;
  padding: 10px 14px;

  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;

  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.option-row:hover span {
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.option-row input:checked + span {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}

.question-options {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 12px;
}

.question-card {
  position: relative;

  cursor: pointer;
}

.question-card input {
  position: absolute;

  opacity: 0;
}

.question-card span {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 15px;

  background: #f9fafb;

  border: 1px solid #e5e7eb;
  border-radius: 12px;

  font-weight: 600;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.question-card input:checked + span {
  background: #eff6ff;
  border-color: #2563eb;

  color: #2563eb;
}

.start-button {
  width: 100%;

  margin-top: 36px;

  padding: 16px;

  border: none;
  border-radius: 12px;

  background: #2563eb;
  color: white;

  font-size: 1rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.start-button:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.back-link {
  display: block;

  margin-top: 30px;

  text-align: center;

  color: #6b7280;

  text-decoration: none;
}

.back-link:hover {
  color: #111827;
}

@media (max-width: 600px) {

  .exam-panel {
    padding: 26px 20px;
  }

  .exam-header h1 {
    font-size: 2.1rem;
  }

  .question-options {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 600px) {
  #topicOptions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .option-row span {
    min-height: 48px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}

/* =========================
   EXAM INSTRUCTIONS PAGE
========================= */

.exam-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
  box-sizing: border-box;
}

.exam-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;

  margin: 28px 0;
}

.exam-info p {
  margin: 0;
  padding: 16px;

  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;

  text-align: center;
  color: #374151;
}

.exam-info strong {
  display: block;
  margin-bottom: 6px;

  font-size: 0.85rem;
  color: #6b7280;
}

.exam-instructions {
  margin: 28px 0;
  padding: 24px;

  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;

  text-align: left;
}

.exam-instructions h2 {
  margin: 0 0 18px;

  font-size: 1.15rem;
  color: #111827;
}

.exam-instructions ul {
  margin: 0;
  padding-left: 22px;

  color: #4b5563;
  line-height: 1.7;
}

.exam-instructions li + li {
  margin-top: 8px;
}

.start-exam-btn {
  display: block;

  width: 100%;
  max-width: 320px;

  margin: 30px auto 16px;
  padding: 14px 22px;

  border: none;
  border-radius: 12px;

  background: #2563eb;
  color: white;

  font-size: 1rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.start-exam-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

.back-link {
  display: block;

  margin-top: 14px;

  text-align: center;
  text-decoration: none;

  color: #6b7280;
  font-size: 0.95rem;
}

.back-link:hover {
  color: #111827;
}

/* =========================
   ACCOUNT BUTTON
========================= */

.account-link {
  position: fixed;
  top: 22px;
  right: 26px;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  text-decoration: none;
  font-size: 1.1rem;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);

  z-index: 999;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.account-link:hover {
  transform: translateY(-1px);
  border-color: #16a34a;
}

@media (max-width: 650px) {
  .exam-info {
    grid-template-columns: 1fr;
  }

  .exam-instructions {
    padding: 20px;
  }
}