/* Live sign form: only what the new fields need on top of the .sign rules in styles.css.
   Colours follow currentColor so it reads on the white closing section and on a dark one. */

#sign-form-live { display: block; max-width: 44rem; }
#sign-form-live [hidden], .sign-list[hidden] { display: none !important; }
#sign-form-live label:nth-of-type(n) { grid-column: auto; }

/* the count line */
.sign-count { font-size: 1.0625rem; font-style: italic; margin: 0 0 1.25rem; }
.sign-count b { font-family: var(--head, inherit); font-style: normal; font-weight: 500; font-size: 1.6em; line-height: 1; margin-right: .15em; color: var(--rust, #a24a2c); }

/* the two field rows */
.sign-row { display: grid; gap: 1rem 1.5rem; align-items: end; margin: 0 0 1.25rem; }
.sign-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sign-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#sign-form-live input:not([type="checkbox"]), #sign-form-live select { min-height: 2.75rem; }
#sign-form-live select { cursor: pointer; padding-right: 1.4rem; background: linear-gradient(45deg, transparent 50%, currentColor 50%) right .55rem center / .38rem .38rem no-repeat, linear-gradient(-45deg, transparent 50%, currentColor 50%) right .17rem center / .38rem .38rem no-repeat; }
#sign-form-live select:invalid { color: inherit; opacity: .8; }

/* checkboxes: real inputs, large tap targets */
.sign-checks { display: grid; gap: .35rem; margin: 1.75rem 0 1.75rem; }
.sign-check { display: flex; align-items: flex-start; gap: .8rem; min-height: 44px; padding: .55rem 0; cursor: pointer; line-height: 1.4; }
#sign-form-live .sign-check input { -webkit-appearance: auto; appearance: auto; flex: 0 0 auto; width: 1.3rem; height: 1.3rem; min-height: 0; margin: .1rem 0 0; padding: 0; border: 0; accent-color: var(--rust, #a24a2c); cursor: pointer; }
#sign-form-live .sign-check span { display: inline; font-size: 1.0625rem; font-style: normal; opacity: 1; margin: 0; }
.sign-check a { color: inherit; text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }

/* focus that you can see on white and on navy */
#sign-form-live input:focus-visible, #sign-form-live select:focus-visible, #sign-form-live .btn:focus-visible, .sign-check a:focus-visible {
  outline: 2px solid var(--rust, #a24a2c); outline-offset: 3px;
}
#sign-form-live input:not([type="checkbox"]):focus, #sign-form-live select:focus { border-bottom-color: var(--rust, #a24a2c); }

/* error state */
#sign-form-live.was-checked input:invalid:not([type="checkbox"]), #sign-form-live.was-checked select:invalid { border-bottom-color: var(--rust, #a24a2c); border-bottom-width: 2px; }
#sign-form-live.was-checked .sign-check input:invalid { outline: 2px solid var(--rust, #a24a2c); outline-offset: 2px; }
.sign-error { font-size: 1rem; font-style: italic; color: var(--rust, #a24a2c); border-left: 3px solid currentColor; padding: .2rem 0 .2rem .8rem; margin: 1rem 0 0; }
#sign-form-live .btn[disabled] { cursor: progress; opacity: .7; }
#sign-form-live .sign-done:focus { outline: none; }

/* the honeypot: off-screen, not display:none */
.sign-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* the signatories list, in wrapping columns */
.sign-list { margin: clamp(40px, 6vh, 64px) 0 0; max-width: 44rem; }
.sign-list-h { font-family: var(--head, inherit); font-size: 1.25rem; font-weight: 400; font-style: italic; margin: 0 0 1rem; }
.sign-names { list-style: none; padding: 0; margin: 0; columns: 14rem auto; column-gap: 1.75rem; font-size: 1rem; line-height: 1.35; max-height: 32rem; overflow-y: auto; }
.sign-names li { break-inside: avoid; padding: .2rem 0 .45rem; }
.sign-names small { display: block; font-size: .875rem; font-style: italic; opacity: .65; }

@media (min-width: 901px) and (max-width: 1150px) {
  /* the form column is narrow here: first and last name share a row, email gets its own */
  .sign-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #sign-form-live .sign-row-3 label:last-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .sign-row-3, .sign-row-2 { grid-template-columns: 1fr; }
  #sign-form-live .btn { width: 100%; justify-content: center; }
}
body.sign-in-view .sign-sticky { display: none; }
