/* Selfcheck. Shared typography, colours and buttons are in style.css. */
.audit-heading.wrap,
.audit-workspace.wrap {
  width: min(820px, calc(100% - 48px));
  margin-inline: auto;
}

.audit-heading {
  padding-block: 36px 40px;
}

.audit-heading .back-link {
  display: inline-block;
  margin-bottom: 38px;
  font-size: 13px;
  text-decoration: none;
}

.audit-heading .back-link:hover {
  text-decoration: underline;
}

.audit-heading .eyebrow {
  margin-bottom: 18px;
}

.audit-heading h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1.06;
  letter-spacing: -.045em;
}

.audit-heading-intro {
  max-width: 650px;
  margin-top: 24px;
  font-size: 17px;
  line-height: 1.7;
}

.audit-workspace {
  padding-bottom: 80px;
}

#audit-app {
  min-width: 0;
  scroll-margin-top: 24px;
}

.audit-panel {
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
}

.audit-panel h2 {
  margin: 0 0 20px;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.audit-panel h3 {
  margin: 0 0 14px;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.audit-panel p {
  font-size: 16px;
  line-height: 1.7;
}

.audit-panel p + p {
  margin-top: 14px;
}

.audit-panel .audit-kicker {
  margin: 0 0 16px;
  color: var(--muted);
  font: 11px/1.5 var(--mono);
  letter-spacing: .07em;
}

.audit-intro-points {
  padding-left: 23px;
  margin-block: 26px;
  font-size: 16px;
  line-height: 1.7;
}

.audit-intro-points li {
  padding-left: 4px;
  margin-bottom: 10px;
}

/* Progress and answer controls */
.audit-progress {
  margin-bottom: 34px;
}

.audit-progress-label {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
  font: 12px/1.5 var(--mono);
}

.audit-progress progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--ink);
}

.audit-progress progress::-webkit-progress-bar {
  background: var(--accent-soft);
}

.audit-progress progress::-webkit-progress-value {
  background: var(--ink);
}

.audit-progress progress::-moz-progress-bar {
  background: var(--ink);
}

.audit-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.audit-steps .is-current {
  color: var(--ink);
  font-weight: 700;
}

.audit-steps .is-complete {
  color: var(--ink);
}

.audit-questions {
  margin-top: 30px;
}

.audit-question {
  min-width: 0;
  padding: 26px 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.audit-question legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -.015em;
}

.audit-question-number {
  display: inline-block;
  margin-right: 7px;
  color: var(--muted);
  font: 12px/1.6 var(--mono);
}

.audit-panel .audit-help {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.audit-question .audit-help {
  clear: both;
  margin-top: 0;
}

.audit-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  clear: both;
  gap: 12px;
  padding-top: 4px;
}

.audit-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.audit-choice:hover {
  border-color: var(--ink);
  background: #eaf5fc;
}

.audit-choice:has(input:checked) {
  border-color: var(--ink);
  background: var(--accent-soft);
}

.audit-choice:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.audit-choice input {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--ink);
}

.audit-choice input:focus-visible {
  outline: none;
}

.audit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.audit-button-primary,
.audit-button-secondary {
  max-width: 100%;
  min-height: 50px;
  gap: 14px;
  padding: 13px 20px;
  font-size: 14px;
  text-align: center;
}

.audit-button-primary:disabled {
  opacity: .5;
  transform: none;
  cursor: not-allowed;
}

.audit-button-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.audit-button-secondary:hover {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: var(--ink);
}

.audit-button-text {
  min-height: 44px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.audit-panel .audit-privacy-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* The outcome is sent by the server; the page only collects the request. */
.audit-panel .audit-preview-note {
  padding: 14px 18px;
  margin-block: 22px;
  border-left: 4px solid var(--yellow, #f9ee3e);
  background: var(--paper);
  font-size: 13px;
  line-height: 1.65;
}

.audit-email-form {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.audit-email-form > .audit-preview-note {
  margin-top: 0;
  margin-bottom: 26px;
}

.audit-glossary {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.audit-glossary summary {
  min-height: 44px;
  padding-block: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.audit-glossary dl {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.audit-glossary dt {
  margin-top: 18px;
  font-weight: 600;
}

.audit-glossary dd {
  margin: 5px 0 0;
  color: var(--muted);
}

.audit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.audit-field label > span {
  color: var(--muted);
}

.audit-field input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
}

.audit-field input:hover {
  border-color: var(--muted);
}

.audit-checkbox {
  display: flex;
  align-items: start;
  gap: 12px;
  margin: 22px 0;
  font-size: 14px;
  line-height: 1.65;
  cursor: pointer;
}

.audit-checkbox input {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  margin: 3px 0 0;
  accent-color: var(--ink);
}

.audit-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.audit-email-form > .audit-button-primary {
  margin-top: 24px;
}

.audit-panel .audit-form-message {
  min-height: 1.5em;
  margin-top: 16px;
  font-size: 14px;
}

.audit-form-error {
  color: #9b274b;
}

.audit-success {
  padding: 24px;
  margin-top: 24px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent-soft);
}

.audit-success h4 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .audit-heading.wrap,
  .audit-workspace.wrap {
    width: calc(100% - 32px);
  }

  .audit-heading {
    padding-block: 28px 30px;
  }

  .audit-heading .back-link {
    margin-bottom: 30px;
    font-size: 12px;
  }

  .audit-heading h1 {
    font-size: clamp(40px, 9vw, 54px);
  }

  .audit-heading-intro {
    margin-top: 22px;
    font-size: 15px;
  }

  .audit-workspace {
    padding-bottom: 50px;
  }

  .audit-panel {
    padding: 26px 20px;
  }

  .audit-panel h2 {
    font-size: 28px;
  }

  .audit-panel h3 {
    font-size: 21px;
  }

  .audit-panel p,
  .audit-intro-points {
    font-size: 14px;
  }

  .audit-panel .audit-kicker {
    font-size: 10px;
  }

  .audit-progress-label {
    font-size: 11px;
  }

  .audit-steps {
    gap: 10px;
    font-size: 11px;
  }

  .audit-question {
    padding-block: 23px;
  }

  .audit-question legend {
    font-size: 15px;
  }

  .audit-panel .audit-help {
    font-size: 13px;
  }

  .audit-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .audit-choice {
    min-height: 52px;
    gap: 7px;
    padding: 11px 9px;
    font-size: 12px;
  }

  .audit-choice input {
    width: 16px;
    height: 16px;
  }

  .audit-actions {
    gap: 14px;
  }

  .audit-button-primary,
  .audit-button-secondary {
    gap: 10px;
    padding-inline: 16px;
    font-size: 13px;
  }

  .audit-success {
    padding: 18px;
  }
}

@media (max-width: 400px) {
  .audit-panel {
    padding-inline: 16px;
  }

  .audit-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
  }

  .audit-question legend {
    font-size: 14px;
  }

  .audit-choice {
    padding-inline: 7px;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .audit-choice {
    transition: none;
  }
}

@media print {
  body.audit-page {
    background: white;
    color: black;
    font: 11pt/1.5 sans-serif;
  }

  .audit-page .site-header,
  .audit-page .site-footer,
  .audit-heading,
  .audit-actions,
  .audit-email-form,
  .audit-preview-note,
  .audit-progress {
    display: none !important;
  }

  .audit-workspace.wrap {
    width: 100%;
    padding: 0;
  }

  .audit-panel {
    padding: 0;
    border: 0;
    background: white;
  }
}
