*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  /* Brand */
  --primary:         #2563eb;
  --primary-dark:    #1d4ed8;
  --primary-deeper:  #1e40af;
  --primary-light:   #eff6ff;
  --primary-mid:     #dbeafe;

  /* Semantic */
  --success:         #16a34a;
  --success-light:   #dcfce7;
  --success-mid:     #bbf7d0;
  --error:           #dc2626;
  --error-light:     #fee2e2;
  --error-mid:       #fecaca;
  --warn:            #d97706;
  --warn-light:      #fef3c7;
  --warn-mid:        #fde68a;

  /* Neutrals */
  --text:            #0f172a;
  --text-secondary:  #374151;
  --muted:           #6b7280;
  --muted-light:     #9ca3af;
  --border:          #e5e7eb;
  --border-mid:      #d1d5db;
  --bg:              #f8fafc;
  --bg-alt:          #f1f5f9;
  --card:            #ffffff;

  /* Shape */
  --radius-sm:       6px;
  --radius:          10px;
  --radius-md:       12px;
  --radius-lg:       16px;
  --radius-xl:       20px;
  --radius-full:     999px;

  /* Shadow */
  --shadow-xs:       0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:       0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:       0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg:       0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-focus:    0 0 0 3px rgba(37,99,235,0.18);
  --shadow-error:    0 0 0 3px rgba(220,38,38,0.15);

  /* Typography */
  --font:            -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                     "Helvetica Neue", Arial, sans-serif;
  --font-mono:       "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono",
                     Consolas, monospace;

  /* Motion */
  --ease:            cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   120ms;
  --duration:        200ms;
  --duration-slow:   300ms;
}

/* ═══════════════════════════════════════════
   BASE
═══════════════════════════════════════════ */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 36px 16px 80px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.page-wrap {
  max-width: 720px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.page-header__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.page-header__icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.page-header__text { flex: 1; min-width: 0; }

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.page-header p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.alert svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert--success {
  background: var(--success-light);
  border: 1px solid var(--success-mid);
  color: var(--success);
}

.alert--error {
  background: var(--error-light);
  border: 1px solid var(--error-mid);
  color: var(--error);
}

.alert--info {
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  color: var(--primary);
}

.alert--warn {
  background: var(--warn-light);
  border: 1px solid var(--warn-mid);
  color: var(--warn);
}

/* ═══════════════════════════════════════════
   RESULT LIST  (post-upload feedback)
═══════════════════════════════════════════ */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  box-shadow: var(--shadow-xs);
}

.result-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.result-item--success {
  background: var(--success-light);
  border: 1px solid var(--success-mid);
  color: var(--success);
}

.result-item--error {
  background: var(--error-light);
  border: 1px solid var(--error-mid);
  color: var(--error);
}

.result-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.result-item__name {
  font-weight: 700;
  word-break: break-word;
}

.result-item__file {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.8;
  word-break: break-all;
}

.result-item__file svg {
  width: 12px;
  height: 12px;
  margin-top: 0;
}

.result-item__msg {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════
   DROPZONE
═══════════════════════════════════════════ */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 20px;
  background: var(--card);
  transition:
    border-color var(--duration) var(--ease),
    background   var(--duration) var(--ease),
    color        var(--duration) var(--ease),
    box-shadow   var(--duration) var(--ease);
  box-shadow: var(--shadow-xs);
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.dropzone.drag-over {
  border-style: solid;
}

.dropzone svg {
  width: 38px;
  height: 38px;
  margin: 0 auto 14px;
  display: block;
  stroke-width: 1.5;
  transition: transform var(--duration) var(--ease);
}

.dropzone:hover svg,
.dropzone.drag-over svg {
  transform: translateY(-3px);
}

.dropzone h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: inherit;
}

.dropzone p {
  font-size: 0.84rem;
  margin: 3px 0;
  color: inherit;
}

.dropzone__browse {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone__hint {
  font-size: 0.75rem !important;
  color: var(--muted-light) !important;
  margin-top: 10px !important;
}

.dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone.disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.3);
}

/* ═══════════════════════════════════════════
   FILE COUNT BADGE
═══════════════════════════════════════════ */
.file-count-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius-full);
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  width: fit-content;
  box-shadow: var(--shadow-xs);
}

.file-count-badge svg {
  width: 13px;
  height: 13px;
}

/* ═══════════════════════════════════════════
   FILE LIST + CARDS
═══════════════════════════════════════════ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.file-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.file-card:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--border-mid);
}

/* Card top bar */
.file-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.file-card__pdf-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.file-card__pdf-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.file-card__meta {
  flex: 1;
  min-width: 0;
}

