/* Step 1051: the look of a practice test, in one place.
 *
 * The same uploader and the same one-question-at-a-time run are now on two
 * pages -- the front page, where anybody can try a test without an account,
 * and practice-tests.html, where a signed-in person can also save it. Both
 * load this file, so the two cannot drift apart in appearance the way two
 * copies of the markup would.
 *
 * Every colour here comes from a variable both pages already define, so the
 * widget takes on whichever page it is sitting in.
 */

.practice-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-5);
  box-shadow: var(--shadow-warm-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.practice-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.9rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.practice-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light);
  margin: 0.6rem 0 0;
}

.practice-error {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #991b1b;
  margin: 0.6rem 0 0;
}

.practice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  border-radius: var(--radius-5);
  background: var(--white);
  color: var(--text-main);
  border-color: var(--border-dark);
}

.practice-btn:hover:not([disabled]) {
  background: var(--bg-subtle);
}

.practice-btn-primary {
  background: var(--accent-blue);
  color: var(--white);
  border-color: var(--accent-blue);
}

.practice-btn-primary:hover:not([disabled]) {
  background: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
}

.practice-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* A button set to display as a flex box has to be told again that hidden
   means hidden, or the `hidden` attribute does nothing at all. */
.practice-btn[hidden] {
  display: none;
}

.practice-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* The uploader. */
.practice-drop-zone {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius-5);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-subtle);
  margin-bottom: 1rem;
}

/* Step 1063: the browser's own file button has a width of its own, wider than
   a small phone, so it is told it may shrink. */
.practice-drop-zone input[type="file"] {
  max-width: 100%;
}

.practice-drop-zone.is-over {
  border-color: var(--accent-blue);
  background: #e0f2fe;
}

.practice-drop-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* One question at a time, big enough to read comfortably. */
.question-progress {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.question-prompt {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1.1rem;
  line-height: 1.45;
  color: var(--text-main);
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-5);
  font: inherit;
  font-size: 0.98rem;
  color: var(--text-main);
  cursor: pointer;
}

.choice-btn:hover:not([disabled]) {
  border-color: var(--accent-blue);
  background: var(--bg-subtle);
}

.choice-btn[disabled] {
  cursor: default;
}

.choice-letter {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-muted);
  flex: 0 0 auto;
}

.choice-btn.is-right {
  border-color: var(--accent-green);
  background: #dcfce7;
}

.choice-btn.is-right .choice-letter {
  color: #166534;
}

.choice-btn.is-wrong {
  border-color: #dc2626;
  background: #fee2e2;
}

.choice-btn.is-wrong .choice-letter {
  color: #991b1b;
}

.answer-verdict {
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.answer-verdict.is-right {
  color: #166534;
}

.answer-verdict.is-wrong {
  color: #991b1b;
}

.answer-explanation {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.1rem;
}

.score-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light);
  margin-left: auto;
}

/* What a person is told they get by signing in, shown once a test has been
   taken rather than before it. */
.practice-signin-note {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Step 1063: a small phone. The card, its padding and its buttons all give
   way rather than making the whole page scroll sideways -- 320 pixels is the
   narrowest screen still in real use, and everything here has to fit it. */
@media (max-width: 480px) {
  .practice-card {
    padding: 1.1rem;
  }

  .practice-drop-zone {
    padding: 1rem 0.7rem;
  }

  /* The browser draws its own Choose File button, and its natural width is
     wider than a 320 pixel screen once the card's padding is counted. A real
     number here is what actually holds it in, because a percentage of a width
     that is itself decided by this control means nothing. */
  .practice-drop-zone input[type="file"] {
    max-width: 13rem;
    font-size: 0.8rem;
  }

  .practice-controls {
    gap: 0.4rem;
  }

  .practice-btn {
    flex: 1 1 auto;
    padding: 0.6rem 0.8rem;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
  }

  .score-line {
    margin-left: 0;
    width: 100%;
  }

  .choice-btn {
    padding: 0.75rem 0.8rem;
  }
}
