/* ==========================================================================
   TEAM ONE BAIL BONDS — form.css
   "Midnight Calm" form styles — depends on main.css for design tokens
   ========================================================================== */

/* ===== FORM CONTAINER ===== */
.form-container {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px 56px;
}

#main-form {
  width: 100%;
}

#bondForm {
  width: 100%;
}

/* ===== STEP PROGRESS WRAPPER ===== */
.progress-wrapper {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 20px 0;
  margin-bottom: 20px;
  overflow: hidden;
}

/* Scrollable step track */
.progress-track {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
}

.progress-track::-webkit-scrollbar {
  display: none;
}

/* Flex row of step items */
.steps-row,
#stepsRow {
  display: flex;
  align-items: flex-start;
  min-width: max-content;
  position: relative;
  padding-bottom: 16px;
}

/* Individual step tab */
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 84px;
  cursor: pointer;
  scroll-snap-align: center;
}

/* Horizontal connector line between circles */
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--slate-200);
  z-index: 0;
  transition: background var(--transition);
}

.step-item.completed:not(:last-child)::after {
  background: var(--emerald-500);
}

/* Step circle */
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  border: 2px solid var(--slate-300);
  background: var(--white);
  color: var(--slate-500);
  position: relative;
  z-index: 1;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.step-item.completed .step-circle {
  background: var(--emerald-500);
  border-color: var(--emerald-500);
  color: var(--white);
  /* Checkmark via pseudo-element */
  font-size: 0; /* hide number */
}

.step-item.completed .step-circle::before {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2.5px solid var(--white);
  border-bottom: 2.5px solid var(--white);
  transform: rotate(-45deg) translate(1px, -1px);
}

.step-item.active .step-circle {
  background: var(--amber-400);
  border-color: var(--amber-500);
  color: var(--slate-950);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
}

/* Step label */
.step-label {
  font-size: 0.65rem;
  font-family: var(--font-sans);
  text-align: center;
  margin-top: 6px;
  color: var(--slate-400);
  font-weight: 500;
  line-height: 1.3;
  max-width: 72px;
  transition: color var(--transition);
}

.step-item.completed .step-label {
  color: var(--emerald-500);
}

.step-item.active .step-label {
  color: var(--amber-500);
  font-weight: 700;
}

/* Thin amber progress fill bar at bottom of wrapper */
.progress-fill-bar,
#progressFill {
  height: 3px;
  background: linear-gradient(90deg, var(--amber-500), var(--amber-300));
  border-radius: 0;
  margin-top: 0;
  transition: width 0.4s ease;
}

/* ===== FORM CARD ===== */
.form-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ===== STEP PANELS ===== */
.step-panel {
  display: none;
  padding: 40px 40px 32px;
  animation: stepIn 0.2s ease both;
}

.step-panel.active {
  display: block;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step heading */
.step-panel h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--slate-800);
  border-bottom: 2px solid var(--slate-100);
  padding-bottom: 14px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Step number badge */
.step-panel h2 .step-num {
  background: var(--amber-400);
  color: var(--slate-950);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Sub-headings within a step */
.step-panel h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-700);
  margin: 28px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--amber-400);
  letter-spacing: 0.01em;
}

/* ===== FIELD GRID ===== */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 20px;
}

.field-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.field-grid.cols-1 {
  grid-template-columns: 1fr;
}

.full-width {
  grid-column: 1 / -1;
}

/* ===== INDIVIDUAL FIELD ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-700);
  line-height: 1.3;
}

.field label .req,
fieldset.radio-group legend .req {
  color: var(--rose-500);
  margin-left: 2px;
}

/* ===== INPUT / SELECT / TEXTAREA ===== */
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--slate-800);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--slate-400);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--amber-400);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--amber-400);
  outline-offset: 1px;
}

/* Textarea overrides height */
.field textarea {
  height: auto;
  min-height: 90px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}

/* Select custom arrow */
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ===== VALIDATION STATES ===== */
.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--rose-500) !important;
  background-color: rgba(244, 63, 94, 0.03);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1) !important;
}

