/* forms.allysonbatte.com — Sunshine House CO/TX. Light theme only, matching the proposal site at
   proposal.allysonbatte.com: the tokens, type scale and card/callout components are ported from
   its stylesheet so a director who has seen one recognises the other. What is new here is the
   form layer — inputs, choice rows, scales, the builder and the results bars.

   No rule in this file may be replaced by a style attribute in the markup: the Content-Security
   Policy carries no 'unsafe-inline', so proportional widths in the results are drawn as SVG. */

:root {
  color-scheme: light;
  --teal: #196887; --cyan: #05A1D3; --yellow: #FFE55D; --cream: #FEFBEC; --sand: #EDE8DA;
  --ink: #101010; --ink2: #52514E; --muted: #898781; --rule: #E6E2D6; --page: #FFFFFF;
  --track: #D6E9F0; --good: #006300; --amber: #A8620B; --danger: #B42318; --danger-bg: #FDF2F2;
  --teal-dark: #12556F;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif; font-size: 15.5px; line-height: 1.55;
}
body.centred { background: var(--cream); min-height: 100vh; display: grid; place-items: center; padding: 24px 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 720px; }
.wrap.mid { max-width: 880px; }

h1, h2, h3 { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; color: var(--teal); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; max-width: 26ch; }
h2 { font-size: 22px; margin-top: 0; padding-bottom: 7px; border-bottom: 4px solid var(--yellow); display: inline-block; }
h3 { font-size: 16.5px; margin: 0 0 .3em; }
a { color: var(--cyan); }
a:hover { color: var(--teal); }
strong, b { font-weight: 700; }
p { margin: 0 0 14px; }
.lede { font-size: 17px; max-width: 68ch; color: var(--ink2); margin: 10px 0 20px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; color: var(--ink2); margin: 0 0 8px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.tight { gap: 6px; }
.spacer { flex: 1 1 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The logo, built from a rounded square rather than an image file so nothing has to load. */
.mark { width: 38px; height: 38px; border-radius: 9px; background: var(--teal); position: relative; margin-bottom: 18px; }
.mark::before { content: ""; position: absolute; left: 22%; top: 22%; width: 34%; height: 34%; border-radius: 50%; background: var(--cream); }
.mark::after { content: ""; position: absolute; left: 22%; bottom: 20%; width: 56%; height: 11%; border-radius: 3px; background: var(--yellow); }
.mark.sm { width: 26px; height: 26px; border-radius: 6px; margin: 0; flex: 0 0 auto; }

/* ---------------------------------------------------------------- chrome */

.bar { background: var(--cream); border-bottom: 1px solid var(--rule); padding: 12px 0; }
.barrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.barrow .kicker { margin: 0; }
.barnav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; font-size: 13.5px; }
.barnav a, .barnav button.linkish { color: var(--teal); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; padding: 2px 0; }
.barnav a:hover, .barnav button.linkish:hover { border-bottom-color: var(--yellow); color: var(--teal); }
.barnav a.current { color: var(--ink); border-bottom-color: var(--yellow); }
button.linkish { background: none; border: 0; font: inherit; cursor: pointer; }

.hero { background: var(--cream); border-bottom: 1px solid var(--rule); padding: 38px 0 26px; }
.hero h1 { margin-bottom: 10px; }
.hero .lede { margin-bottom: 4px; }
.page-head { padding: 30px 0 6px; }
.crumb { font-size: 13px; margin: 0 0 10px; }
.crumb a { color: var(--teal); text-decoration: none; font-weight: 600; border-bottom: 2px solid var(--rule); }
.crumb a:hover { border-bottom-color: var(--yellow); }
.sect { padding: 26px 0 34px; }
.sect-cream { background: var(--cream); border-top: 1px solid var(--rule); }
.foot { padding: 26px 0 44px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--rule); margin-top: 36px; }

/* ---------------------------------------------------------------- cards, banners, tiles */

.card { background: var(--cream); border: 1px solid var(--rule); border-top: 4px solid var(--teal); border-radius: 10px; padding: 16px 18px; }
.card > :last-child { margin-bottom: 0; }
.card h3 { color: var(--teal); }
.card.plain { background: var(--page); }
.notice { max-width: 440px; background: var(--page); padding: 32px 30px 28px; }
.notice h1 { font-size: 23px; margin-bottom: 12px; }
.notice p { color: var(--ink2); font-size: 14.5px; }

.callout { border-left: 5px solid var(--yellow); background: var(--sand); border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 0 0 18px; }
.callout > :last-child { margin-bottom: 0; }
.callout h3 { font-size: 15px; margin-bottom: 4px; }
.callout p { font-size: 14px; color: var(--ink2); max-width: 76ch; }

