/* Course pre-test and post-test cards (anonymous Google Forms paired by a
   random study code). They are part of the course, so each is a visible card
   at the start and end rather than a collapsed "optional" disclosure. */
.resident-survey[hidden], .resident-survey [hidden], .course-test [hidden] { display: none !important; }

.course-test {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--lesson-measure, 39rem);
  margin: 1.25rem auto;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--fx-tint-border, var(--border-color));
  border-radius: var(--radius-md, 16px);
  background: var(--fx-tint, var(--surface-2));
  color: var(--text-color);
}
.fr-course-overview .course-test { margin: 1rem 0 1.1rem; background: var(--surface-1); }
body.has-fundamentals-reader .course-test .course-test-step {
  margin: 0 0 .15rem;
  color: var(--accent-color);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .01em;
}
body.has-fundamentals-reader .course-test h3 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
body.has-fundamentals-reader .course-test .course-test-meta { margin: .15rem 0 .6rem; color: var(--text-secondary); font-size: .875rem; }
body.has-fundamentals-reader .course-test p { max-width: none; margin: .5rem 0; font-size: 1rem; line-height: 1.6; }
body.has-fundamentals-reader .course-test .course-test-note,
body.has-fundamentals-reader .course-test [data-survey-status],
body.has-fundamentals-reader .course-test .course-test-pending { color: var(--text-secondary); font-size: .875rem; line-height: 1.5; }

.course-test .resident-survey { margin: .75rem 0 0; padding: 0; border: 0; background: transparent; }
.course-test .course-test-open {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .6rem 1.1rem;
  border: 1px solid var(--action-bg);
  border-radius: var(--radius-sm, 10px);
  background: var(--action-bg);
  color: var(--action-ink) !important;
  font-weight: 700;
  text-decoration: none;
}
.course-test .course-test-open:hover { background: var(--action-hover, var(--action-bg)); border-color: var(--action-hover, var(--action-bg)); }

.resident-survey-code { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .8rem 0 .2rem; }
.resident-survey-code-label { color: var(--text-secondary); font-size: .875rem; font-weight: 600; }
.resident-survey code { font: 700 1.05rem ui-monospace, monospace; letter-spacing: .04em; color: var(--text-color); user-select: all; }
.resident-survey button {
  min-height: 36px;
  padding: .4rem .75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-1);
  color: var(--text-color);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.resident-survey button:hover { border-color: var(--accent-color); }
.resident-survey details { margin-top: .4rem; }
.resident-survey summary { cursor: pointer; color: var(--accent-color); font-size: .875rem; font-weight: 600; }
.resident-survey form { display: flex; align-items: end; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.resident-survey form label { display: grid; gap: .3rem; font-size: .875rem; }
.resident-survey input { font: inherit; width: min(100%, 19rem); padding: .55rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm, 10px); background: var(--surface-1); color: var(--text-color); }
.course-test :is(button, a, input, summary):focus-visible { outline: 3px solid var(--accent-color); outline-offset: 3px; }
@media (max-width: 560px) {
  .course-test { padding: 1rem; }
  .resident-survey code { font-size: .95rem; }
}
