/* ===== [ Taking a survey.                                          ] ===== */
/* ===== [                                                           ] ===== */
/* ===== [ This is the one screen that is not for staff. A classroom  ] ===== */
/* ===== [ of students will use it on whatever they have — a lab PC   ] ===== */
/* ===== [ at arm's length, a phone, a tablet — so everything here is ] ===== */
/* ===== [ sized for a finger and readable from further away than a   ] ===== */
/* ===== [ desk.                                                      ] ===== */
/* ===== [                                                           ] ===== */
/* ===== [ Deliberately quiet about colour. It renders inside the     ] ===== */
/* ===== [ client's theme, and the one thing worse than plain is      ] ===== */
/* ===== [ fighting a theme and losing.                               ] ===== */

.csr-surveys-take {
  --csr-ink: #1d2327;
  --csr-muted: #646970;
  --csr-line: #c3c4c7;
  --csr-accent: #2271b1;
  --csr-bad: #b32d2e;
  --csr-soft: #f6f7f7;

  color: var(--csr-ink);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 46rem;
  padding: 0 1rem 3rem;
}

.csr-surveys-take [hidden] {
  display: none !important;
}

/* ----- [ Progress ] ----- */

.csr-surveys-take-progress {
  background: var(--csr-line);
  border-radius: 3px;
  height: 6px;
  margin: 0 0 2rem;
  overflow: hidden;
}

.csr-surveys-take-progress-bar {
  background: var(--csr-accent);
  display: block;
  height: 100%;
  transition: width 200ms ease-out;
  width: 0;
}

/* ----- [ Screens ] ----- */

.csr-surveys-take-screen {
  outline: none;
}

