/* Queue 27 (HBU_DESIGN_FORMS): one field, button and panel scale for the sign-in, request-access, upload, Help and Ask screens.
   Every rule sits under html[data-forms], which the server sets only while the switch is on, so off is today's page.
   Values are DESIGN.md section 3 (names in the comments). Not touched: banner.css, the agreement box (.ua-agree). */
html[data-forms] {
  --f-ink: #0D2318;            /* --ink */
  --f-ink-2: #2E6646;          /* --ink-secondary: the focus ring and hover border */
  --f-dim: #3C634C;            /* --ink-dim: labels, captions, field edges (4.5:1 on all three grounds, 3:1 as a control edge) */
  --f-hover: #1A3D2A;          /* --ink-hover */
  --f-ground: #D7D3CB;         /* --bg: text on a filled button */
  --f-paper: #FFFFFF;          /* --paper: fields only */
  --f-surface: #EDECEA;        /* --bg-surface: panels */
  --f-rule: rgba(13, 35, 24, 0.12);   /* --rule */
  --f-hit: 44px; --f-field: 48px;     /* --fold-h: a control is 44px tall, a field 48px */
  --f-pill: 100px; --f-card: 14px; --f-soft: 8px;   /* --radius-pill, --radius, --radius-md */
  --f-s2: 8px; --f-s3: 12px; --f-s4: 18px; --f-pad: 24px;   /* --s2 --s3 --s4 --card-pad */
  --f-t-small: 11.5px; --f-t-body: 13px; --f-t-lead: 15px; --f-t-input: 16px;   /* --t-small --t-body --t-lead --t-input */
  --f-dur: 150ms;              /* --dur-hover */
}

/* ---- fields: one height, one edge, one focus ring ---- */
html[data-forms] :is(.ua-input, textarea.ask, input.ask, select.upload-type) {
  box-sizing: border-box; width: 100%; min-height: var(--f-field); padding: 0 var(--f-s4); border: 1.5px solid var(--f-dim); border-radius: var(--f-pill);
  background: var(--f-paper); color: var(--f-ink); font: 400 var(--f-t-input)/1.4 var(--mono, 'JetBrains Mono', ui-monospace, monospace); box-shadow: none;
  transition: border-color var(--f-dur) ease-out;
}
html[data-forms] textarea.ask, html[data-forms] textarea.ua-input { min-height: 120px; padding: var(--f-s3) var(--f-s4); border-radius: var(--f-soft); resize: vertical; }
html[data-forms] :is(.ua-input, textarea.ask, input.ask, select.upload-type):hover { border-color: var(--f-ink-2); }
html[data-forms] :is(.ua-input, textarea.ask, input.ask, select.upload-type)::placeholder { color: var(--f-dim); opacity: 1; }
html[data-forms] :is(.ua-input, textarea.ask, input.ask, select.upload-type):focus { border-color: var(--f-ink); outline: 2px solid var(--f-ink-2); outline-offset: 2px; }
html[data-forms] .ua-input:disabled { background: var(--f-surface); color: var(--f-dim); border-color: var(--f-rule); }
html[data-forms] :is(.ua-label, .helpbox label.detail, .upload-label) { color: var(--f-dim); font-size: var(--f-t-small); font-weight: 500; line-height: 1.5; }
html[data-forms] .ua-field { gap: var(--f-s2); }
html[data-forms] .ua-form { gap: var(--f-s4); }
html[data-forms] .helpbox .grp { gap: var(--f-s3); }

