/* ------------------------------------------------------------------
   The page IS the form. Everything else is a thin bar and a footer.
   Colours are taken from the forms themselves.
------------------------------------------------------------------- */

:root {
  --green: #00a550;       /* TerryWhite Chemmart green, sampled from the PDFs */
  --green-dark: #008a42;
  --navy: #00263a;
  --desk: #d8dde2;        /* the surface the paper sits on */
  --ink: #16232c;
  --muted: #5d6b76;
  --tint: rgba(0, 165, 80, .11);
  --tint-hover: rgba(0, 165, 80, .22);
  --focus: #fff2a8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

/* ---------------- top bar ---------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.bar .who { margin-right: auto; line-height: 1.25; }
.bar .who strong { font-size: 14.5px; font-weight: 600; }
.bar .who small { display: block; opacity: .7; font-size: 12px; }

.bar select {
  font: inherit;
  font-size: 13.5px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: #fff;
}
.bar select option { color: #000; }

button {
  font: inherit;
  font-size: 13.5px;
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { background: rgba(255,255,255,.15); }
button.primary { background: var(--green); border-color: var(--green); font-weight: 600; }
button.primary:hover { background: var(--green-dark); }
button:disabled { opacity: .45; cursor: default; }

.bar .msg { flex-basis: 100%; font-size: 12.5px; opacity: .85; }
.bar .msg:empty { display: none; }

/* Shown only when the page is loaded inside another site's frame, e.g. by
   registrar "forward with masking". */
.framed-notice {
  background: #fff3cd;
  border-bottom: 1px solid #e0cf8f;
  color: #6b5406;
  font-size: 13px;
  padding: 8px 18px;
  text-align: center;
}
.framed-notice a { color: #6b5406; font-weight: 600; }

/* ---------------- intro strip ---------------- */

.intro {
  background: #fff;
  border-bottom: 3px solid var(--green);
  padding: 16px 18px;
}
.intro div { max-width: 816px; margin: 0 auto; }
.intro p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.intro strong { color: var(--ink); }

/* ---------------- the paper ---------------- */

.sheets {
  padding: 26px 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.formwrap { width: 100%; max-width: 816px; }

.formhead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--ink);
}
.formhead h2 { font-size: 15px; margin: 0; font-weight: 600; }
.formhead span { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.formhead a {
  font-size: 12.5px;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,38,58,.35);
}
.formhead a:hover { color: var(--green-dark); border-color: var(--green); }

/* One sheet of paper. The SVG is a replica of the PDF page; the fields sit
   on top of it, positioned in the same coordinate space. */
.sheet {
  position: relative;
  width: 100%;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0,0,0,.22);
  line-height: 0;
}
.sheet > svg { display: block; width: 100%; height: auto; }

/* ---------------- fields ---------------- */

.f {
  position: absolute;
  font-family: Calibri, Carlito, Arial, "Segoe UI", sans-serif;
  border: 0;
  outline: none;
  margin: 0;
  padding: 0 1px;
  color: #111;
  background: var(--tint);
  line-height: 1.05;
  border-radius: 1px;
}
/* Shading disappears once something is typed, so a completed form on screen
   looks exactly like the printed page. */
.f:not(:placeholder-shown) { background: transparent; }
.f:hover { background: var(--tint-hover); }
.f:focus { background: var(--focus); box-shadow: 0 0 0 2px var(--green); }

.f.cell { text-align: center; padding: 0; }

.tick {
  position: absolute;
  cursor: pointer;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-weight: 700;
  line-height: 1;
  border-radius: 1px;
}
.tick:hover { background: var(--tint-hover); }
.tick.on { background: transparent; }
.tick:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }

.sig {
  position: absolute;
  color: #9a7b12;
  border-bottom: 1.5px dashed #c9a227;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 1;
  padding-bottom: 1px;
  pointer-events: none;
  white-space: nowrap;
  opacity: .8;
}

/* ---------------- downloads + footer ---------------- */

.downloads {
  max-width: 816px;
  margin: 26px auto 0;
  background: #fff;
  border-radius: 8px;
  border-left: 5px solid var(--green);
  padding: 18px 20px;
}
.downloads h3 { margin: 0 0 4px; font-size: 15px; }
.downloads p { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.downloads ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.downloads a {
  display: inline-block;
  text-decoration: none;
  font-size: 13.5px;
  color: var(--navy);
  border: 1px solid #ccd3d9;
  border-radius: 6px;
  padding: 9px 14px;
  background: #fff;
}
.downloads a:hover { border-color: var(--green); color: var(--green-dark); }

footer {
  max-width: 816px;
  margin: 0 auto;
  padding: 22px 20px 50px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.loading {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.loading code { background: #fff; padding: 1px 5px; border-radius: 3px; }

/* The printer always gets the generated PDF, never this page. */
@media print { body { display: none !important; } }