.file-card__original {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card__size {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

.file-card__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background var(--duration-fast) var(--ease),
    color      var(--duration-fast) var(--ease);
}

.file-card__remove:hover {
  background: var(--error-light);
  color: var(--error);
}

.file-card__remove svg {
  width: 16px;
  height: 16px;
}

/* Card body */
.file-card__body {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ═══════════════════════════════════════════
   STEP LABELS
═══════════════════════════════════════════ */
.step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.step-label__num {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-mid));
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════════
   DOC TYPE GRID
═══════════════════════════════════════════ */
.doc-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.doc-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 11px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  font-family: var(--font);
  transition:
    border-color var(--duration-fast) var(--ease),
    background   var(--duration-fast) var(--ease),
    color        var(--duration-fast) var(--ease),
    box-shadow   var(--duration-fast) var(--ease),
    transform    var(--duration-fast) var(--ease);
  box-shadow: var(--shadow-xs);
  user-select: none;
}

.doc-type-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease);
}

.doc-type-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-focus);
  transform: translateY(-1px);
}

.doc-type-btn:hover svg {
  transform: scale(1.1);
}

.doc-type-btn:active {
  transform: translateY(0);
}

.doc-type-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-mid));
  color: var(--primary);
  box-shadow: var(--shadow-focus);
  font-weight: 700;
}

.doc-type-btn.active svg {
  transform: scale(1.08);
}

/* ═══════════════════════════════════════════
   FIELDS SECTION
═══════════════════════════════════════════ */
.fields-section {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeSlideIn var(--duration-slow) var(--ease) both;
}

.fields-section.visible {
  display: flex;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fields-row.full   { grid-template-columns: 1fr; }
.fields-row.thirds { grid-template-columns: 1fr 1fr 1fr; }

/* ═══════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-label .req {
  color: var(--error);
  margin-left: 2px;
}

.form-label .opt {
  color: var(--muted-light);
  font-weight: 400;
  margin-left: 3px;
  font-size: 0.71rem;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.855rem;
  background: var(--card);
  color: var(--text);
  outline: none;
  font-family: var(--font);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--duration-fast) var(--ease),
    box-shadow   var(--duration-fast) var(--ease),
    background   var(--duration-fast) var(--ease);
}

.form-input:hover {
  border-color: var(--border-mid);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  background: var(--card);
}

.form-input.invalid {
  border-color: var(--error);
  box-shadow: var(--shadow-error);
  background: #fff8f8;
}

.form-input::placeholder {
  color: var(--muted-light);
  font-size: 0.83rem;
}

/* Select */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: var(--card);
  padding-right: 34px;
  cursor: pointer;
}

.form-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Field error message */
.field-error {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--error);
  margin-top: 1px;
  display: none;
  align-items: center;
  gap: 4px;
  animation: fadeSlideIn var(--duration-fast) var(--ease) both;
}

.field-error.visible {
  display: flex;
}

/* ═══════════════════════════════════════════
   MEMO TOGGLE
═══════════════════════════════════════════ */
.memo-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition:
    border-color var(--duration-fast) var(--ease),
    background   var(--duration-fast) var(--ease),
    color        var(--duration-fast) var(--ease),
    box-shadow   var(--duration-fast) var(--ease);
  box-shadow: var(--shadow-xs);
}

.memo-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.memo-toggle:has(input:checked) {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-mid));
  color: var(--primary);
  box-shadow: var(--shadow-focus);
  font-weight: 700;
}

.memo-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   PERIOD TYPE PILLS
═══════════════════════════════════════════ */
.period-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.period-pill {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  background: var(--bg);
  font-family: var(--font);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--duration-fast) var(--ease),
    background   var(--duration-fast) var(--ease),
    color        var(--duration-fast) var(--ease),
    box-shadow   var(--duration-fast) var(--ease),
    transform    var(--duration-fast) var(--ease);
  user-select: none;
}

.period-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-focus);
}

.period-pill:active {
  transform: translateY(0);
}

.period-pill.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-mid));
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-focus);
}

/* ═══════════════════════════════════════════
   FILENAME PREVIEW
═══════════════════════════════════════════ */
.filename-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: #0369a1;
  box-shadow: var(--shadow-xs);
}

.filename-preview svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke-width: 2;
}

.filename-preview__inner {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.filename-preview__label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.filename-preview__value {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  color: var(--primary-deeper);
  font-weight: 700;
  word-break: break-all;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════
   SECTION DIVIDER
═══════════════════════════════════════════ */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 4px 0;
  border: none;
}

/* ═══════════════════════════════════════════
   SUBMIT SECTION
═══════════════════════════════════════════ */
.submit-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: none;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-md);
  position: sticky;
  bottom: 20px;
  z-index: 10;
}