/* ---- buttons: filled is the one main action, outline the rest, a link the quiet one ---- */
html[data-forms] :is(.ua-btn, .upload-step .btn, #drawer .btn, .helpbox .hsend) {
  box-sizing: border-box; min-height: var(--f-hit); padding: 0 var(--f-pad); border: 1.5px solid var(--f-ink); border-radius: var(--f-pill);
  background: var(--f-ink); color: var(--f-ground); font: 500 var(--f-t-body)/1.3 var(--mono, 'JetBrains Mono', ui-monospace, monospace); box-shadow: none; transform: none;
  transition: background-color var(--f-dur) ease-out, border-color var(--f-dur) ease-out;
}
html[data-forms] :is(.ua-btn, .upload-step .btn, #drawer .btn, .helpbox .hsend):hover:not(:disabled) { background: var(--f-hover); border-color: var(--f-hover); box-shadow: none; }
html[data-forms] :is(.ua-btn, .upload-step .btn, #drawer .btn, .helpbox .hsend):active:not(:disabled) { background: var(--f-hover); transform: none; }
html[data-forms] :is(.ua-btn, .upload-step .btn, #drawer .btn, .helpbox .hsend):disabled { opacity: .6; }
html[data-forms] :is(#access-panel .ua-body > .ua-btn:nth-of-type(n+2), .upload-pick, .upload-shot, .upload-skip) { background: transparent; color: var(--f-ink); }
html[data-forms] :is(#access-panel .ua-body > .ua-btn:nth-of-type(n+2), .upload-pick, .upload-shot, .upload-skip):hover:not(:disabled) { background: var(--f-rule); border-color: var(--f-ink-2); color: var(--f-ink); }
html[data-forms] :is(.ua-btn, .upload-step button, #drawer button, .helpbox button, .helpbox input, .ua-layer button):focus-visible { outline: 2px solid var(--f-ink-2); outline-offset: 2px; }
html[data-forms] .helpbox .hsend { justify-content: center; text-decoration: none; align-self: flex-start; }
html[data-forms] .helpbox .hsend[hidden] { display: none; }

/* Help kinds: a row of equal chips that wraps instead of squeezing a name onto two lines */
html[data-forms] .helpbox .hopts { flex-wrap: wrap; gap: var(--f-s2); }
html[data-forms] .helpbox .hopt { padding: 0 var(--f-s4); border: 1.5px solid var(--f-dim); border-radius: var(--f-pill); text-decoration: none; font-size: var(--f-t-body); white-space: nowrap; }
html[data-forms] .helpbox .hopt[aria-checked="true"] { background: var(--f-ink); border-color: var(--f-ink); color: var(--f-ground); font-weight: 500; }

/* ---- panels ---- */
html[data-forms] :is(#access-panel, .ua-layer .ua-panel, .helpbox) { background: var(--f-surface); background-image: none; border: 1px solid var(--f-rule); border-radius: var(--f-card); padding: var(--f-pad); box-shadow: none; }
html[data-forms] #access-panel { opacity: 1; }      /* ua.css fades .ua-panel in only inside .ua-layer; this panel stands in the page and was never shown */
html[data-forms] #access-panel .ua-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--f-s3); }
html[data-forms] #access-panel .ua-body > .ua-line { flex: 0 0 100%; }
html[data-forms] #access-panel .ua-body > .ua-line:empty { display: none; }
html[data-forms] #access-panel form { flex: 0 0 100%; }
html[data-forms] .helpbox { width: min(360px, calc(100vw - 2 * var(--f-s4))); }
html[data-forms] .helpbox .dhead { align-items: center; }

/* ---- upload step ---- */
html[data-forms] .upload-rows { gap: var(--f-s3); width: 100%; }
html[data-forms] .upload-row { display: flex; flex-direction: column; gap: var(--f-s2); padding: var(--f-s3) var(--f-s4); background: var(--f-surface); border: 1px solid var(--f-rule); border-radius: var(--f-soft); }
html[data-forms] .upload-intro { font-size: var(--f-t-lead); line-height: 1.5; max-width: 60ch; }
html[data-forms] :is(.upload-allowed, .upload-note, .upload-foot, .upload-stat) { font-size: var(--f-t-body); line-height: 1.5; color: var(--f-dim); max-width: 60ch; }
html[data-forms] .upload-name { font-size: var(--f-t-body); font-weight: 500; overflow-wrap: anywhere; }
html[data-forms] .upload-err { color: var(--red, #A92C2C); font-size: var(--f-t-body); margin: 0; }

@media (max-width: 640px) {
  html[data-forms] { --f-hit: 48px; }      /* the phone's tap size, as ua.css --ua-phone */
  html[data-forms] .upload-step { align-items: stretch; }
  html[data-forms] .helpbox .hsend { align-self: stretch; }
  html[data-forms] :is(.upload-step .btn, #access-panel .ua-body > .ua-btn) { width: 100%; }
  html[data-forms] .ua-layer .ua-panel { border-radius: var(--f-card) var(--f-card) 0 0; padding: var(--f-pad) var(--f-s4); }
  html[data-forms] #access-panel { padding: var(--f-s4); }
}
