html {
  font-size: 15px;
}

body {
  background: #f5f7fb;
  color: #1f2937;
  font-family: "Segoe UI", Arial, sans-serif;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.app-header nav {
  align-items: center;
  display: flex;
  min-height: 64px;
}

.brand {
  color: #111827;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.app-main {
  padding-bottom: 48px;
  padding-top: 32px;
}

.auth-panel,
.result-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 32px;
  margin: 48px auto;
  max-width: 860px;
  padding: 32px;
}

.auth-panel {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.auth-link {
  color: #475569;
  margin: 0;
  text-align: center;
}

.code-input {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.18rem;
  text-align: center;
}

.eyebrow {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.muted {
  color: #64748b;
}

.compact {
  margin-bottom: 8px;
}

.page-heading,
.exam-topbar {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.exam-list {
  display: grid;
  gap: 18px;
}

.exam-card {
  align-items: end;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 260px;
  padding: 24px;
}

.exam-card h2,
.history h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.exam-card form {
  display: grid;
  gap: 10px;
}

.meta {
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.92rem;
}

.history {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-top: 24px;
  padding: 24px;
}

.exam-shell {
  display: grid;
  gap: 18px;
}

.exam-topbar {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
}

.exam-topbar > div:first-child {
  min-width: 0;
  width: 100%;
}

.timer {
  background: #111827;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 132px;
  padding: 12px 16px;
  text-align: center;
}

.question-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px;
}

.question-card h1 {
  font-size: 1.35rem;
  line-height: 1.45;
  margin-bottom: 22px;
}

.options {
  display: grid;
  gap: 12px;
}

.option-button {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1f2937;
  min-height: 52px;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}

.option-button:hover {
  background: #eef6ff;
  border-color: #2563eb;
}

.option-choice {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 52px;
  padding: 14px 16px;
}

.option-choice:hover {
  background: #eef6ff;
  border-color: #2563eb;
}

.option-choice input {
  margin-top: 5px;
}

.exam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.feedback {
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 16px;
}

.feedback.ok {
  background: #ecfdf5;
  border: 1px solid #34d399;
  color: #065f46;
}

.feedback.bad {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
}

.score {
  color: #111827;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}

.grade-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: inline-grid;
  gap: 4px;
  margin: 18px 0 12px;
  padding: 14px 18px;
}

.grade-box span {
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.grade-box strong {
  color: #111827;
  font-size: 1.65rem;
  line-height: 1.1;
}

.actions {
  margin-top: 12px;
}

.review-panel {
  margin: 0 auto 48px;
  max-width: 1100px;
}

.review-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.review-heading h2 {
  font-size: 1.5rem;
  margin: 0;
}

.review-heading span {
  color: #475569;
  font-weight: 700;
}

.review-list {
  display: grid;
  gap: 16px;
}

.review-question {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 22px;
}

.review-question-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.review-question h3 {
  font-size: 1rem;
  line-height: 1.45;
  margin: 0;
}

.status-pill {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 10px;
  white-space: nowrap;
}

.status-pill.ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill.bad {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.empty {
  background: #e5e7eb;
  color: #374151;
}

.review-options {
  display: grid;
  gap: 8px;
}

.review-option {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 13px;
}

.review-option.correct {
  background: #ecfdf5;
  border-color: #34d399;
}

.review-option.selected-wrong {
  background: #fef2f2;
  border-color: #f87171;
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.review-tags strong {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  font-size: 0.75rem;
  padding: 3px 8px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .auth-panel,
  .exam-card {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .exam-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .timer {
    width: 100%;
  }

  .review-heading,
  .review-question-head,
  .review-option {
    align-items: stretch;
    flex-direction: column;
  }

  .review-tags {
    justify-content: flex-start;
  }
}