.csr-surveys-take-title,
.csr-surveys-take-heading {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.csr-surveys-take-description,
.csr-surveys-take-welcome-body,
.csr-surveys-take-exit-body {
  margin: 0 0 1.25rem;
}

.csr-surveys-take-step {
  color: var(--csr-muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin: 0 0 1.5rem;
  text-transform: uppercase;
}

.csr-surveys-take-anon {
  background: var(--csr-soft);
  border-left: 3px solid var(--csr-accent);
  color: var(--csr-muted);
  font-size: 0.95rem;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
}

.csr-surveys-take [dir="rtl"] .csr-surveys-take-anon,
[dir="rtl"] .csr-surveys-take-anon {
  border-left: 0;
  border-right: 3px solid var(--csr-accent);
}

.csr-surveys-take-notice {
  background: #fcf9e8;
  border: 1px solid #dba617;
  margin: 0 0 1.5rem;
  padding: 1rem;
}

/* ----- [ Questions ] ----- */

.csr-surveys-take-question,
.csr-surveys-take-group {
  border: 0;
  border-top: 1px solid var(--csr-line);
  margin: 0;
  padding: 0 0 2.5rem 0;
}

.csr-surveys-take-question:first-of-type,
.csr-surveys-take-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.csr-surveys-take-question legend,
.csr-surveys-take-group legend {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 1rem;
  padding: 0;
  width: 100%;
}

.csr-surveys-take-number {
  color: var(--csr-muted);
  font-weight: 400;
}

.csr-surveys-take-required {
  color: var(--csr-bad);
  margin-left: 0.25rem;
}

.csr-surveys-take-before,
.csr-surveys-take-after,
.csr-surveys-take-after-answers,
.csr-surveys-take-hint {
  color: var(--csr-muted);
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}

/* ----- [ Options ] ----- */
/* A whole-row label, not a bare radio. On a touch screen the target is    */
/* the sentence, which is what a student will aim at anyway.               */

.csr-surveys-take-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.csr-surveys-take-option {
  align-items: flex-start;
  border: 1px solid var(--csr-line);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
}

.csr-surveys-take-option:hover {
  background: var(--csr-soft);
}

.csr-surveys-take-option input {
  flex: 0 0 auto;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  width: 1.25rem;
}

.csr-surveys-take-option input:focus-visible {
  outline: 2px solid var(--csr-accent);
  outline-offset: 2px;
}

/* :has() is the whole reason the selected row can be highlighted without  */
/* JavaScript. Browsers without it simply do not get the highlight, and    */
/* the radio itself still shows what was chosen.                           */

.csr-surveys-take-option:has(input:checked) {
  background: #f0f6fc;
  border-color: var(--csr-accent);
  box-shadow: inset 0 0 0 1px var(--csr-accent);
}

.csr-surveys-take-option-na {
  border-style: dashed;
}

/* ----- [ A question that still needs answering ] ----- */

.csr-surveys-take-unanswered legend {
  color: var(--csr-bad);
}

.csr-surveys-take-unanswered .csr-surveys-take-options {
  border-left: 3px solid var(--csr-bad);
  padding-left: 0.75rem;
}

.csr-surveys-take-error {
  color: var(--csr-bad);
  font-size: 0.95rem;
  margin: 0.75rem 0 0;
}

/* ----- [ Navigation ] ----- */

.csr-surveys-take-nav {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin: 2.5rem 0 0;
}

.csr-surveys-take-nav button {
  background: #fff;
  border: 1px solid var(--csr-accent);
  border-radius: 4px;
  color: var(--csr-accent);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 3rem;
  min-width: 7rem;
  padding: 0.65rem 1.5rem;
}

.csr-surveys-take-nav button:hover {
  background: #f0f6fc;
}

.csr-surveys-take-next,
.csr-surveys-take-submit {
  background: var(--csr-accent) !important;
  color: #fff !important;
  margin-left: auto;
}

.csr-surveys-take-next:hover,
.csr-surveys-take-submit:hover {
  background: #135e96 !important;
}

/* The welcome screen has one button and it should not sit alone on the    */
/* right as though something went missing from the left.                   */

.csr-surveys-take-welcome .csr-surveys-take-nav,
.csr-surveys-take-exit .csr-surveys-take-nav {
  justify-content: flex-start;
}

.csr-surveys-take-welcome .csr-surveys-take-next {
  margin-left: 0;
}

/* Starting again is for the next person on a shared machine, not something */
/* the respondent who just finished should be drawn towards.                */

.csr-surveys-take-again {
  font-weight: 400 !important;
}

/* ----- [ Saving ] ----- */
/* Small and out of the way. A respondent does not need to think about     */
/* this, and a student who notices it at all should not be made anxious    */
/* by it.                                                                  */

.csr-surveys-take-status {
  color: var(--csr-muted);
  font-size: 0.85rem;
  margin: 1.5rem 0 0;
  min-height: 1.2em;
}

.csr-surveys-take-status-warn {
  color: #8a6400;
}

/* ----- [ Closed ] ----- */

.csr-surveys-take-closed {
  text-align: center;
  padding-top: 2rem;
}

/* ----- [ Narrow screens ] ----- */

@media (max-width: 30rem) {

  .csr-surveys-take {
    font-size: 1rem;
    padding: 0 0.75rem 2rem;
  }

  .csr-surveys-take-title,
  .csr-surveys-take-heading {
    font-size: 1.35rem;
  }

  .csr-surveys-take-question legend,
  .csr-surveys-take-group legend {
    font-size: 1.05rem;
  }

  /* Stacked, full width, and in reading order — Back under Next rather     */
  /* than beside it, so a thumb does not find the wrong one.                */

  .csr-surveys-take-nav {
    flex-direction: column-reverse;
  }

  .csr-surveys-take-nav button {
    margin-left: 0 !important;
    width: 100%;
  }

}

/* ----- [ Print ] ----- */
/* Someone will want a paper copy of the questions. Show every screen and  */
/* drop the furniture.                                                     */

@media print {

  .csr-surveys-take [hidden] {
    display: block !important;
  }

  .csr-surveys-take-progress,
  .csr-surveys-take-nav,
  .csr-surveys-take-status,
  .csr-surveys-take-exit {
    display: none !important;
  }

  .csr-surveys-take-question {
    break-inside: avoid;
  }

}

/* ----- [ Reduced motion ] ----- */

@media (prefers-reduced-motion: reduce) {

  .csr-surveys-take-progress-bar {
    transition: none;
  }

}

/* ===== [ © 2026 CSR Tech Concepts Inc — GPLv3 or later             ] ===== */
