/* The Upload screen (D2 Task 22), from Upload.dc.html with the work colours approved on 06/11. Every colour is a token: the chips use the
   status tokens (Reading and Sending in sky, Done in ready, Needs a person in missing, Not a statement and Not accepted in declined).
   The drop zone, the file meter, the buttons, the fields and the card are components.css. Listed in STYLESHEETS (src/web/routes-pages.js), after components.css and shell.css. */

.upRoot { padding: 28px 32px 64px; }
.upWrap { display: flex; flex-direction: column; gap: 18px; max-width: 1080px; margin: 0 auto; }
.upPage { font: 600 26px var(--font-head); letter-spacing: -0.015em; }

.upCard { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.upCard.upLater { gap: 0; padding: 8px 0 6px; animation-delay: .08s; }
.upCard:hover, .upCard.upLater:hover { box-shadow: var(--sh-card); }

/* ---- The form ---- */
.upFields { display: flex; flex-wrap: wrap; gap: 14px; }
.upField { display: flex; flex: 1 1 220px; flex-direction: column; gap: 6px; min-width: 0; }
.upFieldWide { flex: 2 1 280px; }
.upLabel { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.upOpt { color: var(--ink-3); font-weight: 400; }
.upFixed { flex: 1 1 100%; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }

/* ---- The drop zone: .drop and .dropOn are components.css ---- */
.upDropIcon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(180deg, var(--brand-soft), var(--brand-tint)); color: var(--brand); box-shadow: var(--sh-inset-hi); }
.upDropTitle { font: 600 17px var(--font-head); }
.upDropHint { color: var(--ink-3); font-size: 13.5px; }
.pick { position: relative; margin-top: 4px; padding: 0 18px; }
.upPickInput { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.upSteps { display: flex; flex-wrap: wrap; gap: 14px; }
.upStep { display: flex; flex: 1 1 220px; align-items: flex-start; gap: 10px; min-width: 0; }
.upStepN { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--r-pill); background: var(--brand-tint); color: var(--brand); font: 600 12.5px var(--font-head); }
.upStepT { font-size: 13.5px; font-weight: 600; }
.upStepD { color: var(--ink-3); font-size: 13px; }

/* ---- In progress ---- */
.upH2 { padding: 14px 22px 6px; font: 600 17px var(--font-head); letter-spacing: normal; }
.upEmpty { padding: 6px 22px 18px; color: var(--ink-3); font-size: 13.5px; }
.upBatches { display: flex; flex-direction: column; }
.upBatch { display: flex; flex-direction: column; padding: 4px 0 8px; }
.upHead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 22px; }
.upInfo { flex: 1 1 260px; min-width: 0; }
.upTitle { font-weight: 600; overflow-wrap: anywhere; }
.upMeta { color: var(--ink-3); font-size: 13px; }
.upSide { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upGo { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.upError { max-width: 420px; color: var(--status-declined-ink); font-size: 13px; }
.upSend { display: flex; align-items: center; gap: 12px; padding: 0 22px 8px; }
.upSend .meterTrack { flex: 1 1 auto; }
.upSendText { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.upRow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 22px; border-top: 1px solid var(--line-soft); transition: background .15s; }
.upRow:hover { background: var(--surface-2); }
.upRow.upIn { padding-left: 50px; }
.upRowIcon { display: inline-flex; flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.upRowMain { display: flex; flex: 1 1 240px; flex-direction: column; gap: 5px; min-width: 0; }
.upRowName { overflow: hidden; font-size: 13.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.upRowDetail { flex: 1 1 220px; min-width: 0; color: var(--ink-2); font-size: 13px; }

.upChip { padding: 3px 10px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--info-ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.upChip.st-sending, .upChip.st-reading { background: var(--status-sky-bg); color: var(--status-sky-ink); }
.upChip.st-done { background: var(--status-ready-bg); color: var(--status-ready-ink); }
.upChip.st-needs { background: var(--status-missing-bg); color: var(--status-missing-ink); }
.upChip.st-rejected, .upChip.st-refused, .upChip.st-unsent { background: var(--status-declined-bg); color: var(--status-declined-ink); }

/* Reading has no page count to show, so its meter runs without an end. */
.upRow .meterTrack .meter { background: var(--status-sky-ink); }
.meterTrack.indet .meter { width: 40%; animation: upSlide 1.3s ease-in-out infinite; }
@keyframes upSlide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

@media (max-width: 640px) {
  .upRoot { padding: 18px 16px 48px; }
  .upCard { padding: 16px; }
  .upCard.upLater { padding: 8px 0 6px; }
  .upH2, .upHead, .upSend, .upRow, .upEmpty { padding-left: 16px; padding-right: 16px; }
  .upRow.upIn { padding-left: 34px; }
}