.error-msg {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--rose-500);
  font-weight: 500;
  line-height: 1.3;
  margin-top: 2px;
}

/* ===== INPUT PREFIX GROUP (e.g. "$") ===== */
.input-prefix-group {
  display: flex;
  align-items: stretch;
}

.input-prefix-group .prefix {
  background: var(--slate-100);
  border: 1.5px solid var(--slate-300);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 0 12px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.input-prefix-group input {
  border-radius: 0 var(--radius) var(--radius) 0;
  flex: 1;
}

/* Bond amount written out */
.bond-amount-written {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--amber-700, #b45309);
  font-style: italic;
  font-weight: 500;
  margin-top: 4px;
  min-height: 1.1em;
}

/* ===== RADIO / CHECKBOX GROUPS ===== */
fieldset.radio-group {
  border: none;
  padding: 0;
}

fieldset.radio-group legend {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 8px;
}

.radio-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.radio-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--slate-700);
  cursor: pointer;
  font-weight: 400;
}

.radio-options input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--amber-500);
  cursor: pointer;
  flex-shrink: 0;
}

.radio-options input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid var(--slate-400);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.radio-options input[type="checkbox"]:checked {
  background: var(--amber-500);
  border-color: var(--amber-500);
}

.radio-options input[type="checkbox"]:checked::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--white);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.radio-options input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: 2px;
}

/* ===== CO-SIGNER CARDS ===== */
.cosigner-list,
#cosignerList {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.cosigner-card {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-left: 4px solid var(--amber-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

/* Remove co-signer button */
.btn-remove {
  background: none;
  border: 1.5px solid var(--rose-500);
  color: var(--rose-500);
  border-radius: var(--radius);
  padding: 0 14px;
  height: 44px;
  min-height: 44px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
  line-height: 1;
  white-space: nowrap;
}

.btn-remove:hover {
  background: var(--rose-500);
  color: var(--white);
}

/* Add co-signer button */
.btn-add-cosigner,
#btnAddCosigner {
  background: none;
  border: 2px dashed var(--amber-400);
  color: var(--amber-500);
  border-radius: var(--radius);
  padding: 11px 20px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  margin-top: 8px;
}

.btn-add-cosigner:hover,
#btnAddCosigner:hover {
  background: var(--amber-50);
  border-color: var(--amber-500);
  color: var(--slate-950);
}

/* ===== REFERENCE CARDS ===== */
.reference-card {
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.reference-card h3 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--slate-700);
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* ===== PAYMENT ROWS ===== */
.payment-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.payment-row .payment-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--slate-700);
}

#installmentRows,
.installment-rows {
  margin-top: 14px;
  padding: 20px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--slate-200);
}

/* ===== REVIEW PANEL ===== */
.review-section {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.review-section__heading,
.review-section-header h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--amber-300);
  display: inline-block;
}

.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Undo the inline-block when inside header flex context */
.review-section-header .review-section__heading,
.review-section-header h4 {
  display: block;
  margin-bottom: 0;
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.review-item {
  font-size: 0.875rem;
  line-height: 1.4;
}

.review-item__label,
.review-item .rl {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--slate-500);
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

.review-item__value,
.review-item .rv {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--slate-800);
  word-break: break-word;
}

.review-item .rv:empty::before,
.review-item__value:empty::before {
  content: '—';
  color: var(--slate-400);
  font-weight: 400;
}

/* Edit step button within review */
.btn-edit-step {
  background: none;
  border: 1.5px solid var(--slate-300);
  color: var(--slate-600);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 36px;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  cursor: pointer;
  font-weight: 600;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.btn-edit-step:hover {
  border-color: var(--amber-400);
  color: var(--amber-500);
}

/* Confirm accuracy checkbox */
.confirm-check-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--amber-50);
  border: 1.5px solid var(--amber-200);
  border-radius: var(--radius-md);
}

.confirm-check-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
  border: 1.5px solid var(--slate-400);
  border-radius: 4px;
  background: var(--white);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.confirm-check-wrap input[type="checkbox"]:checked {
  background: var(--amber-500);
  border-color: var(--amber-500);
}