.submit-section.visible {
  display: flex;
  animation: fadeSlideIn var(--duration) var(--ease) both;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35), var(--shadow-xs);
  transition:
    background    var(--duration-fast) var(--ease),
    box-shadow    var(--duration-fast) var(--ease),
    transform     var(--duration-fast) var(--ease),
    opacity       var(--duration-fast) var(--ease);
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-deeper));
  box-shadow: 0 4px 14px rgba(37,99,235,0.45), var(--shadow-xs);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-submit svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.5;
}

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  width: 100%;
  box-shadow: var(--shadow-xs);
  transition:
    background     var(--duration-fast) var(--ease),
    color          var(--duration-fast) var(--ease),
    border-color   var(--duration-fast) var(--ease),
    transform      var(--duration-fast) var(--ease);
}

.btn-back:hover {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--border-mid);
  transform: translateY(-1px);
}

.btn-back:active {
  transform: translateY(0);
}

.btn-back svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════ */
.progress-wrap {
  display: none;
  flex-direction: column;
  gap: 7px;
}

.progress-wrap.visible {
  display: flex;
  animation: fadeSlideIn var(--duration-fast) var(--ease) both;
}

.progress-label {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-label span:last-child {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 7px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

/* Shimmer effect on progress fill */
.progress-bar__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.35) 50%,
    transparent 100%
  );
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════
   SUCCESS PAGE
═══════════════════════════════════════════ */
.success-page {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  animation: fadeSlideIn var(--duration-slow) var(--ease) both;
}

.success-page__icon {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--success-light), var(--success-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  box-shadow: 0 4px 16px rgba(22,163,74,0.2);
  animation: popIn var(--duration-slow) var(--ease) both;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-page__icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 2;
}

.success-page h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.success-page > p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 380px;
  line-height: 1.65;
}

.success-page__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════
   CARD FOOTER
═══════════════════════════════════════════ */
.card-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.77rem;
  color: var(--muted-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.card-footer svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--success);
}

/* ═══════════════════════════════════════════
   BRAND HEADER
═══════════════════════════════════════════ */
.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-logo {
  font-family: 'Pacifico', cursive;
  font-size: 2.5rem;
  color: var(--primary-deeper);
  letter-spacing: 0.3px;
  font-weight: 900;
}

/* ═══════════════════════════════════════════
   UPLOAD CTA BANNER
═══════════════════════════════════════════ */
.upload-cta-banner {
  margin: 16px 0 24px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-mid));
  border: 1px solid #bfdbfe;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow-xs);
  color: var(--primary-deeper);
}

/* ═══════════════════════════════════════════
   PAGE HEADER SUBTITLE + RULES
═══════════════════════════════════════════ */
.page-header__subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.page-header__rules {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
}

.rule {
  display: flex;
  align-items: center;
  gap: 7px;
}

.rule svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--primary);
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   (injected by JS — styles kept here for
    consistency with the design system)
═══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-width: min(420px, 92vw);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity   var(--duration) var(--ease),
    transform var(--duration) var(--ease);
}

.toast.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.toast--info {
  background: var(--primary-light);
  border: 1.5px solid var(--primary-mid);
  color: var(--primary);
}

.toast--error {
  background: var(--error-light);
  border: 1.5px solid var(--error-mid);
  color: var(--error);
}

.toast--warn {
  background: var(--warn-light);
  border: 1.5px solid var(--warn-mid);
  color: var(--warn);
}

.toast--success {
  background: var(--success-light);
  border: 1.5px solid var(--success-mid);
  color: var(--success);
}

/* ═══════════════════════════════════════════
   SCROLLBAR  (Webkit)
═══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-light);
}

/* ═══════════════════════════════════════════
   FOCUS VISIBLE  (keyboard nav)
═══════════════════════════════════════════ */
:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* ═══════════════════════════════════════════
   SELECTION
═══════════════════════════════════════════ */
::selection {
  background: var(--primary-mid);
  color: var(--primary-deeper);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 600px) {
  body {
    padding: 20px 12px 80px;
  }

  .page-header {
    padding: 16px;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 1.1rem;
  }

  .page-header__icon {
    width: 46px;
    height: 46px;
  }

  .doc-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fields-row {
    grid-template-columns: 1fr;
  }

  .fields-row.thirds {
    grid-template-columns: 1fr 1fr;
  }

  .submit-section {
    border-radius: var(--radius-md);
    padding: 16px;
    bottom: 12px;
  }

  .success-page {
    padding: 32px 16px;
  }

  .success-page h2 {
    font-size: 1.2rem;
  }

  .dropzone {
    padding: 28px 16px;
  }

  .file-card__body {
    padding: 14px 12px;
  }
}

