/* Gane Access F91 - brand: logo red #bc2026, ink #212a2e, rule grey #e8edf0 (taken from the F91 template) */
:root {
  --red: #bc2026;
  --red-dark: #96181d;
  --ink: #212a2e;
  --ink-2: #4a5459;
  --rule: #cfd6da;
  --band: #e8edf0;
  --bg: #f4f6f7;
  --card: #ffffff;
  --ok: #1f7a43;
  --defect: #bc2026;
  --focus: #1b5fd1;
  --radius: 8px;
  --font: Helvetica, Arial, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.4; font-size: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* header */
.top { background: #fff; border-bottom: 3px solid var(--ink); }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; }
.logo { height: 44px; width: auto; display: block; }
.titles h1 { margin: 0; font-size: 20px; line-height: 1.15; }
.titles .sub { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }
.badge { background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; padding: 6px 12px; border-radius: 3px; }
.top-inner .titles { grid-column: 1 / -1; grid-row: 2; }
.top-inner .badge { grid-column: 3; grid-row: 1; }

.test-banner { background: #fff3cd; color: #5c4400; border-bottom: 1px solid #e6c860; text-align: center; font-weight: 700; padding: 8px 12px; font-size: 14px; }

main { max-width: 1120px; margin: 0 auto; padding: 14px 12px 28px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.section-title { font-size: 18px; margin: 20px 4px 8px; }
.section-title small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* fields */
.field { display: block; margin: 0 0 12px; }
.field:last-child { margin-bottom: 0; }
.lab { display: block; font-weight: 700; font-size: 14px; margin: 0 0 5px; padding: 0; }
.lab small { font-weight: 400; color: var(--ink-2); }
input[type=text], input[type=date], input[type=time], textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
  padding: 10px 11px; border: 1px solid #9aa5ab; border-radius: 6px; background: #fff; color: var(--ink); min-height: 44px;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, textarea:focus, button:focus-visible, .seg input:focus-visible + span, .choice input:focus-visible + span {
  outline: 3px solid var(--focus); outline-offset: 1px;
}
.grid2, .grid3 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.hint { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.linkbtn { background: none; border: 0; color: var(--focus); font: inherit; font-size: 13px; text-decoration: underline; padding: 6px 2px; cursor: pointer; min-height: 32px; }
.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(188,32,38,.18); }
.group.invalid, .item.invalid { border-radius: 6px; box-shadow: 0 0 0 2px rgba(188,32,38,.35); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* choice cards (reason, outcome) */
.choices { display: grid; gap: 8px; }
.c4 { grid-template-columns: 1fr 1fr; }
.c3 { grid-template-columns: 1fr; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 2px solid var(--rule); border-radius: 8px; background: #fff; font-size: 15px; line-height: 1.25; }
.choice span::before { content: ""; flex: none; width: 18px; height: 18px; border: 2px solid #7b868c; border-radius: 50%; background: #fff; }
.choice input:checked + span { border-color: var(--ink); background: var(--band); font-weight: 700; }
.choice input:checked + span::before { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 45%, #fff 50%); }
.choice.out-restricted input:checked + span { border-color: #a35c00; background: #fff1de; }
.choice.out-restricted input:checked + span::before { border-color: #a35c00; background: radial-gradient(circle, #a35c00 0 45%, #fff 50%); }
.choice.out-do_not_use input:checked + span { border-color: var(--red); background: #fde9ea; }
.choice.out-do_not_use input:checked + span::before { border-color: var(--red); background: radial-gradient(circle, var(--red) 0 45%, #fff 50%); }

/* checklist */
.checklist { display: grid; gap: 10px; grid-template-columns: 1fr; }
.colhead { display: none; }
.sec { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.sec h3 { margin: 0; padding: 8px 12px; background: var(--ink); color: #fff; font-size: 14px; letter-spacing: .01em; }
.item { padding: 10px 12px; border-top: 1px solid var(--band); }
.item .txt { display: block; font-size: 15px; margin: 0 0 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { position: relative; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 2px solid var(--rule); border-radius: 7px; font-weight: 700; font-size: 15px; background: #fff; color: var(--ink-2); user-select: none; }
.seg input:checked + span.s-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg input:checked + span.s-defect { background: var(--defect); border-color: var(--defect); color: #fff; }
.seg input:checked + span.s-na { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

/* signature */
.sig-wrap { position: relative; border: 1px solid #9aa5ab; border-radius: 6px; background: #fff; }
#sig { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; border-radius: 6px; }
#sigClear { position: absolute; right: 6px; top: 4px; background: rgba(255,255,255,.85); }
#sigField.invalid .sig-wrap { border-color: var(--red); box-shadow: 0 0 0 2px rgba(188,32,38,.18); }

/* submit + errors */
.submit-row { margin-top: 6px; }
button.primary { width: 100%; min-height: 54px; border: 0; border-radius: 8px; background: var(--red); color: #fff; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; }
button.primary:hover { background: var(--red-dark); }
button.primary:disabled { opacity: .6; cursor: wait; }
.err-box { background: #fde9ea; border: 1px solid var(--red); color: #6d0f13; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.err-box ul { margin: 6px 0 0 18px; padding: 0; }

.done { text-align: center; padding: 28px 16px; }
.done-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 38px; line-height: 64px; margin: 0 auto 10px; }
.done h2 { margin: 0 0 6px; }
.done-ref { font-size: 26px; font-weight: 700; margin: 4px 0; }
.foot { text-align: center; font-size: 12px; color: var(--ink-2); padding: 10px 12px 22px; }

/* tablet / desktop: grid details, two-column checklist like the paper form */
@media (min-width: 700px) {
  .top-inner { grid-template-columns: auto 1fr auto; }
  .top-inner .titles { grid-column: 2; grid-row: 1; }
  .logo { height: 52px; }
  .titles h1 { font-size: 26px; }
  .titles .sub { font-size: 13px; }
  main { padding: 20px 20px 36px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 2fr; }
  .c3 { grid-template-columns: repeat(3, 1fr); }
  .c4 { grid-template-columns: repeat(4, 1fr); }
  .checklist { grid-template-columns: 1fr 1fr; align-items: start; gap: 14px; }
  .item { display: grid; grid-template-columns: 1fr 188px; gap: 10px; align-items: center; padding: 6px 10px; }
  .item .txt { margin: 0; font-size: 14px; }
  .seg { gap: 4px; }
  .seg span { min-height: 36px; font-size: 13px; border-radius: 5px; }
  .submit-row { max-width: 420px; margin-left: auto; }
}
@media (min-width: 1000px) {
  .colhead { display: none; }
}
@media print { .top, .test-banner, .foot { display: none; } }

#sigField { margin-top: 14px; }
