.fsg-assessment {
  --fsg-background: #f4f6f8;
  --fsg-surface: #ffffff;
  --fsg-text: #17212b;
  --fsg-muted: #5f6b76;
  --fsg-border: #d6dde4;
  --fsg-primary: #165f82;
  --fsg-primary-dark: #0f4864;
  --fsg-primary-soft: #eaf4f8;
  --fsg-danger: #a52222;
  --fsg-danger-soft: #fff1f1;
  --fsg-success: #27683c;
  width: min(100%, 980px);
  margin: 0 auto;
  color: var(--fsg-text);
  font-family: inherit;
  line-height: 1.5;
}

.fsg-assessment *,
.fsg-assessment *::before,
.fsg-assessment *::after {
  box-sizing: border-box;
}

.fsg-assessment__header,
.fsg-participant,
.fsg-question,
.fsg-actions {
  background: var(--fsg-surface);
  border: 1px solid var(--fsg-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(23, 33, 43, 0.07);
}

.fsg-assessment__header {
  padding: 24px;
  margin-bottom: 20px;
}

.fsg-assessment__header h2 {
  margin: 0 0 6px;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.5;
  font-weight: 700;
}

.fsg-assessment__header p {
  margin: 0;
  color: var(--fsg-muted);
}

.fsg-progress {
  margin-top: 20px;
}

.fsg-progress__label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 7px;
  color: var(--fsg-muted);
  font-size: 0.92rem;
}

.fsg-progress__track {
  height: 10px;
  overflow: hidden;
  background: #e2e8ed;
  border-radius: 999px;
}

.fsg-progress__bar {
  width: 0;
  height: 100%;
  background: var(--fsg-primary);
  border-radius: inherit;
  transition: width 160ms ease;
}


.fsg-validation-summary {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 2px solid var(--fsg-danger);
  border-radius: 10px;
  background: var(--fsg-danger-soft);
  color: var(--fsg-danger);
  font-weight: 700;
}

.fsg-validation-summary[hidden] {
  display: none;
}

.fsg-participant {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 22px;
  margin-bottom: 16px;
}

.fsg-participant h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.fsg-field {
  display: grid;
  gap: 7px;
}

.fsg-field label {
  font-weight: 700;
}

.fsg-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--fsg-border);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.fsg-field input:focus-visible,
.fsg-choice input:focus-visible,
.fsg-button:focus-visible {
  outline: 3px solid rgba(22, 95, 130, 0.22);
  outline-offset: 2px;
}

.fsg-disclosure {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #a9cbd9;
  border-radius: 10px;
  background: var(--fsg-primary-soft);
}

.fsg-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.fsg-question {
  min-width: 0;
  padding: 20px 22px 22px;
  margin: 0 0 18px;
}

.fsg-question legend {
  width: 100%;
  padding: 0 0 14px;
  font-weight: 700;
  font-size: 1.03rem;
  line-height: 1.45;
}

.fsg-question__number {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--fsg-primary);
  color: #fff;
  font-size: 0.92rem;
  vertical-align: middle;
}

.fsg-choices {
  display: grid;
  gap: 9px;
}

.fsg-choice {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 10px;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--fsg-border);
  border-radius: 9px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.fsg-choice:hover {
  background: var(--fsg-primary-soft);
  border-color: #a9cbd9;
}

.fsg-choice:has(input:checked) {
  background: var(--fsg-primary-soft);
  border-color: var(--fsg-primary);
}

.fsg-choice input {
  margin: 4px 0 0;
  accent-color: var(--fsg-primary);
}

.fsg-choice__letter {
  font-weight: 700;
}

.fsg-question.is-unanswered {
  border-color: var(--fsg-danger);
  background: var(--fsg-danger-soft);
}

