@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --orange: #F7941D;
  --orange-dark: #d67e15;
  --navy: #0b3c5d;
  --text: #212121;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #fffaf3;
  --danger: #dc2626;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  /* Discourage copying the on-screen test content — real inputs (textarea)
     override this explicitly below so typing still works normally. */
  -webkit-user-select: none;
  user-select: none;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
  color: var(--navy);
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Blocks the in-browser Print / print-to-PDF path — the one screenshot-adjacent
   vector a page actually can control. OS-level screenshots (Print Screen,
   Snipping Tool, another device's camera) cannot be blocked by any website. */
@media print {
  body { display: none; }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-logo { width: 32px; height: 32px; border-radius: 6px; }
.topbar-title { font-weight: 600; color: var(--navy); font-size: 0.95rem; }

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.screen { display: none; }
.screen.active { display: block; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

.card.center {
  text-align: center;
  max-width: 480px;
  margin: 60px auto;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

h2 { font-size: 1.4rem; margin-bottom: 14px; }
.card.center p { color: var(--muted); line-height: 1.6; margin-top: 8px; }
.applicant-name { font-weight: 600; color: var(--text); margin-bottom: 10px; }

.instructions-list {
  margin: 16px 0 20px 20px;
  color: var(--text);
  line-height: 1.7;
}
.instructions-list li { margin-bottom: 10px; }

.consent-box {
  background: #fff7ec;
  border: 1px solid #ffe2b0;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
}

.error-text { color: var(--danger); font-size: 0.9rem; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 13px 26px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary { background: var(--orange); color: #14161a; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #f1f2f4; color: var(--text); }
.btn-secondary:hover { background: #e5e7eb; }
.btn-wide { display: block; width: 100%; text-align: center; }

/* Test header — sticky timer/progress bar */
.test-header {
  position: sticky;
  top: 61px;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.timer {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--navy);
}
.timer.low-time { color: var(--danger); }
.progress-text { color: var(--muted); font-size: 0.9rem; }

.test-body { margin-bottom: 20px; }

.section-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
}
.section-title { font-size: 1.15rem; margin-bottom: 6px; }
.section-instructions { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }

.passage-box {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
  line-height: 1.7;
  font-size: 0.92rem;
  max-height: 340px;
  overflow-y: auto;
}
.passage-box p { margin-bottom: 12px; }
.passage-box p:last-child { margin-bottom: 0; }

.question-block {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.question-block:first-of-type { border-top: none; padding-top: 0; }
.question-text { font-weight: 600; margin-bottom: 12px; line-height: 1.5; }
.question-text .qnum { color: var(--orange-dark); margin-right: 6px; }

.options-grid { display: grid; gap: 8px; }
.option-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option-label:hover { border-color: var(--orange); }
.option-label.selected { border-color: var(--orange); background: #fff7ec; }
.option-label input { margin-top: 3px; user-select: auto; }
.option-letter { font-weight: 700; color: var(--navy); }

.written-textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  /* Real input — must remain selectable/editable regardless of the global lockdown above */
  -webkit-user-select: text;
  user-select: text;
}
.written-textarea:focus { outline: 2px solid var(--orange); border-color: transparent; }

.test-footer { text-align: right; }

/* Review screen */
.review-list { margin: 18px 0; }
.review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.review-row.answered { background: #f0fdf4; }
.review-row.unanswered { background: #fef2f2; color: var(--danger); font-weight: 600; }
.review-actions { display: flex; justify-content: space-between; gap: 12px; }

/* Watermark — traceability deterrent for leaked screenshots, not prevention */
#watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  display: none;
  overflow: hidden;
  opacity: 0.07;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
  line-height: 90px;
  transform: rotate(-24deg) scale(1.4);
  white-space: pre-wrap;
  word-break: break-word;
}
#watermark.active { display: block; }

@media (max-width: 640px) {
  .wrap { padding: 16px 12px 40px; }
  .card { padding: 22px; }
  .test-header { top: 53px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .review-actions { flex-direction: column-reverse; }
  .review-actions .btn { width: 100%; }
}
