/* ============================================================================
   upload.css — "Send us your files".
   ============================================================================

   Reads the theme's own `--tsp-*` variables with a literal fallback, the same
   seam tokens.css and preflight.css use. Nothing here hard-codes a brand color,
   so the approved comp lands by changing the theme and not this file.

   The page is a form, so the design is deliberately quiet. Two things are allowed
   to be loud, because they are the two things a customer needs to see without
   reading: the numbered steps, which say the details come BEFORE the files, and
   the per-file progress, which says the page has not frozen.
   ========================================================================= */

.up {
  --up-ink:    var(--tsp-plum, #412939);
  --up-muted:  var(--tsp-plum-muted, #6b6660);
  --up-line:   var(--tsp-sky, #dfe3e7);
  --up-well:   var(--tsp-surface-2, #eef2f5);
  --up-white:  var(--tsp-white, #fff);
  --up-cream:  var(--tsp-cream, #faf9f5);
  --up-ok:     var(--tsp-success, #2f7a3f);
  --up-bad:    var(--tsp-error, #a32020);

  max-width: 760px;
  color: var(--up-ink);
}

.up-card {
  background: var(--up-white);
  border: 1px solid var(--up-line);
  border-radius: var(--tsp-radius-lg, 10px);
  padding: 24px;
}

/* --- steps ---------------------------------------------------------------- */

/* The number is the whole device. It encodes real sequence — details are checked
   before any byte is accepted — so it is information rather than ornament. */
.up-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0 0 18px;
}
.up-step-2 {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--up-line);
}
.up-step-n {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--up-ink);
  color: var(--up-white);
  font-weight: 600;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
}
.up-step h2 {
  margin: 2px 0 2px;
  font-size: 19px;
  line-height: 1.2;
}
.up-muted { color: var(--up-muted); font-size: 14px; margin: 0; }

/* --- fields -------------------------------------------------------------- */

.up-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.up-field { margin: 0; }
.up-field-wide { grid-column: 1 / -1; }

.up-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
}
.up-field abbr {
  color: var(--up-bad);
  text-decoration: none;
  margin-left: 2px;
}
.up-field input,
.up-field select,
.up-field textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--tsp-surface-3, #c3c9d0);
  border-radius: var(--tsp-radius, 6px);
  background: var(--up-white);
  color: inherit;
  font: inherit;
  font-size: 15px;   /* 16px-ish keeps iOS from zooming the viewport on focus */
}
.up-field textarea { resize: vertical; }
.up-field input:focus-visible,
.up-field select:focus-visible,
.up-field textarea:focus-visible,
.up-drop:focus-visible {
  outline: 2px solid var(--tsp-steel, #4c748d);
  outline-offset: 1px;
}
/* Only shown after a failed submit — see markField() in upload.js. An input that
   turns red while you are still typing in it is nagging, not helping. */
.up-field.up-bad input,
.up-field.up-bad select,
.up-field.up-bad textarea { border-color: var(--up-bad); }

/* --- drop zone ----------------------------------------------------------- */

.up-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px;
  border: 2px dashed var(--tsp-surface-3, #c3c9d0);
  border-radius: var(--tsp-radius-lg, 10px);
  background: var(--up-cream);
  text-align: center;
  cursor: pointer;
}
.up-drop strong { font-size: 16px; }
.up-drop span { color: var(--up-muted); font-size: 14px; }
.up-drop:hover,
.up-drop.up-over {
  border-color: var(--up-ink);
  background: var(--up-white);
}
/* While files are moving the zone stops inviting more. */
.up-drop[aria-disabled="true"] {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

/* --- chosen files -------------------------------------------------------- */

.up-list { list-style: none; margin: 14px 0 0; padding: 0; }
.up-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--up-line);
  font-size: 14px;
}
.up-list li:first-child { border-top: 0; }
.up-name { overflow-wrap: anywhere; font-weight: 500; }
.up-size { color: var(--up-muted); white-space: nowrap; }
.up-drop-file {
  grid-column: 2;
  justify-self: end;
  padding: 0;
  border: 0;
  background: none;
  color: var(--up-muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.up-drop-file:hover { color: var(--up-bad); }

/* The bar carries BYTES. The phase word beside it carries what is happening, and
   the two are separate because "100% and still working" is the state the live
   form cannot express — assembly happens inside the last chunk's request. */
.up-bar {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--up-well);
  overflow: hidden;
}
.up-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--tsp-steel, #4c748d);
  transition: width .2s linear;
}
.up-list li.up-ok .up-bar i   { background: var(--up-ok); width: 100%; }
.up-list li.up-err .up-bar i  { background: var(--up-bad); width: 100%; }
.up-phase { grid-column: 1 / -1; color: var(--up-muted); font-size: 12.5px; }
.up-list li.up-err .up-phase  { color: var(--up-bad); }
.up-list li.up-ok  .up-phase  { color: var(--up-ok); }

.up-accept { margin-top: 10px; font-size: 12.5px; }

/* --- buttons ------------------------------------------------------------- */

/* Same pill as the artwork checker's controls, for the same reason: these are the
   two customer-facing tools on the site and they should not look like two
   different products. */
.up-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 15px 28px;
  border: 0;
  border-radius: var(--tsp-radius-pill, 999px);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: var(--tsp-track-wide, 0.18em);
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
}
.up-btn-primary {
  background: var(--tsp-plum, #412939);
  color: var(--tsp-white, #fff);
}
.up-btn-primary:hover:not(:disabled) { background: var(--tsp-plum-dark, #2e1b28); }
/* Disabled must look unavailable rather than merely faded — a 45%-opacity pill
   still reads as something you can press. */
.up-btn:disabled {
  background: var(--up-well);
  color: var(--tsp-surface-3, #c3c9d0);
  cursor: default;
}

/* --- status -------------------------------------------------------------- */

.up-status {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}
.up-status.up-err-text { color: var(--up-bad); }
.up-reassure { margin-top: 14px; text-align: center; font-size: 13px; }

/* --- success ------------------------------------------------------------- */

.up-done h2 { margin-top: 0; }
.up-ref { font-size: 15px; }
.up-ref strong {
  font-size: 22px;
  letter-spacing: .04em;
}

@media (max-width: 640px) {
  .up-grid { grid-template-columns: 1fr; }
  .up-card { padding: 18px; }
}
