/* form-save-bar.css — the fixed Save / Submit bar on long forms (public/form-save-bar.js), from 600 wide only.
   It is hidden while a field is being typed in (the script), fixed to the bottom of the screen otherwise, and as wide
   as the form's column (the script sets left and width) */

/* ── The copy of the real button (Daily Ticket, Get PO) ── */
.fsb {
  position: fixed; left: 0; bottom: 0;
  box-sizing: border-box; width: 100%; max-width: 100vw;
  z-index: 90;   /* under the page header, menus, sheets and dialogs */
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 10px rgba(0,0,0,.10);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform .18s ease, visibility 0s linear .18s;
}
.fsb.is-shown { transform: none; visibility: visible; transition: transform .18s ease; }
.fsb-btn {
  flex: 0 1 480px; min-width: 0;
  min-height: 44px;
  padding: 8px 18px;
  border: none; border-radius: 8px;
  background: #F47920; color: #fff;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
  cursor: pointer;
  white-space: normal; overflow-wrap: anywhere;
}
.fsb-btn:hover { background: #d4680f; }
.fsb-btn:focus-visible { outline: 3px solid rgba(244,121,32,.45); outline-offset: 2px; }
.fsb-btn:disabled { opacity: .55; cursor: not-allowed; }
.fsb-status { flex: 0 1 auto; min-width: 0; font-size: 12px; font-weight: 700; color: #6b7280; line-height: 1.25; }
.fsb-status.is-ok { color: #166534; } .fsb-status.is-error { color: #b91c1c; }
.fsb-status[hidden] { display: none; }
@media print { .fsb { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .fsb, .fsb.is-shown { transition: none; } }

/* ── Bars that are already part of the page (safety forms, Get PO items): from 600 wide only, where the script takes
   them over (.fsb-kept); under 600 they are exactly as before ── */
body .fp-submit-bar.fsb-kept, body .sf-submit-bar.fsb-kept, body .it-bar.fsb-kept {
  padding-top: 6px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}
body .fp-submit-bar.fsb-kept .btn, body .sf-submit-bar.fsb-kept .btn { min-height: 44px; justify-content: center; }
/* ...and hidden while a field is being typed in (the keyboard is up) */
body .fsb-kept.fsb-typing { visibility: hidden; }
/* A bug fix: on the narrowest phones the safety forms' Submit button was cut off at the right edge (ERP and near-miss
   at 280, truck inspection at 280 and 320). Under 300 (truck inspection: under 360, in its own page) the bar's row may
   wrap: only a row that does not fit goes onto a second line. */
@media (max-width: 299.98px) {
  body .fp-submit-bar, body .sf-submit-bar { flex-wrap: wrap; row-gap: 6px; }
}
