/* ============================================================
   CrossCheck4 — Vuexy Light Mode Manual Upload Design System
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --mu-primary:       #7367f0;
  --mu-primary-light: #eae8fd;
  --mu-primary-dark:  #5e50ee;
  --mu-success:       #28c76f;
  --mu-success-light: #dff7ec;
  --mu-warn:          #ff9f43;
  --mu-warn-light:    #fff3e6;
  --mu-danger:        #ea5455;
  --mu-danger-light:  #fde8e8;
  --mu-info:          #00cfe8;
  --mu-info-light:    #d9f6fb;
  --mu-bg:            #f5f5f9;
  --mu-card:          #ffffff;
  --mu-border:        rgba(46, 38, 61, 0.12);
  --mu-border-light:  rgba(46, 38, 61, 0.06);
  --mu-text:          #2e2636;
  --mu-text-muted:    #6d6777;
  --mu-shadow-sm:     0 2px 6px rgba(46, 38, 61, 0.08);
  --mu-shadow:        0 4px 18px 0 rgba(46, 38, 61, 0.1);
  --mu-radius:        8px;
  --mu-radius-sm:     6px;
}

/* ── Body ── */
body {
  background-color: var(--mu-bg);
  font-family: "Public Sans", sans-serif;
  color: var(--mu-text);
}

/* ── Wizard Wrapper ── */
.mu-wizard-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.mu-page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.mu-form-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ── Summary Header ── */
.mu-summary {
  background: var(--mu-card);
  border-radius: var(--mu-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--mu-shadow-sm);
  border: 1px solid var(--mu-border-light);
  margin-bottom: 1rem;
}

.mu-summary h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--mu-text);
}

.mu-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--mu-border);
}

.mu-progress .progress-bar {
  background: var(--mu-primary);
  border-radius: 99px;
  height: 100%;
  display: block;
}

/* ── Horizontal Stepper ── */
.mu-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--mu-card);
  border-radius: var(--mu-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--mu-shadow-sm);
  border: 1px solid var(--mu-border-light);
  margin-bottom: 1.25rem;
  position: relative;
  gap: 0;
}

.mu-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  text-align: center;
  min-width: 0;
}

/* Connector line between steps */
.mu-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--mu-border);
  z-index: 0;
  transform: translateX(0);
}

.mu-step.is-complete:not(:last-child)::after {
  background: var(--mu-success);
}

.mu-step.is-active:not(:last-child)::after {
  background: var(--mu-primary-light);
}

.mu-step-top {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  border: 2px solid var(--mu-border);
  background: var(--mu-bg);
  color: var(--mu-text-muted);
  transition: all 0.2s;
}

.mu-step.is-active .mu-step-top {
  background: var(--mu-primary);
  border-color: var(--mu-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--mu-primary-light);
}

.mu-step.is-complete .mu-step-top {
  background: var(--mu-success);
  border-color: var(--mu-success);
  color: #fff;
}

.mu-step.is-complete .mu-step-index {
  display: none;
}

.mu-step.is-complete .mu-step-check {
  display: block !important;
}

.mu-step-check {
  display: none;
}

.mu-step-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mu-text-muted);
  line-height: 1.3;
  padding: 0 4px;
}

.mu-step.is-active .mu-step-title {
  color: var(--mu-primary);
}

.mu-step.is-complete .mu-step-title {
  color: var(--mu-success);
}

.mu-step-subtitle {
  font-size: 0.7rem;
  color: var(--mu-text-muted);
  opacity: 0.7;
  padding: 0 4px;
}

/* Mini stepper (OTR/UF pages show condensed) */
.mu-mini-stepper .mu-step-subtitle {
  display: none;
}

.mu-mini-stepper .mu-step-top {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.mu-mini-stepper .mu-step-title {
  font-size: 0.7rem;
}

/* ── Cards / Panels ── */
.mu-panel,
.card.mu-panel {
  background: var(--mu-card);
  border: 1px solid var(--mu-border-light);
  border-radius: var(--mu-radius);
  box-shadow: var(--mu-shadow-sm);
}

.mu-panel .card-header {
  background: transparent;
  border-bottom: 1px solid var(--mu-border-light);
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
}

.mu-panel .card-body {
  padding: 1.25rem;
}

/* ── Section Rule ── */
.mu-section-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--mu-text-muted);
  margin-bottom: 1rem;
}

.mu-section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--mu-border-light);
}

