/* The W-9 sheet: a drawing of IRS Form W-9, used by the public forms app (inputs) and
   the staff console (a signed record written in).

   Deliberate deviation from design.md: this is a facsimile of a paper form, so it is
   black on white in both themes and uses its own fixed colors and Arial instead of the
   house tokens and Inter. Everything around the sheet still follows the house system.
   The pale blue entry fill is the one fillable PDF forms use. */

.w9-scroll { overflow-x: auto; margin: 0 -2px; padding: 2px; }

.w9 {
  --w9-ink: #000000;
  --w9-paper: #ffffff;
  --w9-fill: #e4eafb;
  --w9-focus: #1d4ed8;
  --w9-bad: #b42318;
  --w9-aside: #454545;
  position: relative;  /* keeps the screen-reader-only labels inside the scrolling box on a phone */
  min-width: 680px;
  background: var(--w9-paper);
  color: var(--w9-ink);
  border: 1.5px solid var(--w9-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
}
.w9 strong { font-weight: 700; color: inherit; }
.w9 em { font-style: italic; }
.w9 p { margin: 0 0 5px; color: inherit; }

.w9-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.w9-head { display: grid; grid-template-columns: 148px 1fr 150px; border-bottom: 2px solid var(--w9-ink); }
.w9-head-form { padding: 6px 8px; border-right: 1.5px solid var(--w9-ink); }
.w9-form-word { font-size: 11px; }
.w9-form-no { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -0.5px; }
.w9-small { font-size: 10px; line-height: 1.25; }
.w9-head-title { padding: 6px 10px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.w9-title { font-size: 18px; font-weight: 700; line-height: 1.15; }
.w9-head-give { padding: 6px 8px; border-left: 1.5px solid var(--w9-ink); font-size: 13px; font-weight: 700; display: flex; align-items: center; }
.w9-before { padding: 4px 8px; border-bottom: 1px solid var(--w9-ink); font-size: 10.5px; }

/* Lines 1 to 7 */
.w9-body { display: grid; grid-template-columns: 22px 1fr; }
.w9-side { border-right: 1px solid var(--w9-ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.w9-side span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 9px; }
.w9-line { border-bottom: 1px solid var(--w9-ink); padding: 3px 6px 5px; }
.w9-cap { font-size: 10px; }
.w9-no { font-weight: 700; font-size: 11px; margin-right: 3px; }
.w9-note { font-size: 10px; margin-top: 5px; }

.w9-split { display: grid; }
.w9-split-34 { grid-template-columns: 1fr 214px; }
.w9-split-addr { grid-template-columns: 1fr 232px; }
.w9-4, .w9-requester { border-left: 1px solid var(--w9-ink); }
.w9-3b { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }

/* Entries */
.w9 .w9-in {
  display: block; width: 100%; min-height: 25px; margin-top: 2px; padding: 3px 6px;
  border: 0; border-radius: 0; box-shadow: none; outline: none;
  background: var(--w9-fill); color: var(--w9-ink);
  font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.2;
  transition: none;
}
.w9 select.w9-in { background-color: var(--w9-fill) !important; color: var(--w9-ink) !important; appearance: auto; }
.w9 .w9-in:focus { outline: 2px solid var(--w9-focus); outline-offset: 0; background: var(--w9-paper); }
.w9 .w9-bad { outline: 2px solid var(--w9-bad); outline-offset: 0; }
.w9-val { display: block; min-height: 21px; margin-top: 2px; padding: 2px 4px; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }

.w9 .w9-code { display: inline-block; width: 46px; flex: none; text-align: center; text-transform: uppercase; }
.w9-val.w9-code, .w9-val.w9-grow { border-bottom: 1px solid var(--w9-ink); }
.w9 .w9-grow { flex: 1 1 auto; width: auto; min-width: 0; }
.w9-csz { display: flex; gap: 6px; }
.w9 .w9-state { width: 58px; flex: none; text-transform: uppercase; text-align: center; }
.w9 .w9-zip { width: 112px; flex: none; }
.w9-pair { display: flex; gap: 8px; align-items: flex-end; justify-content: space-between; margin-top: 5px; font-size: 10px; }

/* Tick boxes: square, marked with an X, as on the paper form */
.w9-checks { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 5px; }
.w9-checks-row { flex-wrap: nowrap; align-items: center; gap: 8px; }
.w9-check { display: inline-flex; align-items: flex-start; gap: 5px; font-size: 11px; font-weight: 400; margin: 0; cursor: pointer; }
.w9 .w9-check input, .w9 .w9-cross, .w9-box {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; flex: none; margin: 0;
  border: 1.5px solid var(--w9-ink); border-radius: 0;
  background-color: var(--w9-fill);
}
.w9-box { display: inline-block; background-color: var(--w9-paper); }
.w9 .w9-check input:checked, .w9 .w9-cross:checked, .w9-box-on {
  background-color: var(--w9-paper);
  background-image:
    linear-gradient(45deg, transparent 42%, var(--w9-ink) 42%, var(--w9-ink) 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--w9-ink) 42%, var(--w9-ink) 58%, transparent 58%);
}
.w9 .w9-check input:focus-visible, .w9 .w9-cross:focus-visible { outline: 2px solid var(--w9-focus); outline-offset: 1px; }

/* Parts I and II */
.w9-part { display: flex; align-items: stretch; border-bottom: 1px solid var(--w9-ink); }
.w9-part-no { background: var(--w9-ink); color: var(--w9-paper); font-weight: 700; font-size: 13px; padding: 3px 12px; }
.w9-part-title { font-weight: 700; font-size: 13px; padding: 3px 10px; }
.w9-tin { display: grid; grid-template-columns: 1fr 252px; border-bottom: 1px solid var(--w9-ink); }
.w9-tin-text { padding: 6px 8px; font-size: 10.5px; }
.w9-tin-boxes { border-left: 1px solid var(--w9-ink); padding: 6px 8px; }
.w9-tin-label { font-weight: 700; font-size: 11px; }
.w9 .w9-tin-in { border: 1.5px solid var(--w9-ink); font-family: "Courier New", Courier, monospace; font-size: 17px; letter-spacing: 2px; text-align: center; min-height: 28px; }
.w9-val.w9-tin-in { padding-top: 5px; }
.w9-or { font-weight: 700; margin: 5px 0 4px; }
.w9-aside { display: block; margin-top: 6px; font-size: 10.5px; font-style: italic; font-weight: 400; color: var(--w9-aside); }
.w9-aside .w9-in { font-style: normal; }

.w9-cert { padding: 6px 8px 2px; font-size: 10.5px; border-bottom: 1px solid var(--w9-ink); }
.w9-items { margin: 3px 0 7px 20px; padding: 0; }
.w9-items li { margin-bottom: 3px; padding-left: 2px; }
.w9 .w9-cross { vertical-align: -2px; margin-right: 6px; cursor: pointer; }
.w9-cross:checked ~ .w9-item2-text, .w9-struck { text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* Sign Here */
.w9-sign { display: grid; grid-template-columns: 62px 1fr 190px; border-bottom: 1px solid var(--w9-ink); }
.w9-sign-here { font-weight: 700; font-size: 14px; line-height: 1.1; padding: 6px 8px; border-right: 1px solid var(--w9-ink); display: flex; align-items: center; }
.w9-sign-name { padding: 4px 8px 6px; }
.w9-sign-date { padding: 4px 8px 6px; border-left: 1px solid var(--w9-ink); }
.w9 .w9-signature { font-family: "Segoe Script", "Lucida Handwriting", "Brush Script MT", cursive; font-size: 19px; min-height: 34px; }
.w9-esign { padding: 6px 8px; font-size: 10.5px; border-bottom: 1px solid var(--w9-ink); }
.w9-esign .w9-check { font-size: 10.5px; align-items: flex-start; }
.w9-foot { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; font-size: 10px; }

/* Printing: the sheet alone, on one letter page */
@page { size: letter portrait; margin: 0.45in; }
@media print {
  html, body { background: #ffffff !important; }
  .sandbox-banner, .site-header, .site-footer, .intro, .alert, .back, .actions,
  .topbar, .flashes, .footer-note, .w9-no-print, .w9-hide-print { display: none !important; }
  main, .wrap, .content, .shell { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .request-form, .w9-page { border: 0 !important; box-shadow: none !important; background: #ffffff !important; padding: 0 !important; margin: 0 !important; }
  .w9-scroll { overflow: visible; margin: 0; padding: 0; }
  /* Drawn a little smaller than on screen so the whole form fits one letter page. */
  .w9 { min-width: 0; width: 100%; zoom: 0.86; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .w9 .w9-in { background: transparent; }
  .w9 select.w9-in { background-color: transparent !important; appearance: none; }
  .w9 .w9-in::placeholder { color: transparent; }
  .w9 .w9-check input, .w9 .w9-cross { background-color: #ffffff; }
}
