/* CampusWorks + Dynamic Campus — HERDI questionnaire
   Palette taken from HERDI_Panelist_Questionnaire_v2.docx */
:root {
  --navy: #0b4b70;        /* headings, primary */
  --navy-deep: #083a57;
  --slate: #596a6f;       /* help text */
  --wash: #eaf3f7;        /* callout fill */
  --blue: #1b75aa;        /* band start */
  --teal: #1ba3a6;        /* band mid */
  --green: #95c13d;       /* band end */
  --gold: #f0ae1a;        /* footer accent */
  --ink: #1d2a30;
  --line: #d5e2e9;
  --bg: #f5f8fa;
  --card: #ffffff;
  --danger: #b3261e;
  --radius: 10px;
  --band: linear-gradient(90deg, var(--blue), var(--teal) 55%, var(--green));
  --head: Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Masthead ---------- */
.masthead { background: #fff; }
.masthead .logos { max-width: 860px; margin: 0 auto; padding: 22px 16px 14px; }
.masthead .logos img { width: min(370px, 82%); height: auto; margin: 0 auto; }
/* Brand band: a continuous vector gradient (replaces the stretched raster, which aliased into a jagged edge) */
.band {
  height: 12px;
  background: linear-gradient(90deg, #1b75aa 0%, #1a8cad 20%, #1ba3a6 45%, #4fb07a 68%, #7ebb4c 86%, #95c13d 100%);
  background: linear-gradient(in oklab 90deg, #1b75aa 0%, #1a8cad 20%, #1ba3a6 45%, #4fb07a 68%, #7ebb4c 86%, #95c13d 100%);
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.titleblock { text-align: center; padding: 26px 0 6px; }
.titleblock h1 {
  margin: 0; font-family: var(--head); font-weight: 700; color: var(--navy);
  font-size: clamp(26px, 4.6vw, 36px); letter-spacing: -0.01em; line-height: 1.15;
}
.titleblock .sub {
  margin: 8px auto 0; padding-bottom: 10px; max-width: 520px;
  color: var(--slate); font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--line);
}

.callout {
  background: var(--wash); color: var(--navy); border-radius: var(--radius);
  padding: 16px 20px; margin: 18px 0; font-size: 15.5px;
}
.callout.offering { border-left: 4px solid var(--teal); }

/* ---------- Stepper ---------- */
.stepper { position: sticky; top: 0; z-index: 5; background: rgba(245, 248, 250, .94); backdrop-filter: blur(6px); padding: 12px 0 10px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li { font-size: 12.5px; color: var(--slate); line-height: 1.25; }
.steps li .bar { height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 6px; overflow: hidden; }
.steps li .bar i { display: block; height: 100%; width: 0; background: var(--band); background-size: 400% 100%; transition: width .35s ease; }
.steps li.past .bar i, .steps li.current .bar i { width: 100%; }
.steps li.current { color: var(--navy); font-weight: 700; }
.steps li span.n { font-weight: 700; margin-right: 3px; }
@media (max-width: 560px) { .steps li .t { display: none; } .steps li.current .t { display: inline; } }

/* ---------- Sections & questions ---------- */
.section { display: none; }
.section.active { display: block; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section > h2 {
  font-family: var(--head); color: var(--navy); font-size: 22px; margin: 22px 0 6px;
  display: flex; align-items: center; gap: 10px;
}
.section > h2::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--band); }

.q {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin: 14px 0;
}
.q > legend, .q > .prompt { padding: 0; }
fieldset.q { min-width: 0; }
fieldset.q > legend { float: left; width: 100%; }
fieldset.q > legend + * { clear: both; }
.prompt { font-weight: 700; color: var(--navy); font-size: 17px; line-height: 1.35; margin: 0; }
.prompt .num { margin-right: 4px; }
.help { color: var(--slate); font-style: italic; font-size: 14.5px; margin: 6px 0 14px; }
.counter { font-size: 13px; color: var(--slate); margin: -6px 0 10px; font-style: normal; }
.counter b { color: var(--navy); }

/* option rows */
.opts { display: grid; gap: 6px; }
.opts.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt .face {
  display: flex; align-items: flex-start; gap: 12px; padding: 9px 12px; border-radius: 8px;
  border: 1px solid transparent; transition: background .15s, border-color .15s; cursor: pointer;
}
.opt .letter {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--navy); background: var(--wash); transition: all .15s;
}
.opt .label { padding-top: 2px; }
.opt:hover .face { background: #f2f7fa; }
.opt input:focus-visible + .face { outline: 3px solid rgba(27, 163, 166, .45); outline-offset: 1px; }
.opt input:checked + .face { background: var(--wash); border-color: var(--teal); }
.opt input:checked + .face .letter { background: var(--navy); color: #fff; }
.opt input:disabled + .face { opacity: .45; cursor: not-allowed; }
.opt.excl-first { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.opts.compact .opt.excl-first { margin-top: 0; padding-top: 0; border-top: 0; }

.other {
  display: none; margin: 4px 0 6px 50px;
}
.other.show { display: block; }
.other input { width: 100%; }

input[type="text"], textarea {
  width: 100%; border: 1px solid #b9cbd5; border-radius: 8px; padding: 10px 12px; background: #fff;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(27, 163, 166, .2); }
textarea { resize: vertical; min-height: 84px; }
.charcount { text-align: right; font-size: 12px; color: var(--slate); margin-top: 4px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.fields label { font-size: 13.5px; color: var(--slate); display: grid; gap: 4px; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }

/* most urgent sub-question */
.urgent { margin-top: 14px; padding: 14px 16px; border-radius: 8px; background: #fbf6e8; border: 1px solid #f1dfae; display: none; }
.urgent.show { display: block; }
.urgent .ulabel { font-weight: 700; color: var(--navy); font-size: 15px; margin-bottom: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* segmented controls (matrix + rating) */
.seg-row { padding: 12px 0; border-top: 1px solid var(--line); }
.seg-row:first-of-type { border-top: 0; padding-top: 2px; }
.seg-row .rlabel { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid #b9cbd5; background: #fff; font-size: 14px; cursor: pointer; transition: all .15s;
}
.chip span b { color: var(--navy); }
.chip:hover span { border-color: var(--teal); }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:checked + span b { color: #fff; }
.chip input:focus-visible + span { outline: 3px solid rgba(27, 163, 166, .45); outline-offset: 1px; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)) auto; gap: 6px; align-items: stretch; }
.scale .chip span { justify-content: center; width: 100%; font-weight: 700; }
.scale .chip.u span { font-weight: 400; color: var(--slate); white-space: nowrap; }
.scale .chip.u input:checked + span { color: #fff; }
.anchors { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)) auto; gap: 6px; font-size: 12px; color: var(--slate); margin-top: 4px; }
.anchors span:last-of-type { text-align: right; }
.anchors .lo { grid-column: 1 / 3; } .anchors .hi { grid-column: 4 / 6; text-align: right; }
@media (max-width: 520px) { .scale .chip.u span { padding: 7px 8px; font-size: 12.5px; } }

.note { color: var(--slate); font-style: italic; font-size: 14.5px; margin: 14px 2px; }
.note.strong { color: var(--navy); font-style: normal; font-weight: 700; background: var(--wash); padding: 12px 16px; border-radius: 8px; }

/* ---------- Nav ---------- */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 40px; }
.btn {
  border: 0; border-radius: 999px; padding: 12px 26px; font-weight: 700; font-size: 15.5px; cursor: pointer;
  background: var(--navy); color: #fff; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--navy-deep); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid #b9cbd5; }
.btn.ghost:hover { background: #fff; }
.btn.go { background: var(--band); background-size: 140% 100%; }
.btn.go:hover { background-position: 100% 0; }
.btn[disabled] { opacity: .55; cursor: progress; }
.nav .spacer { flex: 1; }
.saved { font-size: 12.5px; color: var(--slate); }
.error { color: var(--danger); font-weight: 700; margin: 10px 0; }

/* ---------- Done ---------- */
.done { text-align: center; padding: 34px 10px 50px; }
.done .tick { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; background: var(--band); display: grid; place-items: center; }
.done .tick.muted { background: var(--navy); }
.done h2 { font-family: var(--head); color: var(--navy); font-size: 28px; margin: 0 0 10px; }
.done p { max-width: 560px; margin: 0 auto; color: var(--navy); }

/* ---------- Footer ---------- */
.foot { background: var(--navy); color: #cfe0ea; margin-top: 10px; }
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 16px; flex-wrap: wrap; }
.foot img { width: 220px; height: auto; }
.foot .links { text-align: right; font-size: 13px; line-height: 1.6; }
.foot .links b { color: #fff; font-weight: 400; }
.foot .links a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); }
.foot .links a:hover, .foot .links a:focus-visible { border-bottom-color: var(--green); }
.foot .accent { height: 4px; background: linear-gradient(90deg, var(--green), var(--gold)); }
@media (max-width: 560px) { .foot .wrap { justify-content: center; } .foot .links { text-align: center; } }

.gate { text-align: center; padding: 50px 10px; color: var(--navy); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media print {
  .stepper, .nav, .foot { display: none; }
  .section { display: block !important; }
}