.banner { border-radius: 0 8px 8px 0; padding: 11px 14px; margin: 0 0 18px; font-size: 14px; }
.banner > :last-child { margin-bottom: 0; }
.banner.err { background: var(--danger-bg); border-left: 4px solid var(--danger); color: #912018; }
.banner.ok { background: #F1F8F1; border-left: 4px solid var(--good); color: #14571A; }
.banner.warn { background: #FDF6EA; border-left: 4px solid var(--amber); color: #7A4708; }
.banner ul { margin: 6px 0 0; padding-left: 20px; }
.banner li { margin-bottom: 3px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 22px; }
.stat { background: var(--page); border: 1px solid var(--rule); border-radius: 10px; padding: 13px 16px; }
.stat .label { font-size: 12.5px; color: var(--ink2); margin-bottom: 3px; }
.stat .value { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-size: 27px; font-weight: 800; color: var(--teal); line-height: 1.15; }
.stat .note { font-size: 12px; color: var(--muted); margin-top: 5px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink2); background: var(--page); }
.pill.open { background: var(--teal); border-color: var(--teal); color: #fff; }
.pill.closed { background: var(--sand); }
.pill.revoked { background: var(--danger-bg); border-color: #E7C4C0; color: #912018; }
.pill.locked { background: #FDF6EA; border-color: #EBD5B0; color: #7A4708; }
.pill.type { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--teal); background: var(--cream); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-block; font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1.3;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--teal);
  background: var(--teal); color: #fff; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
.btn.ghost { background: var(--page); color: var(--teal); border-color: var(--rule); }
.btn.ghost:hover { background: var(--cream); color: var(--teal); border-color: var(--teal); }
.btn.danger { background: var(--page); color: var(--danger); border-color: #E7C4C0; }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { font-size: 13px; padding: 6px 11px; border-radius: 7px; font-weight: 600; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- form controls */

.field { margin: 0 0 16px; }
.field > label, .flabel { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink2); margin-bottom: 5px;
                          text-transform: uppercase; letter-spacing: .05em; }
.field .hintline { font-size: 12.5px; color: var(--muted); margin: 5px 0 0; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: inherit; color: var(--ink);
  background: var(--page); border: 1px solid var(--rule); border-radius: 8px; line-height: 1.45;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); }
textarea { min-height: 108px; resize: vertical; }
textarea.tall { min-height: 190px; }
textarea.code { font-family: "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 13px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--teal) 50%), linear-gradient(135deg, var(--teal) 50%, transparent 50%);
         background-position: right 16px top 55%, right 11px top 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--teal); width: 17px; height: 17px; margin: 0; flex: 0 0 auto; }
.inline-check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }

/* ---------------------------------------------------------------- the survey form */

.qlist { display: grid; gap: 26px; margin: 0 0 28px; }
.q { scroll-margin-top: 20px; }
.q > h3 { font-size: 17px; color: var(--ink); font-family: "Montserrat", "Segoe UI", system-ui, sans-serif; font-weight: 700; line-height: 1.4; max-width: 70ch; }
.q .qhelp { font-size: 13.5px; color: var(--ink2); margin: -2px 0 10px; max-width: 70ch; }
.q .req { color: var(--danger); font-weight: 700; margin-left: 3px; }
.q.invalid { border-left: 4px solid var(--danger); padding-left: 14px; margin-left: -18px; }
.qerr { color: #912018; font-size: 13.5px; font-weight: 600; margin: 0 0 8px; }
.q-section { border-top: 1px solid var(--rule); padding-top: 22px; }
.q-section h3 { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; color: var(--teal); font-size: 19px;
                border-bottom: 3px solid var(--yellow); display: inline-block; padding-bottom: 5px; }

.choices { display: grid; gap: 7px; max-width: 640px; }
.choice { display: flex; align-items: flex-start; gap: 11px; padding: 9px 13px; border: 1px solid var(--rule);
          border-radius: 8px; background: var(--page); cursor: pointer; font-size: 14.5px; line-height: 1.45; }
.choice:hover { border-color: var(--cyan); background: var(--cream); }
.choice input { margin-top: 2px; }
.choice:has(input:checked) { border-color: var(--teal); background: var(--cream); font-weight: 600; }
.choice.other { flex-wrap: wrap; }
.choice.other input[type="text"] { flex: 1 1 200px; min-width: 140px; padding: 5px 9px; font-size: 14px; font-weight: 400; }

/* A scale is a row of numbered pills with its ends named, so nobody has to guess which end is good. */
.scale { max-width: 640px; }
.scale-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.scale-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px 7px; min-width: 58px; flex: 1 1 58px;
             border: 1px solid var(--rule); border-radius: 8px; background: var(--page); cursor: pointer;
             font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-weight: 800; font-size: 18px; color: var(--teal); }
.scale-opt:hover { border-color: var(--cyan); background: var(--cream); }
.scale-opt:has(input:checked) { background: var(--teal); border-color: var(--teal); color: #fff; }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--ink2); }
.scale-ends span { max-width: 45%; }
.scale-ends span:last-child { text-align: right; }

.ranked { display: grid; gap: 9px; max-width: 640px; }
.rank-row { display: flex; align-items: center; gap: 11px; }
.rank-n { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-weight: 800; color: var(--cyan); font-size: 15px;
          width: 22px; flex: 0 0 auto; text-align: right; }

.identity { background: var(--cream); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px 4px; margin: 0 0 28px; }
.identity .flabel { margin-bottom: 5px; }
.submitbar { border-top: 1px solid var(--rule); padding-top: 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- the builder */

.builder { display: grid; gap: 22px; }
.qcard { border: 1px solid var(--rule); border-top: 4px solid var(--teal); border-radius: 10px; background: var(--page); }
.qcard.is-section { border-top-color: var(--yellow); }
.qcard-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--cream);
              border-bottom: 1px solid var(--rule); border-radius: 6px 6px 0 0; flex-wrap: wrap; }
.qcard-n { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-weight: 800; color: var(--cyan); font-size: 13px; letter-spacing: .1em; min-width: 58px; }
.qcard-head select { width: auto; min-width: 165px; font-size: 13px; padding: 6px 30px 6px 10px; border-radius: 7px; }
.qcard-body .grid2 { gap: 0 16px; }
.qcard-body input[type="number"] { max-width: 130px; }
.qcard-body { padding: 16px 16px 4px; }
.qcard-body .field:last-child { margin-bottom: 12px; }
.qtools { display: flex; gap: 5px; }
.qtools button { font: inherit; font-size: 13px; line-height: 1; padding: 7px 9px; border: 1px solid var(--rule);
                 background: var(--page); color: var(--ink2); border-radius: 6px; cursor: pointer; }
.qtools button:hover:not([disabled]) { border-color: var(--teal); color: var(--teal); background: var(--cream); }
.qtools button[disabled] { opacity: .35; cursor: not-allowed; }
.qtools button.rm:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.addbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; background: var(--cream);
          border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.addbar .field { margin: 0; min-width: 200px; }
.builder-empty { border: 2px dashed var(--rule); border-radius: 10px; padding: 26px; text-align: center; color: var(--muted); }
.savebar { position: sticky; bottom: 0; background: var(--page); border-top: 1px solid var(--rule);
           padding: 14px 0; margin-top: 8px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- tables and results */

.tv { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--page); }
.tv th, .tv td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tv th { font-weight: 700; color: var(--ink); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.tv tr:hover td { background: var(--cream); }
.tv td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv .empty { color: var(--muted); }
.scroller { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; }
.scroller .tv th:first-child, .scroller .tv td:first-child { padding-left: 16px; }

.subhead { font-size: 19px; margin: 34px 0 8px; padding-bottom: 5px; border-bottom: 3px solid var(--yellow); display: inline-block; }
.stat .value.small { font-size: 15px; font-weight: 700; line-height: 1.35; }

.rq { border: 1px solid var(--rule); border-radius: 10px; background: var(--page); padding: 16px 18px; margin: 0 0 16px; }
.rq > h3 { font-family: "Montserrat", "Segoe UI", system-ui, sans-serif; font-size: 15.5px; color: var(--ink); max-width: 70ch; }
.rq .rqmeta { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }

/* A bar is an SVG so its length can be markup rather than a style attribute; the label above it
   is ordinary HTML, so long option text wraps instead of running off the end of a viewBox. */
.bar-row { margin: 0 0 11px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 13.5px; margin-bottom: 4px; }
.bar-head .cnt { color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.bar-row.is-other .bar-head { color: var(--ink2); font-style: italic; }
.bar-track { display: block; width: 100%; height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.bar-fill { fill: var(--teal); }
.bar-row.is-other .bar-fill { fill: var(--cyan); }
.answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.answers li { border-left: 3px solid var(--track); padding: 4px 0 4px 13px; font-size: 14px; color: var(--ink); max-width: 78ch; white-space: pre-wrap; }
.answers li .who { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.otherlist { margin: 12px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--ink2); }
details.more > summary { cursor: pointer; color: var(--teal); font-weight: 600; font-size: 13.5px; margin-top: 10px; }

.linkrow code { font-family: "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 12.5px; word-break: break-all; }

/* One card per response, because most of what this survey collects is prose and a wide grid of
   truncated cells would be unreadable. The CSV is there for the grid. */
.resp { border: 1px solid var(--rule); border-radius: 10px; background: var(--page); margin: 0 0 14px; }
.resp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 9px 16px; font-size: 13px;
             background: var(--cream); border-bottom: 1px solid var(--rule); border-radius: 9px 9px 0 0; }
.resp-head b { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-size: 15px; color: var(--teal); }
.resp dl { margin: 0; padding: 15px 18px 18px; }
.resp dt { font-size: 12.5px; font-weight: 700; color: var(--ink2); margin-top: 14px; max-width: 70ch; }
.resp dl > dt:first-child { margin-top: 0; }
.resp dd { margin: 3px 0 0; font-size: 14.5px; white-space: pre-wrap; max-width: 78ch; }
.resp dd.empty { color: var(--muted); font-style: italic; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding: 0 16px; }
  .barrow { gap: 8px; }
  .scale-opt { min-width: 46px; font-size: 16px; }
}

@media print {
  .bar, .savebar, .qtools, .addbar, .btn, .foot { display: none !important; }
  body { font-size: 11pt; }
  .rq, .card, .stat { break-inside: avoid; }
  .sect-cream, .hero { background: #fff !important; }
  /* Overriding display on the children is what actually reveals a closed <details> on paper. */
  details.more > summary { display: none; }
  details.more > * { display: block; }
}
