/* ---------- card (hand-drawn box) ---------- */
.card {
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 20px 24px;
  margin-bottom: 18px;
  filter: url(#wobble);
}

/* ---------- steps list ---------- */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  counter-reset: steps;
}

.steps-list li {
  counter-increment: steps;
  padding: 12px 0 12px 40px;
  position: relative;
  border-bottom: 1px dashed var(--faint);
  font-size: 0.95rem;
  line-height: 1.55;
}

.steps-list li:last-child { border-bottom: none; }

.steps-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 12px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  text-align: center;
  line-height: 22px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---------- privacy highlights ---------- */
.privacy-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.privacy-list li {
  padding: 10px 0 10px 28px;
  position: relative;
  border-bottom: 1px dashed var(--faint);
  font-size: 0.95rem;
}

.privacy-list li:last-child { border-bottom: none; }

.privacy-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--ink-mid);
}

/* ---------- drop zone ---------- */
.drop-zone {
  border: 2.5px dashed var(--muted);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 18px;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--ink);
  background: rgba(0,0,0,0.02);
}

.drop-zone-label {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-zone-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.drop-zone input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

/* ---------- preview table ---------- */
.preview-wrap {
  display: none;
  margin-bottom: 18px;
}

.preview-wrap.visible { display: block; }

.preview-label {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-mid);
}

.preview-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--faint);
  background: var(--white);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  white-space: nowrap;
}

.preview-table th {
  background: var(--paper);
  font-weight: 700;
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--faint);
  position: sticky;
  top: 0;
  z-index: 1;
}

.preview-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.preview-stats {
  font-size: 0.85rem;
  color: var(--ink-mid);
  margin-top: 8px;
}

/* ---------- form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.form-field { display: flex; flex-direction: column; }
.form-field.full-width { grid-column: 1 / -1; }

.form-field label {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.form-field label .optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-field input,
.form-field select {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  outline: none;
}

.form-field input:focus,
.form-field select:focus {
  box-shadow: 0 0 0 2px var(--note-border);
}

.form-actions {
  text-align: center;
  margin-top: 24px;
}

/* ---------- status messages ---------- */
.status-msg {
  display: none;
  padding: 14px 18px;
  font-size: 0.92rem;
  margin-top: 14px;
}

.status-msg.visible { display: block; }

.status-msg.success {
  background: var(--green-bg);
  border: 2px solid var(--green);
  color: var(--green);
}

.status-msg.error {
  background: var(--red-bg);
  border: 2px solid var(--red);
  color: var(--red);
}

/* ---------- success state ---------- */
.success-state {
  display: none;
  text-align: center;
  padding: 32px 24px;
}

.success-state.visible { display: block; }

.success-state h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.success-state p {
  font-size: 1rem;
  color: var(--ink-mid);
  max-width: 50ch;
  margin: 0 auto 14px;
}

/* ---------- file info bar ---------- */
.file-info {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--faint);
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.file-info.visible { display: flex; }

.file-info .file-name {
  font-weight: 700;
  flex: 1;
}

.file-info .file-remove {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
}

.file-info .file-remove:hover {
  color: var(--ink);
}

/* ---------- loading spinner ---------- */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--paper);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- button disabled ---------- */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled:hover {
  transform: none;
  box-shadow: 3px 3px 0 var(--ink-mid);
}

/* ---------- responsive ---------- */
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
}