/* ── Upload Zones ── */
.mu-upload-zone {
  border: 2px dashed var(--mu-border);
  border-radius: var(--mu-radius);
  padding: 1.75rem 1rem;
  text-align: center;
  background: var(--mu-bg);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.mu-upload-zone:hover {
  border-color: var(--mu-primary);
  background: var(--mu-primary-light);
}

.mu-upload-zone.uploaded {
  border-color: var(--mu-success);
  border-style: solid;
  background: var(--mu-success-light);
}

.mu-upload-zone .mu-upload-icon {
  font-size: 2rem;
  color: var(--mu-text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.mu-upload-zone.uploaded .mu-upload-icon {
  color: var(--mu-success);
}

/* ── Status Badges ── */
.mu-status-badge {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.25em 0.65em;
  border-radius: 99px;
  letter-spacing: 0.01em;
}

.mu-status-complete {
  background: var(--mu-success-light);
  color: #1a7a4c;
}

.mu-status-progress {
  background: var(--mu-primary-light);
  color: var(--mu-primary-dark);
}

.mu-status-pending {
  background: #f0eff5;
  color: var(--mu-text-muted);
}

.mu-status-attention {
  background: var(--mu-warn-light);
  color: #9a5c00;
}

/* ── Checklist (Step 5) ── */
.mu-checklist {
  border-radius: var(--mu-radius-sm);
  overflow: hidden;
  border: 1px solid var(--mu-border-light);
}

.mu-checklist .list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  border: none;
  border-bottom: 1px solid var(--mu-border-light);
  background: var(--mu-card);
  color: var(--mu-text);
}

.mu-checklist .list-group-item:last-child {
  border-bottom: none;
}

/* ── Field Rows (Step 2 Extraction Review) ── */
.mu-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--mu-border-light);
}

.mu-field-row:last-child {
  border-bottom: none;
}

.mu-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mu-text-muted);
  margin-bottom: 0.15rem;
}

.mu-field-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mu-text);
}

/* ── Prefill badge ── */
.mu-prefill-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15em 0.5em;
  border-radius: 99px;
  background: var(--mu-primary-light);
  color: var(--mu-primary-dark);
  letter-spacing: 0.04em;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ── Soft note ── */
.mu-soft-note {
  font-size: 0.82rem;
  color: var(--mu-text-muted);
}

/* ── Field help text ── */
.mu-help {
  font-size: 0.75rem;
  color: var(--mu-text-muted);
  margin-top: 0.25rem;
}

/* ── Required field asterisk ── */
.mu-req::after,
.mu-required::after {
  content: " *";
  color: var(--mu-danger);
  font-weight: 700;
}

/* ── CTA Button ── */
.btn-cta,
.btn.btn-cta {
  background: var(--mu-primary);
  color: #fff;
  border: none;
  border-radius: var(--mu-radius-sm);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  transition: background 0.15s, box-shadow 0.15s;
}

.btn-cta:hover,
.btn-cta:focus {
  background: var(--mu-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.4);
}

/* ── Validation Score Hero ── */
.mu-score-hero {
  background: var(--mu-card);
  border-radius: var(--mu-radius);
  border: 1px solid var(--mu-border-light);
  padding: 1.5rem 2rem;
  box-shadow: var(--mu-shadow-sm);
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.mu-score-hero .mu-score-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--mu-text);
}

.mu-score-hero.score-pass  { border-left: 4px solid var(--mu-success); }
.mu-score-hero.score-warn  { border-left: 4px solid var(--mu-warn); }
.mu-score-hero.score-fail  { border-left: 4px solid var(--mu-danger); }

.mu-score-hero.score-pass .mu-score-number  { color: var(--mu-success); }
.mu-score-hero.score-warn .mu-score-number  { color: var(--mu-warn); }
.mu-score-hero.score-fail .mu-score-number  { color: var(--mu-danger); }

/* ── Receipt Card (SubmissionSuccess) ── */
.mu-receipt-card {
  background: var(--mu-card);
  border-radius: var(--mu-radius);
  border: 1px solid var(--mu-border-light);
  box-shadow: var(--mu-shadow);
  overflow: hidden;
}

.mu-receipt-card .mu-receipt-header {
  background: var(--mu-success);
  color: #fff;
  padding: 1.25rem 1.5rem;
}

.mu-receipt-ref {
  display: inline-block;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--mu-primary-light);
  color: var(--mu-primary-dark);
  border-radius: var(--mu-radius-sm);
  padding: 0.3em 0.9em;
  letter-spacing: 0.06em;
}

.mu-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.mu-info-item .mu-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mu-text-muted);
  margin-bottom: 0.2rem;
}

.mu-info-item .mu-info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mu-text);
}

/* ── Form Section Cards ── */
.mu-form-card {
  background: var(--mu-card);
  border-radius: var(--mu-radius);
  border: 1px solid var(--mu-border-light);
  box-shadow: var(--mu-shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.mu-form-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  background: #fafafa;
  border-bottom: 1px solid var(--mu-border-light);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mu-text);
}

.mu-form-card-body {
  padding: 1.25rem;
}

/* ── Action Row ── */
.mu-action-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mu-border-light);
  margin-top: 0.5rem;
}

.mu-action-row.split {
  justify-content: space-between;
}

/* ── Alert overrides for wizard ── */
.mu-alert {
  border-radius: var(--mu-radius-sm);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
}

/* ── Validation Result Table ── */
.validation-results-table th,
.validation-results-table td {
  font-size: 0.82rem;
  vertical-align: middle;
}

/* ── Validation Score Progress Bar ── */
.mu-score-progress {
  height: 10px;
  border-radius: 99px;
  margin-bottom: 0.35rem;
}

/* ── Responsive tweaks ── */
@media (max-width: 576px) {
  .mu-stepper {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .mu-step {
    min-width: 80px;
  }

  .mu-score-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Fix for html2canvas background-image parsing bug with Bootstrap .form-select */
#formContainer .form-select {
  background-image: var(--bs-form-select-bg-img);
}