.fsg-question__error {
  min-height: 1.25em;
  margin: 10px 0 0;
  color: var(--fsg-danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.fsg-actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-top: 24px;
}

.fsg-status {
  flex: 1 1 auto;
  margin: 0;
  color: var(--fsg-muted);
}

.fsg-status.is-error {
  color: var(--fsg-danger);
  font-weight: 700;
}

.fsg-status.is-success {
  color: var(--fsg-success);
  font-weight: 700;
}

.fsg-status.is-pending {
  color: var(--fsg-muted);
  font-weight: 700;
}

.fsg-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--fsg-primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.fsg-button:hover {
  background: var(--fsg-primary-dark);
}

.fsg-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.fsg-assessment__form.is-complete .fsg-question,
.fsg-assessment__form.is-complete .fsg-participant,
.fsg-assessment__form.is-complete .fsg-disclosure {
  opacity: 0.72;
}

@media (max-width: 680px) {
  .fsg-participant {
    grid-template-columns: 1fr;
  }

  .fsg-question {
    padding: 17px 15px 18px;
  }

  .fsg-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .fsg-button {
    width: 100%;
  }
}

@media print {
  .fsg-actions,
  .fsg-progress {
    display: none !important;
  }

  .fsg-assessment__header,
  .fsg-participant,
  .fsg-question {
    box-shadow: none;
    break-inside: avoid;
  }
}

.fsg-confirmation {
  margin-top: 24px;
  padding: 24px;
  border: 2px solid var(--fsg-success);
  border-radius: 12px;
  background: #f0f8f2;
  box-shadow: 0 8px 24px rgba(23, 33, 43, 0.07);
}

.fsg-confirmation[hidden] {
  display: none;
}

.fsg-confirmation h3 {
  margin: 0 0 8px;
  color: var(--fsg-success);
}

.fsg-confirmation__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 20px 0;
}

.fsg-confirmation__details div {
  padding: 12px;
  border: 1px solid #bfd7c5;
  border-radius: 8px;
  background: #fff;
}

.fsg-confirmation__details dt {
  font-weight: 700;
}

.fsg-confirmation__details dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.fsg-confirmation__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fsg-button--secondary {
  border: 1px solid var(--fsg-primary);
  background: #fff;
  color: var(--fsg-primary);
}

.fsg-button--secondary:hover {
  background: var(--fsg-primary-soft);
}

.fsg-confirmation__print-help {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--fsg-muted);
}

@media (max-width: 640px) {
  .fsg-confirmation__details {
    grid-template-columns: 1fr;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .fsg-assessment,
  .fsg-assessment * {
    visibility: visible !important;
  }

  .fsg-assessment {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    max-width: none;
    margin: 0;
    color: #000;
    font-size: 10pt;
  }

  /* Reduce all printed text to 10pt (overrides the larger on-screen sizes). */
  .fsg-assessment,
  .fsg-assessment h3,
  .fsg-question legend,
  .fsg-choice,
  .fsg-confirmation,
  .fsg-confirmation dt,
  .fsg-confirmation dd {
    font-size: 10pt !important;
    line-height: 1.3;
  }

  .fsg-assessment__header,
  .fsg-participant,
  .fsg-question,
  .fsg-confirmation {
    box-shadow: none;
    break-inside: avoid;
  }

  .fsg-assessment__header,
  .fsg-progress,
  .fsg-disclosure,
  .fsg-actions,
  .fsg-validation-summary,
  .fsg-question__error,
  .fsg-confirmation__actions,
  .fsg-confirmation__print-help {
    display: none !important;
  }

  .fsg-question {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .fsg-choice {
    min-height: 0;
    padding: 5px 8px;
    border: 1px solid #9aa3ab;
    border-radius: 6px;
  }

  /*
   * Show every answer option in the printed/PDF result, not just the one the
   * participant selected.
   */
  .fsg-choice input {
    opacity: 1 !important;
  }

  /*
   * Mark the participant's selected choice unambiguously. A heavy border and
   * bold text both print reliably; the "Selected" label prints even when the
   * browser strips background colours, and print-color-adjust asks supporting
   * browsers to keep the shaded background too.
   */
  .fsg-choice:has(input:checked) {
    border: 2px solid #000;
    background: #e6e6e6;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .fsg-choice:has(input:checked) .fsg-choice__letter,
  .fsg-choice:has(input:checked) span {
    font-weight: 700;
  }

  .fsg-choice:has(input:checked)::after {
    content: "\2713 Selected";
    grid-column: 1 / -1;
    margin-top: 2px;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .fsg-confirmation {
    display: block !important;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid #000;
    background: #fff;
  }

  .fsg-confirmation__details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 10px 0 0;
  }

  @page {
    margin: 0.25in;
  }
}
