
:root {
  --navy: #202656; --purple: #5B2C81; --blue: #2F9AD5; --green: #74AE43;
  --yellow: #F5C12A; --orange: #EC6125; --pink: #C6206E;
  --bg: #f4f5f9; --card: #ffffff; --line: #e2e4ef; --text: #202656; --muted: #5a5f7a; --error: #b3123f;
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
header.site {
  background: var(--navy); color: #fff; border-top: 5px solid;
  border-image: linear-gradient(to right, #C6206E, #EC6125, #F5C12A, #74AE43, #2F9AD5, #5B2C81) 1;
}
header.site .inner { max-width: 44rem; margin: 0 auto; padding: 0.9rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
header.site .title { font-weight: 700; font-size: 1rem; letter-spacing: 0.01em; margin: 0; }
header.site .org { font-size: 0.8rem; opacity: 0.75; }
.progress { max-width: 44rem; margin: 1rem auto 0; padding: 0 1rem; }
.progress .bar { height: 8px; background: #d9dcea; border-radius: 4px; overflow: hidden; }
.progress .fill { height: 100%; background: var(--blue); transition: width 0.3s; }
.progress .label { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
main { max-width: 44rem; margin: 1rem auto 3rem; padding: 0 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 8px; padding: 1.5rem; box-shadow: 0 1px 2px rgba(32,38,86,0.06); }
.intro { color: var(--muted); font-style: italic; margin: 0 0 1.5rem; }
fieldset.q, div.q { border: 0; padding: 0; margin: 0 0 2rem; }
fieldset.q:last-of-type { margin-bottom: 0.5rem; }
legend.q-text, label.q-text { display: block; font-weight: 600; font-size: 1.05rem; margin-bottom: 0.5rem; padding: 0; }
.q-note { color: var(--muted); font-size: 0.9rem; margin: -0.2rem 0 0.7rem; }
.q-error { color: var(--error); font-weight: 600; font-size: 0.95rem; margin: 0 0 0.6rem; }
fieldset.q.has-error { border-left: 3px solid var(--error); padding-left: 0.9rem; }
.choice { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.45rem 0; }
.choice input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; flex: 0 0 auto; accent-color: var(--blue); }
.choice label { cursor: pointer; }
.other-text { margin: 0.2rem 0 0.4rem 1.85rem; }
input[type=text], input[type=email], input[type=number], select, textarea {
  font: inherit; color: inherit; width: 100%; max-width: 32rem; padding: 0.55rem 0.7rem;
  border: 1px solid #b9bdd3; border-radius: 6px; background: #fff;
}
input[type=number] { max-width: 12rem; }
textarea { min-height: 7.5rem; max-width: none; }
textarea.long { min-height: 11rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 0; }
.amount { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0.6rem; }
.amount .cur { font-weight: 600; }
/* Matrices: a grid on wide screens, stacked cards on narrow ones. */
.matrix { display: grid; gap: 0.25rem 0; }
.matrix .head { display: grid; grid-template-columns: minmax(10rem, 1.3fr) repeat(var(--cols), minmax(4.5rem, 1fr)); column-gap: 0.6rem; font-size: 0.8rem; line-height: 1.25; color: var(--muted); align-items: end; text-align: center; padding-bottom: 0.4rem; }
.matrix .head span:first-child { text-align: left; }
.matrix fieldset.row { border: 0; margin: 0; padding: 0.35rem 0; border-top: 1px solid var(--line); min-width: 0; }
.matrix fieldset.row .grid { display: grid; grid-template-columns: minmax(10rem, 1.3fr) repeat(var(--cols), minmax(4.5rem, 1fr)); column-gap: 0.6rem; align-items: center; }
.matrix fieldset.row .row-label { font-weight: 500; }
.matrix fieldset.row .cell { text-align: center; }
.matrix fieldset.row .cell label { display: block; padding: 0.35rem 0; cursor: pointer; }
.matrix fieldset.row .cell .col { display: none; }
.matrix.has-error fieldset.row { border-left: 0; }
@media (max-width: 640px) {
  .matrix .head { display: none; }
  .matrix fieldset.row { padding: 0.7rem 0; }
  .matrix fieldset.row .grid { display: block; }
  .matrix fieldset.row .row-label { display: block; margin-bottom: 0.3rem; }
  .matrix fieldset.row .cell { text-align: left; }
  .matrix fieldset.row .cell label { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; }
  .matrix fieldset.row .cell .col { display: inline; }
}
/* Repeatable blocks */
.entry { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin: 0 0 1rem; background: #fafbfe; }
.entry h3 { margin: 0 0 0.8rem; font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.entry .field { margin-bottom: 0.9rem; }
.entry .field label.f { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.entry .remove { margin-top: 0.2rem; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.5rem 0 1rem; flex-wrap: wrap; }
.prose .actions { justify-content: flex-start; }
.prose .actions .button, .prose .actions button { flex: 1 1 12rem; text-align: center; }
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 0.7rem 1.4rem;
  border: 1px solid var(--blue); background: var(--blue); color: #fff; text-decoration: none; display: inline-block;
}
button.secondary, .button.secondary { background: #fff; color: var(--navy); border-color: #b9bdd3; }
button.small { padding: 0.4rem 0.9rem; font-size: 0.9rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
a { color: var(--blue); }
.error-summary { border: 2px solid var(--error); border-radius: 8px; padding: 0.8rem 1rem; margin: 0 0 1.5rem; }
.error-summary h2 { margin: 0 0 0.4rem; font-size: 1rem; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prose h1, .prose h2.page { font-size: 1.6rem; margin-top: 0; }
.prose h2 { font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
.prose p { margin: 0 0 0.9rem; }
.save-later { text-align: center; font-size: 0.9rem; margin: 1rem 0 0; }
footer.site { max-width: 44rem; margin: 0 auto 2rem; padding: 0 1rem; color: var(--muted); font-size: 0.8rem; }
