/* Fonts: Avenir LT Pro (heading/body per brand guide) is a commercial Linotype/Monotype
   family with no free web-embedding license, so headings use Poppins Black as the closest
   free geometric-sans equivalent, body uses Poppins Regular/Medium, and PT Sans (the brand
   guide's own secondary/caption font, SIL OFL) covers small captions. All self-hosted below
   — no CDN calls, consistent with this app's no-third-party-runtime-call constraint. */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/poppins-500.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("fonts/poppins-900.woff2") format("woff2");
}
@font-face {
  font-family: "PT Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ptsans-400.woff2") format("woff2");
}
@font-face {
  font-family: "PT Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/ptsans-700.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* AA4MD brand palette (brand/Visual identity guide-1.pdf) */
  --bg: #f0f0f2;
  --panel: #ffffff;
  --heading: #2f378a;
  --text: #404040;
  --muted: #71717a;
  --border: rgba(47, 55, 138, 0.14);

  --pink: #e51466;
  --pink-deep: #d51460;
  --orange: #f9a11e;
  --blue-accent: #404d9e;

  --highlight-yellow: #f9ee6f;
  --highlight-lilac: #b796c6;
  --highlight-pink: #f48db1;

  --accent: var(--pink);
  --error: #c6283c;

  --font-heading: "Poppins", "Century Gothic", "Futura", "Avenir Next", system-ui, sans-serif;
  --font-body: "Poppins", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --font-caption: "PT Sans", "Century Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Brand lockup: official horizontal logo (brand/AA4MD horizontal logo.svg). */
.brand-header {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.brand-header .brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--heading);
  font-size: 1.3rem;
  margin-bottom: 4px;
}
h1 .title-icon {
  width: 22px;
  height: auto;
  vertical-align: -4px;
  margin-right: 6px;
}
h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--heading);
  font-size: 1.05rem;
  margin-top: 0;
}
p.lede { color: var(--muted); margin-top: 0; }

section.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(47, 55, 138, 0.05);
}

.item {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.item:first-of-type { border-top: none; }
fieldset.item { border: none; margin: 0; padding: 22px 0; }
.item .q-text { font-weight: 500; margin-bottom: 10px; }

/* Likert slider widget: 1-5 range + optional N/A toggle. Shared by the
   Representational/Allocation Harms ratings (allowNA) and the SUS + tool
   items (no N/A — SUS scoring requires a value on every item). */
.likert-track-wrap {
  position: relative;
  padding: 10px 0 14px;
}
.likert-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.likert-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}
.likert-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}
.likert-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--orange);
  border: 3px solid var(--panel);
  box-shadow: 0 1px 3px rgba(47, 55, 138, 0.35);
  cursor: pointer;
}
.likert-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--orange);
  border: 3px solid var(--panel);
  box-shadow: 0 1px 3px rgba(47, 55, 138, 0.35);
  cursor: pointer;
}
.likert.unanswered .likert-range::-webkit-slider-thumb,
.likert-range.dimmed::-webkit-slider-thumb { background: var(--muted); opacity: 0.6; }
.likert.unanswered .likert-range::-moz-range-thumb,
.likert-range.dimmed::-moz-range-thumb { background: var(--muted); opacity: 0.6; }

.likert-ticks {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 23px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.likert-ticks span {
  width: 2px;
  height: 8px;
  border-radius: 1px;
  background: var(--border);
}

.likert-endpoints-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.likert-endpoint {
  max-width: 48%;
  font-family: var(--font-caption);
  font-size: 0.72rem;
  color: var(--muted);
}
.likert-endpoint.high { text-align: right; }

.likert-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.likert-value {
  font-family: var(--font-caption);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--heading);
}
.likert.unanswered .likert-value { font-weight: 400; font-style: italic; color: var(--muted); }
.likert.na-active .likert-value { color: var(--pink-deep); }

.likert-na {
  flex: 0 0 auto;
  min-width: 56px;
  min-height: 40px;
  padding: 8px 16px;
  font-family: var(--font-caption);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.likert-na.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
/* Overrides the generic button:hover:not(:disabled) pink-deep hover. */
.likert-na:hover:not(:disabled) {
  background: rgba(249, 161, 30, 0.12);
  border-color: var(--orange);
  color: var(--orange);
}
.likert-na.active:hover:not(:disabled) {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.consent input { margin-top: 2px; width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--pink); }

a { color: var(--pink-deep); }

/* A required choice between two radio answers (consent_text_it.md's two
   consent steps: "one must be chosen"). */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 8px;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.choice input { margin-top: 3px; width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--pink); }
.choice span { flex: 1; }
.choice:has(input:checked) { border-color: var(--pink); background: rgba(229, 20, 102, 0.05); }

.consent-doc-list { padding-left: 22px; margin: 10px 0; }
.consent-doc-list li { margin-bottom: 6px; }

button {
  display: block;
  width: 100%;
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
button:hover:not(:disabled) { background: var(--pink-deep); }
button.secondary {
  background: transparent;
  color: var(--heading);
  border: 1.5px solid var(--heading);
}
button.secondary:hover:not(:disabled) { background: rgba(47, 55, 138, 0.06); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error {
  color: var(--error);
  font-family: var(--font-caption);
  font-size: 0.9rem;
  margin-top: 10px;
  min-height: 1.2em;
}

input[type=text] {
  width: 100%;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  margin-bottom: 12px;
}
input[type=text]:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(229, 20, 102, 0.12);
}
input[type=file] {
  width: 100%;
  padding: 10px 0;
  color: var(--text);
  accent-color: var(--pink);
}

.done {
  text-align: center;
  padding: 40px 20px;
}
.done h1 { font-size: 1.4rem; }

.completion-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 6px;
  padding: 16px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
}
.completion-code {
  font-family: var(--font-caption);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--heading);
  user-select: all;
}
.completion-code-box button { width: auto; padding: 10px 18px; }
.completion-code-hint {
  min-height: 1.2em;
  font-family: var(--font-caption);
  font-size: 0.85rem;
  color: var(--muted);
}

.progress {
  font-family: var(--font-caption);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--heading);
  margin-bottom: 8px;
}
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--pink));
}

blockquote.mission {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--orange);
  background: rgba(47, 55, 138, 0.06);
  font-size: 0.92rem;
  white-space: pre-line;
}

label.field-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

[hidden] { display: none !important; }

/* Phone breakpoint: reclaim padding for content width. The likert slider
   is already full-width and stacks its endpoints/value/N/A rows below the
   track, so it needs no layout change here — just tighter type/spacing. */
@media (max-width: 480px) {
  main { padding: 16px 12px 48px; }
  section.panel { padding: 16px; }
  h1 { font-size: 1.15rem; }
  h2 { font-size: 0.98rem; }
  .brand-header .brand-logo { height: 32px; }
  .likert-endpoint { font-size: 0.68rem; }
}
