/* ── Practice Test Quiz — exam-hall scantron sheet ──────────────────
   Paper white with faint blue exam grid, goldenrod pencil band,
   scantron bubble rows that fill graphite, officialdom strip,
   red-pen score circle, teacher-marked review. */

:root {
  --paper: #fbfbf8;
  --grid-blue: rgba(74, 111, 165, 0.08);
  --goldenrod: #e8b53a;
  --goldenrod-deep: #c9992a;
  --graphite: #3a3a3a;
  --ink: #26282e;
  --ink-soft: #7c7f88;
  --exam-blue: #35578c;
  --red-pen: #d63c2e;
  --ok: #2e8b57;
  --err: #d63c2e;
  --serif: 'Spectral', serif;
  --sans: 'Inter', sans-serif;
  --hand: 'Caveat', cursive;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    repeating-linear-gradient(0deg, transparent 0 26px, var(--grid-blue) 26px 27px),
    repeating-linear-gradient(90deg, transparent 0 26px, var(--grid-blue) 26px 27px),
    var(--paper);
  background-attachment: fixed;
  min-height: 100vh;
}

.exam-hall { min-height: 100vh; display: flex; flex-direction: column; }

.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 24px; }

main { flex: 1 0 auto; padding-bottom: 60px; }

/* ── Header band ──────────────────────────────────────────────────── */
.band {
  background: linear-gradient(180deg, var(--goldenrod), var(--goldenrod-deep));
  border-bottom: 3px solid var(--graphite);
  padding: 30px 24px 22px;
}

.band-inner { max-width: 620px; margin: 0 auto; text-align: center; }

.pencil { width: 90px; height: 16px; margin-bottom: 10px; }

.band h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  color: var(--graphite);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.official-strip {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.official-strip span {
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(58, 58, 58, 0.75);
  border: 1.5px solid rgba(58, 58, 58, 0.35);
  border-radius: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.25);
}

/* ── Sheet ────────────────────────────────────────────────────────── */
.sheet {
  background: #fff;
  border: 1.5px solid #d8d5c9;
  border-radius: 6px;
  padding: 30px 32px 28px;
  margin-top: 26px;
  box-shadow: 0 10px 26px rgba(38, 40, 46, 0.08);
}

.instructions {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: center;
  border-bottom: 1.5px solid #e6e3d8;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.progress-line {
  text-align: center;
  margin-bottom: 20px;
}

#progress-text {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--exam-blue);
}

/* question */
.q-row { display: flex; gap: 14px; }

.q-num {
  flex: 0 0 34px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--exam-blue);
  text-align: right;
}

.q-body { flex: 1; }

.q-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.4;
  margin-bottom: 16px;
}

.choices { display: grid; gap: 8px; }

.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 10px;
  cursor: pointer;
  transition: background 0.13s ease;
}

.choice-btn:hover:not(:disabled) { background: rgba(74, 111, 165, 0.06); }
.choice-btn:disabled { cursor: default; }

.bubble {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--graphite);
  transition: all 0.15s ease;
}

.choice-btn.picked .bubble {
  background: var(--graphite);
  color: transparent;
  box-shadow: inset 0 0 0 2px #fff;
}

.choice-btn.picked { font-weight: 700; }

/* ── Gate ─────────────────────────────────────────────────────────── */
.gate { text-align: center; }

.gate h2 { font-family: var(--serif); font-weight: 700; font-size: 1.7rem; }

.lead { color: var(--ink-soft); margin: 8px 0 22px; }

.field { margin-bottom: 16px; text-align: left; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--exam-blue);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #d8d5c9;
  border-bottom-width: 2.5px;
  border-radius: 6px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--exam-blue); }
input.error { border-color: var(--err); }
input::placeholder { color: #b9b6aa; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
  background: linear-gradient(180deg, var(--goldenrod), var(--goldenrod-deep));
  border: none;
  border-radius: 8px;
  padding: 15px 30px;
  cursor: pointer;
  transition: transform 0.12s ease;
  box-shadow: 0 4px 0 #9a7418;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--exam-blue); outline-offset: 2px; }

.btn-block { width: 100%; }

.btn.ghost {
  display: flex;
  margin: 24px auto 0;
  background: transparent;
  color: var(--exam-blue);
  border: 2px solid var(--exam-blue);
  box-shadow: none;
}

.form-error { color: var(--err); font-weight: 700; text-align: center; margin-top: 14px; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2.5px solid rgba(58, 58, 58, 0.3);
  border-top-color: var(--graphite);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Graded result ────────────────────────────────────────────────── */
.graded-sheet {
  position: relative;
  text-align: center;
  background: #fff;
  border: 1.5px solid #d8d5c9;
  border-radius: 6px;
  padding: 36px 30px 30px;
  margin-top: 26px;
  box-shadow: 0 10px 26px rgba(38, 40, 46, 0.08);
}

.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border: 4px solid var(--red-pen);
  border-radius: 50%;
  transform: rotate(-8deg);
  margin-bottom: 14px;
}

#score-big {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--red-pen);
}

.graded-sheet h2 { font-family: var(--serif); font-weight: 700; font-size: 1.55rem; }

.grade-desc { color: var(--ink-soft); margin-top: 8px; max-width: 440px; margin-left: auto; margin-right: auto; }

/* review */
.review { display: grid; gap: 10px; margin-top: 20px; }

.review-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border: 1.5px solid #e2dfd3;
  border-radius: 6px;
  padding: 13px 16px;
}

.mark {
  flex: 0 0 auto;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
}

.mark.right { color: var(--ok); }
.mark.wrong { color: var(--red-pen); }

.review-q { font-weight: 600; font-size: 0.95rem; }

.review-a { font-size: 0.87rem; margin-top: 3px; color: var(--ink-soft); }

.review-a strong { color: var(--ink); }

/* ── Footer ───────────────────────────────────────────────────────── */
.foot {
  text-align: center;
  padding: 30px 20px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .sheet { padding: 24px 18px 22px; }
  .q-row { gap: 8px; }
  .graded-sheet { padding: 30px 18px 24px; }
}