@media (max-width: 380px) {
  .doc-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .period-pills {
    gap: 6px;
  }

  .period-pill {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .btn-submit,
  .btn-back {
    font-size: 0.875rem;
    padding: 12px 16px;
  }
}

/* ═══════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .progress-bar__fill::after {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   PRINT
═══════════════════════════════════════════ */
@media print {
  .submit-section,
  .dropzone,
  .file-count-badge,
  .card-footer,
  .btn-submit,
  .btn-back {
    display: none !important;
  }

  body {
    background: white;
    padding: 0;
  }

  .page-wrap {
    max-width: 100%;
  }
}

/* ═══════════════════════════════════════════
   UPLOAD SHOWCASE — PILL ROW
═══════════════════════════════════════════ */
.upload-showcase {
  margin-bottom: 24px;
}

.upload-showcase__heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.upload-showcase__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* ── Base pill ── */
.upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: default;
  user-select: none;
  transition:
    transform      var(--duration-fast) var(--ease),
    box-shadow     var(--duration-fast) var(--ease);
}

.upload-pill svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke-width: 2.5;
}

.upload-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ── Colour variants ── */
.upload-pill--blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.upload-pill--violet {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.upload-pill--emerald {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.upload-pill--amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.upload-pill--rose {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.upload-pill--cyan {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #155e75;
}

.upload-pill--indigo {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.upload-pill--teal {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #134e4a;
}

.upload-pill--orange {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.upload-pill--purple {
  background: #faf5ff;
  border-color: #e9d5ff;
  color: #6b21a8;
}

.upload-pill--sky {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #075985;
}

.upload-pill--lime {
  background: #f7fee7;
  border-color: #d9f99d;
  color: #3f6212;
}

.upload-pill--slate {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.upload-pill--pink {
  background: #fdf2f8;
  border-color: #f9a8d4;
  color: #9d174d;
}

/* ── Dark mode overrides ── */
@media (prefers-color-scheme: dark) {
  .upload-pill--blue    { background: #1e3a5f; border-color: #1d4ed8; color: #93c5fd; }
  .upload-pill--violet  { background: #2e1065; border-color: #6d28d9; color: #c4b5fd; }
  .upload-pill--emerald { background: #064e3b; border-color: #065f46; color: #6ee7b7; }
  .upload-pill--amber   { background: #451a03; border-color: #92400e; color: #fcd34d; }
  .upload-pill--rose    { background: #4c0519; border-color: #9f1239; color: #fda4af; }
  .upload-pill--cyan    { background: #083344; border-color: #155e75; color: #67e8f9; }
  .upload-pill--indigo  { background: #1e1b4b; border-color: #3730a3; color: #a5b4fc; }
  .upload-pill--teal    { background: #042f2e; border-color: #134e4a; color: #5eead4; }
  .upload-pill--orange  { background: #431407; border-color: #9a3412; color: #fdba74; }
  .upload-pill--purple  { background: #3b0764; border-color: #6b21a8; color: #d8b4fe; }
  .upload-pill--sky     { background: #082f49; border-color: #075985; color: #7dd3fc; }
  .upload-pill--lime    { background: #1a2e05; border-color: #3f6212; color: #bef264; }
  .upload-pill--slate   { background: #1e293b; border-color: #334155; color: #94a3b8; }
  .upload-pill--pink    { background: #500724; border-color: #9d174d; color: #f9a8d4; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .upload-pill {
    font-size: 0.72rem;
    padding: 5px 9px;
  }

  .upload-pill svg {
    width: 11px;
    height: 11px;
  }
}

/* ── "& More" pill — dashed border to signal open-ended list ── */
.upload-pill--more {
  background: transparent;
  border-color: var(--border-mid);
  border-style: dashed;
  color: var(--muted);
  font-style: italic;
}

.upload-pill--more svg {
  color: var(--muted);
}

.upload-pill--more:hover {
  background: var(--bg-alt);
  border-color: var(--muted);
  color: var(--text-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .upload-pill--more {
    background: transparent;
    border-color: var(--border-mid);
    color: var(--muted);
  }

  .upload-pill--more:hover {
    background: var(--bg-alt);
    border-color: var(--muted-light);
    color: var(--text-secondary);
  }
}