:root {
  --cream: #fff5e1;
  --brown: #5d4037;
  --brown-dark: #3e2723;
  --violet: #341e60;
  --teal: #00b09f;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: linear-gradient(160deg, var(--cream), #ebe4dc);
  color: var(--brown-dark);
}

.exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(93, 64, 55, 0.1);
  backdrop-filter: blur(10px);
}

.exam-header__brand {
  font-weight: 800;
  color: var(--violet);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.exam-header__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 13px;
  color: #6d5c54;
  font-weight: 600;
}

.exam-timer {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 176, 159, 0.12);
  border: 1px solid rgba(0, 176, 159, 0.35);
  color: #00695c;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  min-width: 56px;
  justify-content: center;
}

.exam-timer--warn {
  background: rgba(245, 143, 0, 0.15);
  border-color: rgba(245, 143, 0, 0.45);
  color: #e65100;
}

.exam-timer--critical {
  background: rgba(198, 40, 40, 0.12);
  border-color: rgba(198, 40, 40, 0.4);
  color: #c62828;
  animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.hidden {
  display: none !important;
}

.exam-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
}

.exam-card {
  width: 100%;
  max-width: 720px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(52, 30, 96, 0.1);
}

.progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 999px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brown), var(--teal));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.exam-section {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
}

.exam-question {
  margin: 0 0 20px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.45;
}

.exam-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid rgba(93, 64, 55, 0.15);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.option-btn__label {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(93, 64, 55, 0.08);
  font-size: 12px;
  font-weight: 800;
  color: var(--brown);
}

.option-btn.selected .option-btn__label {
  background: var(--teal);
  color: #fff;
}

.option-btn__text {
  flex: 1;
  line-height: 1.45;
}

.option-btn:hover {
  border-color: var(--teal);
  background: rgba(0, 176, 159, 0.06);
}

.option-btn.selected {
  border-color: var(--teal);
  background: rgba(0, 176, 159, 0.12);
  font-weight: 600;
}

.exam-nav {
  display: flex;
  gap: 12px;
}

.exam-nav__btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.exam-nav__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brown), var(--violet));
}

.exam-nav__btn--secondary {
  color: var(--brown);
  background: #eee;
  border: 1px solid rgba(93, 64, 55, 0.12);
}

.exam-nav__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.exam-nav__btn:not(:disabled):hover {
  transform: translateY(-2px);
}

/* Review screen */
.review-card__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: var(--violet);
}

.review-card__lead {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6d5c54;
  line-height: 1.5;
}

.review-summary {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: rgba(0, 176, 159, 0.1);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #00695c;
}

.review-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.review-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid rgba(93, 64, 55, 0.1);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.review-item:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 16px rgba(0, 176, 159, 0.1);
}

.review-item--missing {
  border-color: rgba(198, 40, 40, 0.35);
  background: rgba(198, 40, 40, 0.04);
}

.review-item__num {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--violet);
  min-width: 32px;
}

.review-item__body {
  flex: 1;
  min-width: 0;
}

.review-item__section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
}

.review-item__q {
  margin: 4px 0 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--brown-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-item__ans {
  margin: 0;
  font-size: 12px;
  color: #6d5c54;
}

.review-item--missing .review-item__ans {
  color: #c62828;
  font-weight: 600;
}

.review-item__edit {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  padding-top: 2px;
}

.exam-gate {
  max-width: 480px;
  margin: 40px auto;
  text-align: center;
}

.exam-gate__title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--violet);
}

.exam-gate__lead {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: #6d5c54;
}

.exam-gate__form {
  text-align: left;
}

.exam-gate__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brown-dark);
}

.exam-gate__input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(93, 64, 55, 0.15);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.2s;
}

.exam-gate__input:focus {
  outline: none;
  border-color: var(--teal);
}

.exam-gate__error {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: #c62828;
  font-weight: 600;
}

.exam-gate__submit {
  width: 100%;
  margin-top: 16px;
  padding: 14px 20px;
  border: none;
  cursor: pointer;
}

.exam-gate__note {
  margin: 20px 0 0;
  font-size: 12px;
  color: #6d5c54;
  line-height: 1.6;
}

.exam-gate__note a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.exam-gate__note a:hover {
  text-decoration: underline;
}