.confirm-check-wrap input[type="checkbox"]:checked::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--white);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.confirm-check-wrap input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--amber-400);
  outline-offset: 2px;
}

.confirm-check-wrap label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--slate-700);
  line-height: 1.55;
  cursor: pointer;
}

/* ===== DOCUMENT PREVIEW ===== */
.doc-preview-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.doc-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  cursor: default;
}

.doc-preview-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--slate-300);
}

.doc-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.doc-status.ready {
  background: var(--emerald-100);
  color: var(--emerald-500);
}

.doc-status.pending {
  background: var(--amber-100);
  color: var(--amber-500);
}

/* ===== DOCUSIGN SECTION ===== */
#btnDocuSign,
.btn-docusign {
  background: var(--slate-800);
  border: 2px solid var(--slate-800);
  color: var(--white);
  border-radius: var(--radius);
  padding: 0 24px;
  height: 48px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  letter-spacing: 0.01em;
}

#btnDocuSign:hover:not(:disabled),
.btn-docusign:hover:not(:disabled) {
  background: var(--slate-700);
  border-color: var(--slate-700);
}

#btnDocuSign:disabled,
.btn-docusign:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-docusign-note {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--slate-500);
  font-style: italic;
  align-self: center;
}

.docusign-banner {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

.docusign-banner.success {
  background: var(--emerald-100);
  border: 1px solid #6EE7B7;
  color: #065F46;
}

.docusign-banner.error {
  background: var(--rose-100);
  border: 1px solid #FCA5A5;
  color: #9F1239;
}

.docusign-banner strong {
  display: block;
  margin-bottom: 4px;
}

/* DocuSign CTA accent area (container-level) */
.docusign-cta {
  border: 1.5px solid var(--amber-300);
  border-radius: var(--radius-md);
  padding: 24px;
  background: var(--amber-50);
  margin-top: 20px;
}

/* ===== FORM NAVIGATION BUTTONS ===== */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-top: 1px solid var(--slate-100);
  background: var(--white);
}

/* Step counter */
#stepCounter,
.step-counter {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--slate-500);
  font-weight: 500;
  order: 2; /* sits between back/next when flex has gap */
}

#btnBack,
.btn-back {
  background: var(--white);
  border: 1.5px solid var(--slate-300);
  color: var(--slate-600);
  border-radius: var(--radius);
  padding: 0 24px;
  height: 48px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

#btnBack:hover,
.btn-back:hover {
  border-color: var(--slate-500);
  color: var(--slate-800);
}

#btnBack:disabled,
.btn-back:disabled {
  opacity: 0;
  pointer-events: none;
}

#btnNext,
.btn-next {
  background: var(--amber-400);
  border: 1.5px solid var(--amber-500);
  color: var(--slate-950);
  border-radius: var(--radius);
  padding: 0 28px;
  height: 48px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  letter-spacing: 0.01em;
}

#btnNext:hover,
.btn-next:hover {
  background: var(--amber-500);
  border-color: var(--amber-500);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-submit {
  background: var(--emerald-500);
  border: 1.5px solid var(--emerald-500);
  color: var(--white);
  border-radius: var(--radius);
  padding: 0 32px;
  height: 48px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  letter-spacing: 0.01em;
}

.btn-submit:hover {
  background: #0EA572;
  border-color: #0EA572;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-submit:disabled {
  background: var(--slate-300);
  border-color: var(--slate-300);
  cursor: not-allowed;
  box-shadow: none;
}

/* Clear data button */
#btnClearData {
  background: none;
  border: 1.5px solid var(--slate-200);
  color: var(--slate-500);
  border-radius: var(--radius);
  padding: 0 16px;
  height: 36px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

#btnClearData:hover {
  border-color: var(--rose-500);
  color: var(--rose-500);
}

/* ===== AUTO-SAVE TOAST ===== */
.save-toast,
#saveToast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--slate-800);
  color: var(--white);
  border-left: 4px solid var(--emerald-500);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transform: translateX(120%);
  transition: transform 0.25s ease;
  max-width: 280px;
  line-height: 1.4;
}

.save-toast.visible,
#saveToast.visible {
  transform: translateX(0);
}

/* ===== GENERATED DOCUMENTS RESULTS ===== */
.docs-results {
  max-width: 900px;
  margin: 0 auto 56px;
  padding: 0 16px;
  display: none;
}

.docs-results.visible {
  display: block;
}

.docs-results-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.docs-results-header {
  background: var(--slate-800);
  color: var(--white);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.docs-results-header h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.docs-results-header .check-icon {
  width: 32px;
  height: 32px;
  background: var(--emerald-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.docs-results-body {
  padding: 28px;
}

.docs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition-fast);
}

.doc-item:hover {
  box-shadow: var(--shadow);
}

.doc-item-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.doc-item-name {
  flex: 1;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--slate-800);
}

/* Download button */
.btn-download {
  background: var(--amber-400);
  border: 1.5px solid var(--amber-500);
  color: var(--slate-950);
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  line-height: 1.5;
}

.btn-download:hover {
  background: var(--amber-500);
  border-color: var(--amber-500);
  text-decoration: none;
  color: var(--slate-950);
}

.docs-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--slate-100);
  padding-top: 20px;
}

/* ===== COMPLETE SECTION ===== */
.complete-section {
  text-align: center;
  padding: 56px 32px;
}

.complete-section__icon {
  width: 80px;
  height: 80px;
  background: var(--emerald-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin: 0 auto 24px;
}

.complete-section h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--slate-800);
  margin-bottom: 12px;
}

.complete-section p {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--slate-600);
  max-width: 460px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

/* ===== MOBILE: prevent iOS zoom on focus (font-size must be >= 16px on inputs) ===== */

@media (max-width: 767px) {
  .field input,
  .field select,
  .field textarea {
    font-size: 1rem;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .step-panel {
    animation: none;
  }

  .step-circle,
  .step-item::after,
  .step-label,
  .field input,
  .field select,
  .field textarea,
  .progress-fill-bar,
  .save-toast,
  #saveToast,
  #btnNext,
  .btn-next,
  .btn-submit,
  #btnBack,
  .btn-back {
    transition: none;
  }
}

/* ===== RESPONSIVE: TABLET & MOBILE (< 768px) ===== */
@media (max-width: 767px) {
  .form-container {
    margin: 16px auto;
    padding: 0 12px 36px;
  }

  .progress-wrapper {
    padding: 20px 14px 0;
    border-radius: var(--radius-md);
  }

  .step-panel {
    padding: 24px 20px 28px;
  }

  .form-nav {
    padding: 16px 20px;
  }

  .field-grid,
  .field-grid.cols-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .full-width {
    grid-column: auto;
  }

  .cosigner-card {
    grid-template-columns: 1fr;
  }

  .payment-row {
    grid-template-columns: 1fr;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  /* Hide step labels on mobile — show numbers only */
  .step-label {
    display: none;
  }

  .step-item {
    min-width: 52px;
  }

  .steps-row {
    padding-bottom: 12px;
  }

  .docs-results-header {
    padding: 16px 18px;
  }

  .docs-results-body {
    padding: 18px;
  }

  .doc-item {
    flex-wrap: wrap;
  }
}

/* ===== RESPONSIVE: SMALL MOBILE (< 480px) ===== */
@media (max-width: 480px) {
  #btnBack,
  .btn-back,
  #btnNext,
  .btn-next,
  .btn-submit {
    padding: 0 16px;
    font-size: 0.875rem;
    height: 44px;
    width: 100%;
  }

  .form-nav {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }

  #stepCounter,
  .step-counter {
    order: 0;
  }

  .step-panel {
    padding: 20px 16px 24px;
  }

  .confirm-check-wrap {
    padding: 14px 16px;
  }

  .cosigner-card {
    padding: 16px;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .step-panel {
    animation: none;
  }

  .step-circle,
  .step-item:not(:last-child)::after,
  .progress-fill-bar,
  #progressFill {
    transition: none;
  }
}
