/* The forms a subcontractor opens from an email (9 November 2026). No portal chrome,
   one column on a phone, the same cards and fields as inside. */
/* The public forms' rules live at the end of this file ("public forms"). */

.check-list {
  list-style: none;
  padding: 0;
}

.check-list li {
  margin: 0.3rem 0;
}


/* UI audit, 9 November 2026. */
tr.is-muted td { color: var(--ink-soft); }
.is-strong { font-weight: 700; }

/* An Edit link in a table row: a 44px target, named for what it edits. */
.row-edit {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Requested as against submitted as: a difference is the thing to notice. */
.compare-table td,
.compare-table th { overflow-wrap: anywhere; }
.compare-table tr.is-different td:last-child {
  color: var(--red, #a43232);
  font-weight: 700;
}

.copy-row-public {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 600px) {
  /* The register's three header buttons as a grid, so none wraps to three lines. */
  .subc-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .subc-head-actions .btn { width: 100%; justify-content: center; }
  /* Add policy, Add answer, Add document: a finger-sized target. */
  .panel-head .btn-small { min-height: 44px; }
}

/* ---------- public forms ----------
   The pages a subcontractor opens from an email (redesigned 9 November 2026, after
   Zak's "why is it so ugly"). One centred column of white cards on the portal's
   ground, the portal's own header, and nothing else of the portal. They load no
   script: what a question shows after its answer is decided here, with :has(). */
.public-body {
  min-height: 100svh;
  background: var(--ground);
}

.public-head {
  flex: none;
  background: var(--charcoal-900);
  border-top: 2px solid var(--charcoal-700);
  color: #ffffff;
}

.public-head-inner {
  width: min(100%, 752px);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
}

.public-head .product-brand {
  margin: 0;
  overflow: visible;
}

/* The portal hides its wordmark on a phone to make room for menus. Here there are
   no menus, and "Solutions" is half the name. */
.public-head .product-name {
  display: inline;
  font-size: 1.05rem;
}

.public-head .product-arrows {
  width: 39px;
}

.public-main {
  width: min(100%, 752px);
  margin: 0 auto;
  padding: 28px 16px 40px;
  flex: 1 0 auto;
}

.public-card {
  margin: 0 0 1rem;
  padding: 1.5rem 1.6rem;
}

.public-card h1 {
  margin-bottom: 0.3rem;
  text-wrap: balance;
}

.public-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.public-for {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.public-lead {
  margin: 0;
  max-width: 65ch;
  font-size: 0.98rem;
  line-height: 1.6;
}

.public-intro .alert {
  margin: 1.1rem 0 0;
}

.public-intro .alert p {
  margin: 0.4rem 0 0;
}

/* The three parts, as links: where the form is going before you start. */
.public-index {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.public-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.public-index a {
  min-height: 44px;
  padding: 0.4rem 0.85rem 0.4rem 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.public-index a:hover {
  border-color: var(--line-strong);
  background: var(--panel);
}

.public-index-n {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--charcoal-900);
  color: var(--env-yellow);
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.public-form > .public-card {
  scroll-margin-top: 16px;
}

.public-part {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0;
}

/* The error summary: a real alert, with links that jump to the question. */
.public-errors {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  font-size: 0.92rem;
}

.public-errors ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.public-errors li + li {
  margin-top: 0.25rem;
}

.public-errors a {
  color: var(--red);
  font-weight: 500;
  text-underline-offset: 2px;
}

/* One question. */
.public-question {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.public-card h2 + .public-question {
  margin-top: 0.75rem;
}

.public-question:last-child {
  padding-bottom: 0.25rem;
}

/* The renewal card's one wrapper is the whole card. */
.public-question-policy,
.public-question-policy:last-child {
  padding: 0;
  border-top: 0;
}

.public-question-policy .public-for {
  margin-bottom: 1.1rem;
}

.public-question > label,
.public-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.public-label,
.public-choice legend {
  display: block;
  margin: 0 0 0.5rem;
  padding: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.public-question > label .public-label {
  margin-bottom: 0.1rem;
}

/* The fields under a question: every label the same size, weight and colour. */
.public-grid {
  margin-top: 1rem;
  gap: 1rem 1.1rem;
}

.public-grid label,
.public-form .form-grid label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.public-question .field-note {
  margin: 0;
}

/* What is typed reads as typed, not as a label, and at 16px a phone does not zoom
   into the field. */
.public-form input:not([type="radio"]),
.public-form textarea {
  font-size: 1rem;
  font-weight: 400;
}

.public-question .field-error {
  margin: 0.6rem 0 0;
  font-size: 0.86rem;
}

/* A question with an error: the red edge, and every one of its fields shown. */
.public-question.has-error {
  margin-left: -1.6rem;
  padding-left: calc(1.6rem - 3px);
  border-left: 3px solid var(--red);
}

/* Yes / No / N/A: three equal buttons, real radios underneath. */
.public-choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.public-help {
  margin: -0.2rem 0 0.7rem;
}

.public-segments {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
}

/* Yes / No only (Emma, 11 November 2026): two equal halves, no empty third. */
.public-segments-2 {
  width: min(100%, 240px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-segment {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.public-segment + .public-segment {
  border-left: 1px solid var(--line-strong);
}

.public-segment input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.public-segment span {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 140ms ease, color 140ms ease;
}

.public-segment:hover span {
  background: var(--ground);
}

.public-segment input:checked + span {
  background: var(--charcoal-900);
  color: #ffffff;
}

.public-segment input:focus-visible + span {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--env-yellow);
  outline-offset: -3px;
}

.public-question.has-error .public-segments {
  border-color: var(--red);
}

/* A file field as a drop zone. The input is the zone: padding makes room for the
   words drawn over it, which let clicks and drops through. */
.public-upload {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.public-upload-title {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.public-upload-zone {
  position: relative;
}

.public-upload-zone input[type="file"] {
  min-height: 132px;
  padding: 2.9rem 1rem 2.4rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--ground);
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.public-upload-zone input[type="file"]:hover {
  border-color: var(--charcoal-700);
  background: var(--panel);
}

.public-upload-zone input[type="file"]:focus,
.public-upload-zone input[type="file"]:focus-visible {
  border-color: var(--charcoal-900);
  background: var(--panel);
  outline: 3px solid var(--env-yellow);
  outline-offset: 2px;
}

.public-upload-zone input[type="file"]::file-selector-button {
  margin-right: 0.6rem;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.public-upload-cta,
.public-upload-hint {
  position: absolute;
  left: 1rem;
  right: 1rem;
  text-align: center;
  pointer-events: none;
}

.public-upload-cta {
  top: 1rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.public-upload-hint {
  bottom: 0.9rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.public-chip {
  margin: 0.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  font-size: 0.82rem;
}

.public-chip span:first-child {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--ok);
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* The end of the form: one line on what happens next, then the button. */
.public-send {
  margin-top: 1.5rem;
}

.public-send p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

.public-send .btn {
  width: 100%;
  min-height: 54px;
  font-size: 1rem;
  border-radius: var(--radius);
}

/* Thank you, expired, closed. */
.public-message {
  margin-top: 8vh;
  padding: 2.5rem 2rem;
  text-align: center;
}

.public-message h1 {
  margin-bottom: 0.6rem;
}

.public-message p {
  max-width: 48ch;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1rem;
}

.public-foot {
  width: min(100%, 752px);
  margin: 0 auto;
  padding: 0 16px 36px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.public-foot p {
  margin: 0;
}

/* What shows after an answer. Without :has() nothing is hidden. A question with a
   server error shows all of its fields, whatever is ticked. */
@supports selector(:has(*)) {
  .public-question:not(.has-error):not(:has(input[value="Yes"]:checked)) .reveal-yes,
  .public-question:not(.has-error):not(:has(input[value="No"]:checked, input[value="N/A"]:checked)) .reveal-other {
    display: none;
  }

  /* A question asked only after a Yes to the one before it (question 10 after 9). */
  .public-question:not(.public-question-after-no):not(:has(input[value="Yes"]:checked)) + .public-question-after-yes:not(.has-error) {
    display: none;
  }

  /* A follow-up asked only after a No (9a after 9, FB-0078), and the Yes question that
     comes after the follow-up (10, still hidden until 9 is Yes). */
  .public-question:not(:has(input[value="No"]:checked)) + .public-question-after-no:not(.has-error),
  .public-question:not(:has(input[value="Yes"]:checked)) + .public-question-after-no + .public-question-after-yes:not(.has-error) {
    display: none;
  }
}

@media (max-width: 600px) {
  .public-main {
    padding-top: 16px;
  }

  .public-card {
    padding: 1.2rem 1.1rem;
  }

  .public-question.has-error {
    margin-left: -1.1rem;
    padding-left: calc(1.1rem - 3px);
  }

  .public-segments {
    width: 100%;
  }

  .public-index ol {
    flex-direction: column;
  }

  .public-index a {
    width: 100%;
  }

  .public-message {
    padding: 2rem 1.25rem;
  }
}

/* The required asterisk stays on its label's line on a phone (Email *, Phone *). */
.public-form .field-label { flex-wrap: nowrap; }

/* The ABN check HSEQ answer before Approve (FB-0078, 12 November 2026). */
.abr-check {
  min-width: 0;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line, #d9d9d9);
  border-radius: 8px;
}

.abr-check legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

.abr-check-list {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
}

