:root {
  --navy: #44546a;
  --navy-dark: #2f3b4c;
  --teal: #0e8c8c;
  --teal-soft: #e3f2f2;
  --ink: #1f2a37;
  --grey: #5b6675;
  --line: #d5dae1;
  --bg: #f4f6f8;
  --card: #ffffff;
  --err: #b42318;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[hidden] { display: none !important; }

/* header */
.top { background: var(--navy); color: #fff; border-bottom: 4px solid var(--teal); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.byline { font-size: .8rem; opacity: .85; }
.langs { display: flex; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; overflow: hidden; flex: none; }
.lang { background: transparent; color: #fff; border: 0; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.lang.on { background: #fff; color: var(--navy); }

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

/* intro */
.intro h1 { font-size: 1.6rem; margin: 8px 0 0; color: var(--navy-dark); }
.intro .sub { margin: 2px 0 12px; color: var(--grey); }
.intro h2 { font-size: 1.05rem; margin: 18px 0 4px; color: var(--navy-dark); }
.intro p, .intro ul { margin: 0 0 8px; }
.intro ul { padding-left: 20px; }

.banner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--teal-soft); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: .92rem; }
.link { background: none; border: 0; color: var(--teal); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }

/* progress */
.progress { margin: 4px 0 14px; }
.progress-text { font-size: .85rem; color: var(--grey); margin-bottom: 4px; }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: var(--teal); }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; color: var(--navy-dark); margin: 6px 0 6px; }
.badge { background: var(--teal); color: #fff; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1rem; flex: none; }
.section-intro { color: var(--grey); margin: 0 0 12px; }

/* questions */
form { margin-top: 12px; }
.q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; margin: 0 0 14px; min-width: 0; }
.q.has-err { border-color: var(--err); }
/* float keeps the legend inside the card instead of on its border */
.q-head { float: left; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 0; margin-bottom: 10px; width: 100%; }
.q-head + * { clear: both; }
.q-num { font-weight: 700; color: var(--teal); }
.q-text { font-weight: 650; flex: 1 1 260px; color: var(--navy-dark); }
.q-opt { font-weight: 400; color: var(--grey); }
.q-hint { font-size: .82rem; color: var(--teal); font-style: italic; flex-basis: 100%; }
.note { font-size: .88rem; color: var(--grey); margin: 6px 0 4px; font-style: italic; }

.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.opt:hover { background: var(--teal-soft); }
.opt.off { opacity: .45; cursor: not-allowed; }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); flex: none; }
.opt-group-title { font-weight: 650; color: var(--teal); font-size: .9rem; margin: 10px 0 2px; }
.opt-group:first-child .opt-group-title { margin-top: 0; }

.field { margin: 8px 0; }
.field > label:not(.opt) { display: block; font-size: .92rem; color: var(--grey); margin-bottom: 4px; }
.input-row { display: flex; align-items: center; gap: 8px; }
input[type=text], input[type=email], input[type=tel], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
input.short { max-width: 220px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 3px solid rgba(14,140,140,.35); outline-offset: 1px; border-color: var(--teal); }
.unit { color: var(--grey); font-size: .92rem; }
.other { margin: 4px 0 0 30px; }
.err { color: var(--err); font-size: .88rem; min-height: 0; }
.err:empty { display: none; }
.has-err > input, .has-err .input-row input, .has-err textarea { border-color: var(--err); }

/* E5 barrier grid */
.grid-row { padding: 10px 0; border-top: 1px solid var(--line); }
.grid-row:first-child { border-top: 0; padding-top: 0; }
.grid-label { margin-bottom: 6px; }
.scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pill { position: relative; display: block; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 7px 4px; font-size: .85rem; cursor: pointer; line-height: 1.25; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill:has(input:checked) { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.pill:has(input:focus-visible) { outline: 3px solid rgba(14,140,140,.35); }

/* C1 equipment */
.eq-list { display: grid; gap: 8px; }
.eq-card { border: 1px solid var(--line); border-radius: 8px; }
.eq-head { font-weight: 600; }
.eq-card:has(.eq-head input:checked) { border-color: var(--teal); background: #fbfefe; }
.eq-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; padding: 0 12px 8px 40px; }
.eq-body .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.eq-body .field { margin: 6px 0; }

/* closing */
.ts { margin: 6px 0 12px; min-height: 65px; }
.send-msg { color: var(--err); font-weight: 600; }
.send-msg:empty { display: none; }
.consent-no { background: var(--teal-soft); padding: 12px 14px; border-radius: var(--radius); }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.nav .primary { margin-left: auto; }
button.primary, button.secondary { font: inherit; font-weight: 650; border-radius: 999px; padding: 11px 26px; cursor: pointer; border: 2px solid var(--teal); }
button.primary { background: var(--teal); color: #fff; }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: #fff; color: var(--teal); }

.done { text-align: center; padding: 48px 8px; }
.done h1 { color: var(--teal); }
.ref { color: var(--grey); font-family: ui-monospace, Consolas, monospace; }

@media (max-width: 560px) {
  .top-in { padding: 8px 16px; }
  .title { font-size: .95rem; }
  .byline { font-size: .72rem; }
  .q { padding: 12px 12px 10px; }
  .eq-body { padding: 0 10px 8px 10px; }
  .other { margin-left: 0; }
  .pill { font-size: .78rem; }
}
