/* =========================================================
   document-upload.css  —  NEW FILE (Phase 4)
   Path: assets/css/document-upload.css

   Styling scoped to public/document-upload.html only. Reuses
   existing design tokens from style.css/auth.css (both loaded
   before this file) — no existing rule anywhere else is changed.
   Badge classes are redefined locally (not imported from
   visa-application.css) so this module has no dependency on
   another module's stylesheet being present.
   ========================================================= */

/* badge-warning/badge-success already exist globally in style.css.
   Only the two variants below are new, needed for "Rejected"/"Replaced". */
.badge-error { background: var(--color-error-tint); color: var(--color-error); padding: 4px 10px; border-radius: 999px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); }
.badge-muted { background: var(--color-bg-section); color: var(--color-body); padding: 4px 10px; border-radius: 999px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); }

/* ---------- Application picker ---------- */
.du-app-empty { text-align: center; padding: var(--space-8) var(--space-5); background: var(--color-bg-section); border-radius: var(--radius-md); color: var(--color-body); }
.du-app-empty p { margin-bottom: var(--space-4); }

/* ---------- Document slots ---------- */
.du-slot .card-body { padding: var(--space-5); }
.du-slot-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-4); }
.du-slot-header h4 { margin-bottom: 2px; }
.du-slot-hint { font-size: var(--fs-micro); color: var(--color-body); }

.du-existing { margin-bottom: var(--space-4); }
.du-empty-slot { font-size: var(--fs-small); color: var(--color-body); font-style: italic; }

.du-file-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--color-bg-section);
  border-radius: var(--radius-sm); margin-bottom: var(--space-2);
}
.du-file-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.du-file-name { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--color-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.du-file-meta { font-size: var(--fs-micro); color: var(--color-body); }

.du-upload-row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.du-upload-row input[type="file"] { flex: 1; min-width: 180px; font-size: var(--fs-small); }

/* ---------- Drag-and-drop zone ---------- */
.du-dropzone {
  position: relative; border: 2px dashed var(--color-border); border-radius: var(--radius-md);
  background: var(--color-bg-section);
  padding: var(--space-6) var(--space-4); text-align: center; transition: border-color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}
.du-dropzone:hover, .du-dropzone--active { border-color: var(--color-primary); background: var(--color-primary-tint); }
.du-dropzone-input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.du-dropzone-icon {
  width: 40px; height: 40px; border-radius: 50%; background: var(--color-primary-tint); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; pointer-events: none;
}
.du-dropzone-icon .icon { width: 19px; height: 19px; }
.du-dropzone-hint { font-size: var(--fs-small); color: var(--color-body); pointer-events: none; }
.du-dropzone-browse { color: var(--color-primary); font-weight: var(--fw-semibold); text-decoration: underline; }

/* ---------- Selected-file preview card ---------- */
.du-preview-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--color-bg-section);
  border-radius: var(--radius-sm); margin-bottom: var(--space-3);
}
.du-preview-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.du-preview-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--color-accent-tint);
  color: var(--color-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.du-preview-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.du-preview-clear {
  width: 28px; height: 28px; border-radius: 50%; background: none; color: var(--color-body);
  font-size: 18px; line-height: 1; flex-shrink: 0; transition: background var(--transition-fast), color var(--transition-fast);
}
.du-preview-clear:hover { background: var(--color-primary-tint); color: var(--color-primary-hover); }

.du-progress { height: 6px; background: var(--color-bg-section); border-radius: 999px; overflow: hidden; margin-top: var(--space-3); }
.du-progress-bar { height: 100%; background: var(--color-primary); border-radius: 999px; transition: width 0.2s ease; }

@media (max-width: 768px) {
  .du-upload-row { flex-direction: column; align-items: stretch; }
  .du-file-name { max-width: 200px; }
}

/* ---------- "What's Next" banner ---------- */
.du-next-steps { border: 1px solid var(--color-border); background: var(--color-primary-tint); }
.du-next-steps h3 { margin-bottom: var(--space-2); }
.du-next-steps p { margin-bottom: var(--space-4); color: var(--color-body); }

/* ---------- Toast notifications (upload success / error feedback) ---------- */
.du-toast-stack { position: fixed; top: 20px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.du-toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
  background: var(--color-bg-card, #fff); border-left: 4px solid var(--color-success);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,0.12));
  font-size: var(--fs-small); color: var(--color-heading);
  animation: duToastIn 0.2s ease;
}
.du-toast--error { border-left-color: var(--color-error); }
.du-toast .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--color-success); }
.du-toast--error .icon { color: var(--color-error); }
.du-toast.du-toast-out { animation: duToastOut 0.2s ease forwards; }
@keyframes duToastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes duToastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }
