/**
 * REPAF Multi-Step Form
 * Scoped styles for the [repaf_form] shortcode.
 */

.repaf-wizard {
  /* Theme colors */
  --repaf-primary: #c2187a;
  --repaf-primary-dark: #9c145f;
  --repaf-primary-soft: #fff1f7;

  --repaf-success: #914b74;
  --repaf-error: #dc2626;

  --repaf-text: #1f2937;
  --repaf-text-soft: #64748b;

  --repaf-border: #f3c5dc;
  --repaf-border-soft: #f9d7e8;

  --repaf-bg: #ffffff;
  --repaf-bg-soft: #fff8fc;

  --repaf-radius-sm: 10px;
  --repaf-radius-md: 16px;
  --repaf-radius-lg: 20px;

  --repaf-shadow: 0 16px 40px rgba(194, 24, 122, 0.08);
  --repaf-shadow-hover: 0 8px 20px rgba(194, 24, 122, 0.18);

  max-width: 980px;
  margin: 40px auto;
  padding: 28px;
  background: var(--repaf-bg);
  border: 1px solid var(--repaf-border);
  border-radius: var(--repaf-radius-lg);
  box-shadow: var(--repaf-shadow);
  font-family: Arial, sans-serif;
  color: var(--repaf-text);
}

.repaf-wizard,
.repaf-wizard * {
  box-sizing: border-box;
}

.repaf-required {
  color: var(--repaf-error);
}

/* Header */
.repaf-wizard__header {
  margin-bottom: 24px;
  padding: 24px;
  border-radius: var(--repaf-radius-md);
  background: linear-gradient(
    135deg,
    var(--repaf-primary-dark),
    var(--repaf-primary)
  );
  color: #ffffff;
  text-align: center;
}

.repaf-wizard__header h2 {
  margin: 0 0 6px;
  font-size: 28px;
  color: #ffffff;
}

.repaf-wizard__header p {
  margin: 0;
  font-size: 15px;
  opacity: 0.9;
  color: #ffffff;
}

/* Progress indicator */
.repaf-wizard__progress {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 28px;
}

.repaf-step-indicator {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--repaf-border);
  border-radius: 50%;
  background: var(--repaf-bg);
  color: var(--repaf-text-soft);
  font-weight: 700;
}

.repaf-step-indicator.is-active {
  border-color: var(--repaf-primary);
  background: var(--repaf-primary);
  color: #ffffff;
}

.repaf-step-indicator.is-complete {
  border-color: var(--repaf-success);
  background: var(--repaf-success);
  color: #ffffff;
}

/* Step panels */
.repaf-step {
  display: none;
  padding: 24px;
  border: 1px solid var(--repaf-border-soft);
  border-radius: var(--repaf-radius-md);
  background: var(--repaf-bg-soft);
}

.repaf-step.is-active {
  display: block;
}

.repaf-step h3 {
  margin: 0 0 18px;
  color: var(--repaf-primary);
  font-size: 22px;
}

/* Form layout */
.repaf-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.repaf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.repaf-field label,
.repaf-radio-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--repaf-text);
}

.repaf-field input,
.repaf-field select,
.repaf-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--repaf-border);
  border-radius: var(--repaf-radius-sm);
  background: var(--repaf-bg);
  color: var(--repaf-text);
  font-size: 14px;
}

.repaf-field input:focus,
.repaf-field select:focus,
.repaf-field textarea:focus {
  border-color: var(--repaf-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(194, 24, 122, 0.12);
}

/* Radio groups */
.repaf-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.repaf-radio-group label {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
}

/* Prevent radio buttons from being stretched by general input styles */
.repaf-wizard .repaf-radio-group input[type="radio"],
.repaf-wizard .repaf-field input[type="radio"] {
  appearance: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  margin: 2px 6px 0 0;
  padding: 0;
  flex: 0 0 16px;
  border-radius: 50%;
  box-shadow: none;
  accent-color: var(--repaf-primary);
}

/* Validation */
.repaf-error-message {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--repaf-error);
  border-radius: var(--repaf-radius-sm);
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
  font-weight: 700;
}

.repaf-error-message.is-visible {
  display: block;
}

.repaf-error-message__title {
  display: block;
  margin-bottom: 6px;
}

.repaf-error-message__list {
  margin: 0;
  padding-left: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.repaf-error-message__list li + li {
  margin-top: 2px;
}

.repaf-field.is-invalid input,
.repaf-field.is-invalid select,
.repaf-field.is-invalid textarea {
  border-color: var(--repaf-error);
  background: #fff7f7;
}

/* Actions */
.repaf-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.repaf-actions button {
  min-width: 120px;
  padding: 12px 18px;
  border: 1px solid var(--repaf-primary);
  border-radius: var(--repaf-radius-sm);
  background: var(--repaf-bg);
  color: var(--repaf-primary);
  font-weight: 700;
  cursor: pointer;
}

.repaf-actions .repaf-next,
.repaf-actions button[type="submit"] {
  margin-left: auto;
  background: var(--repaf-primary);
  color: #ffffff;
}

.repaf-actions button:hover {
  transform: translateY(-1px);
  box-shadow: var(--repaf-shadow-hover);
}

/* Mobile */
@media (max-width: 700px) {
  .repaf-wizard {
    width: calc(100vw - 24px);
    margin: 20px auto;
    padding: 16px;
  }

  .repaf-wizard__header h2 {
    font-size: 22px;
  }

  .repaf-wizard__progress {
    gap: 6px;
  }

  .repaf-step-indicator {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .repaf-step {
    padding: 12px;
  }

  .repaf-step h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .repaf-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .repaf-step .repaf-fieldset {
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .repaf-field-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .repaf-section-title {
    margin: 14px 0 8px;
    font-size: 14px;
  }

  .repaf-field input,
  .repaf-field select,
  .repaf-field textarea {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .repaf-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 24px -18px -18px;
    padding: 12px 18px;
    background: var(--repaf-bg);
    border-top: 1px solid var(--repaf-border-soft);
  }

  .repaf-actions button {
    width: 100%;
  }
}
/* ==========================================================================
   Section Titles
   ========================================================================== */

/**
 * Used for sub-sections inside a single step.
 *
 * Example:
 * - Permanent Address
 * - Present Address
 * - Home Ownership
 * - Occupation
 */
.repaf-section-title {
  margin: 24px 0 12px;
  color: var(--repaf-primary);
  font-size: 16px;
  font-weight: 700;
}

/* ==========================================================================
   Same Address Copy Row
   ========================================================================== */

/**
 * Highlight container for:
 * "Same as Permanent Address"
 */
.repaf-copy-row {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--repaf-border-soft);
  border-radius: var(--repaf-radius-sm);
  background: var(--repaf-primary-soft);
}

/**
 * Checkbox label wrapper.
 *
 * Uses inline-flex for proper checkbox/text alignment.
 */
.repaf-copy-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--repaf-primary-dark);
}

/**
 * Checkbox styling.
 *
 * accent-color allows native checkbox color theming.
 */
.repaf-copy-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--repaf-primary);
}

/* ==========================================================================
   Disabled Inputs
   ========================================================================== */

/**
 * Disabled conditional fields.
 *
 * Example:
 * - Monthly Rent Amount
 * - Other Occupation
 */
.repaf-field input:disabled,
.repaf-field select:disabled,
.repaf-field textarea:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.7;
}
/* ==========================================================================
   Financial Information Step
   ========================================================================== */

/**
 * Card wrapper for financial sections.
 *
 * Used for:
 * - Monthly Income
 * - Bank Accounts
 * - Loans
 * - Character References
 */
.repaf-financial-card {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--repaf-border);
  border-radius: var(--repaf-radius-md);
  background: var(--repaf-bg);
}

/**
 * Financial card header.
 */
.repaf-financial-card__header {
  padding: 14px 18px;
  background: var(--repaf-primary);
  color: #ffffff;
}

.repaf-financial-card__header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.repaf-financial-card__header p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
}

/* ==========================================================================
   Financial Income Table
   ========================================================================== */

/**
 * Table-like grid for monthly income.
 */
.repaf-financial-table {
  width: 100%;
}

.repaf-financial-table__row {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  border-bottom: 1px solid var(--repaf-border-soft);
}

.repaf-financial-table__row:last-child {
  border-bottom: 0;
}

.repaf-financial-table__row > div {
  padding: 12px;
  border-right: 1px solid var(--repaf-border-soft);
}

.repaf-financial-table__row > div:last-child {
  border-right: 0;
}

.repaf-financial-table__head {
  background: var(--repaf-primary-soft);
  color: var(--repaf-primary-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.repaf-financial-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--repaf-primary-dark);
}

.repaf-financial-table input {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--repaf-border);
  border-radius: var(--repaf-radius-sm);
  background: var(--repaf-bg);
  color: var(--repaf-text);
  font-size: 14px;
}

/* ==========================================================================
   Repeatable Financial Rows
   ========================================================================== */

/**
 * Repeatable rows used for bank accounts, loans, and references.
 */
.repaf-repeatable-grid {
  padding: 16px;
}

.repaf-repeatable-row {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--repaf-border-soft);
}

.repaf-repeatable-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.repaf-repeatable-grid--4 .repaf-repeatable-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.repaf-repeatable-grid--7 .repaf-repeatable-row {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* ==========================================================================
   Financial Mobile Layout
   ========================================================================== */

@media (max-width: 900px) {
  .repaf-financial-table__row {
    grid-template-columns: 1fr;
  }

  .repaf-financial-table__head {
    display: none;
  }

  .repaf-financial-table__row > div {
    border-right: 0;
  }

  .repaf-financial-label {
    background: var(--repaf-primary-soft);
  }

  .repaf-repeatable-grid--4 .repaf-repeatable-row,
  .repaf-repeatable-grid--7 .repaf-repeatable-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Review & Confirm Step
   ========================================================================== */

/**
 * Intro paragraph above the review summary.
 */
.repaf-review-intro {
  margin-bottom: 20px;
  color: var(--repaf-text-soft);
  font-size: 14px;
  line-height: 1.6;
}

/**
 * Review summary wrapper.
 */
.repaf-review-summary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/**
 * Individual review section card.
 */
.repaf-review-card {
  overflow: hidden;
  border: 1px solid var(--repaf-border);
  border-radius: var(--repaf-radius-md);
  background: var(--repaf-bg);
  box-shadow: var(--repaf-shadow);
}

/**
 * Review card header.
 */
.repaf-review-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--repaf-primary-soft);
  border-bottom: 1px solid var(--repaf-border-soft);
}

.repaf-review-card__header h4 {
  margin: 0;
  color: var(--repaf-primary-dark);
  font-size: 16px;
  font-weight: 800;
}

/**
 * Edit button per review section.
 */
.repaf-review-edit {
  padding: 8px 14px;
  border: 1px solid var(--repaf-primary);
  border-radius: var(--repaf-radius-sm);
  background: var(--repaf-bg);
  color: var(--repaf-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.repaf-review-edit:hover {
  transform: translateY(-1px);
  box-shadow: var(--repaf-shadow-hover);
}

/**
 * Review card content area.
 */
.repaf-review-card__content {
  padding: 18px;
}

/**
 * Review data grid.
 */
.repaf-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

/**
 * Single review item.
 */
.repaf-review-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/**
 * Review field label.
 */
.repaf-review-label {
  color: var(--repaf-text-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/**
 * Review field value.
 */
.repaf-review-value {
  color: var(--repaf-text);
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

/**
 * Terms & confirmation area.
 */
.repaf-review-confirmation {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--repaf-border-soft);
  border-radius: var(--repaf-radius-md);
  background: var(--repaf-primary-soft);
}

/**
 * Terms checkbox row.
 */
.repaf-confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--repaf-primary-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.repaf-confirmation-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--repaf-primary);
}

/* ==========================================================================
   Mobile Review Layout
   ========================================================================== */

@media (max-width: 700px) {
  .repaf-review-card__header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .repaf-review-edit {
    width: 100%;
  }
}

/* ── Co-owner toggle (Step 5) ───────────────────────────── */
.repaf-co-owner-toggle {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--repaf-primary-soft);
  border: 1px solid var(--repaf-border);
  border-radius: var(--repaf-radius-md);
}

.repaf-co-owner-toggle .repaf-section-title {
  margin-top: 0;
}

.repaf-co-owner-toggle__question {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--repaf-text);
}

/* ============================================================
   Honeypot field — hidden from real users, visible to bots
   ============================================================
   Position off-screen rather than display:none so bots that
   skip display:none fields still encounter it.
   aria-hidden="true" keeps it out of the accessibility tree.
   ============================================================ */
.repaf-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Terms & Conditions Viewer + Read-Gate
   ========================================================================== */

.repaf-terms-section {
  margin-bottom: 28px;
}

.repaf-terms-heading {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--repaf-text, #1a1a2e);
}

.repaf-terms-instruction {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--repaf-text-soft, #6b7280);
}

.repaf-terms-viewer {
  width: 100%;
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--repaf-border, #e5e7eb);
  border-radius: var(--repaf-radius-sm, 6px);
  background: #f9f9f9;
  margin-bottom: 14px;
  scroll-behavior: smooth;
}

.repaf-terms-image {
  width: 100%;
  display: block;
  user-select: none;
}

.repaf-terms-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--repaf-text, #1a1a2e);
  cursor: pointer;
}

.repaf-terms-confirm-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--repaf-primary, #1a6cff);
}

/* Locked signature field */
.repaf-sig-locked .repaf-file-btn,
.repaf-file-btn--disabled {
  background: var(--repaf-border, #e5e7eb) !important;
  color: var(--repaf-text-soft, #9ca3af) !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

.repaf-sig-locked-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--repaf-error, #dc2626);
}

/* ==========================================================================
   Signature Upload Field
   ========================================================================== */

.repaf-field-hint {
  margin: 0;
  color: var(--repaf-text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.repaf-file-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.repaf-file-btn {
  display: inline-block;
  padding: 9px 18px;
  background: var(--repaf-primary);
  color: #ffffff;
  border-radius: var(--repaf-radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  user-select: none;
}

.repaf-file-btn:hover {
  background: var(--repaf-primary-dark);
}

/* Visually hide the native file input while keeping it accessible */
.repaf-file-wrapper input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.repaf-file-status {
  color: var(--repaf-text-soft);
  font-size: 13px;
  word-break: break-all;
}

.repaf-file-status.has-file {
  color: var(--repaf-success);
  font-weight: 700;
}

/* ==========================================================================
   Form Submission Loading Overlay
   ========================================================================== */

#repaf-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.82);
  align-items: center;
  justify-content: center;
}

#repaf-loading-overlay.is-visible {
  display: flex;
}

.repaf-loading-box {
  background: #fff;
  border-radius: 12px;
  padding: 36px 48px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.14);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 340px;
  width: 90%;
}

.repaf-loading-box p {
  margin: 0;
  font-size: 15px;
  color: var(--repaf-text, #1a1a2e);
  line-height: 1.65;
}

.repaf-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--repaf-border, #e5e7eb);
  border-top-color: var(--repaf-primary, #1a6cff);
  border-radius: 50%;
  animation: repaf-spin 0.7s linear infinite;
}

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

/* ==========================================================================
   Status Notices (success / error)
   ========================================================================== */

.repaf-status {
  margin-bottom: 28px;
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.6;
}

.repaf-status--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Success card */
.repaf-status--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--repaf-text, #1a1a2e);
  text-align: center;
  padding: 40px 32px;
}

.repaf-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 20px;
  line-height: 1;
}

.repaf-success-title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  color: #15803d;
}

.repaf-success-body {
  margin: 0 0 12px;
  font-size: 15px;
  color: #374151;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.repaf-success-note {
  margin: 20px auto 0;
  font-size: 14px;
  font-weight: 700;
  color: #15803d;
  max-width: 420px;
}

/* ==========================================================================
   Success Modal (shown after successful form submission)
   ========================================================================== */

.repaf-success-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.repaf-success-modal.is-visible {
  display: flex;
}

.repaf-success-modal__box {
  background: #ffffff;
  border-radius: 16px;
  padding: 44px 40px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: repaf-modal-in 0.28s ease;
}

@keyframes repaf-modal-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.repaf-success-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.repaf-success-modal__title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: #15803d;
}

.repaf-success-modal__subtitle {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--repaf-text, #1f2937);
}

.repaf-success-modal__body {
  margin: 0 0 12px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
}

.repaf-success-modal__note {
  margin: 8px 0 28px;
  font-size: 13px;
  font-weight: 700;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 16px;
  width: 100%;
}

.repaf-success-modal__btn {
  display: inline-block;
  padding: 13px 32px;
  background: var(--repaf-primary, #c2187a);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition:
    background 0.2s,
    transform 0.15s;
}

.repaf-success-modal__btn:hover {
  background: var(--repaf-primary-dark, #9c145f);
  transform: translateY(-1px);
  color: #ffffff;
}

@media (max-width: 520px) {
  .repaf-success-modal__box {
    padding: 32px 24px 28px;
  }

  .repaf-success-modal__title {
    font-size: 20px;
  }
}

/* ==========================================================
   Financial Information Step (Step 8)
   ========================================================== */

.repaf-fin-section {
  margin-bottom: 32px;
}

.repaf-fin-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--repaf-text);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--repaf-border);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.repaf-fin-heading .repaf-fin-note {
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  color: var(--repaf-text-soft);
  margin-left: 6px;
}

/* ---- Income Table ---- */

.repaf-fin-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.repaf-fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

.repaf-fin-table th,
.repaf-fin-table td {
  padding: 6px 8px;
  border: 1px solid var(--repaf-border);
  vertical-align: middle;
}

.repaf-fin-table thead th {
  background: var(--repaf-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.repaf-fin-table .repaf-fin-col-source {
  width: 22%;
  font-weight: 600;
  color: var(--repaf-text);
}

.repaf-fin-table .repaf-fin-col-amount {
  width: 20%;
}

.repaf-fin-table .repaf-fin-col-spouse,
.repaf-fin-table .repaf-fin-col-co {
  width: 20%;
}

.repaf-fin-row-bold td {
  background: #fef9ec;
}

.repaf-fin-table .repaf-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

.repaf-fin-prefix {
  font-size: 13px;
  color: var(--repaf-text-soft);
  flex-shrink: 0;
}

.repaf-fin-monthly {
  font-size: 11px;
  color: var(--repaf-text-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.repaf-fin-amount {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--repaf-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--repaf-text);
  background: #fff;
}

.repaf-fin-amount:focus {
  outline: none;
  border-color: var(--repaf-primary);
  box-shadow: 0 0 0 3px rgba(194, 24, 122, 0.12);
}

.repaf-fin-amount[readonly] {
  background: #f5f5f5;
  cursor: default;
  color: var(--repaf-text-soft);
}

.repaf-fin-other-source {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--repaf-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--repaf-text);
  background: #fff;
}

.repaf-fin-other-source:focus {
  outline: none;
  border-color: var(--repaf-primary);
  box-shadow: 0 0 0 3px rgba(194, 24, 122, 0.12);
}

/* ---- Dynamic Row Sections (Banks, Loans, Refs) ---- */

.repaf-fin-row-header {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  background: var(--repaf-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px 6px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.repaf-fin-row {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--repaf-border);
  border-top: none;
  align-items: flex-start;
  background: #fff;
}

.repaf-fin-row:last-child {
  border-radius: 0 0 6px 6px;
}

.repaf-fin-row .repaf-field {
  flex: 1;
  min-width: 0;
}

.repaf-fin-row .repaf-field input {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--repaf-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--repaf-text);
  background: #fff;
}

.repaf-fin-row .repaf-field input:focus {
  outline: none;
  border-color: var(--repaf-primary);
  box-shadow: 0 0 0 3px rgba(194, 24, 122, 0.12);
}

/* Bank row column widths */
.repaf-fin-col-bank-name {
  flex: 2;
}
.repaf-fin-col-bank-type {
  flex: 1.5;
}
.repaf-fin-col-bank-date {
  flex: 1.5;
}
.repaf-fin-col-bank-balance {
  flex: 1.5;
}

/* Header spans match row flex proportions */
.repaf-fin-banks-header .repaf-fin-col-bank-name {
  flex: 2;
}
.repaf-fin-banks-header .repaf-fin-col-bank-type {
  flex: 1.5;
}
.repaf-fin-banks-header .repaf-fin-col-bank-date {
  flex: 1.5;
}
.repaf-fin-banks-header .repaf-fin-col-bank-balance {
  flex: 1.5;
}

/* Loan row column widths */
.repaf-fin-col-loan-type {
  flex: 1.2;
}
.repaf-fin-col-loan-bank {
  flex: 1.5;
}
.repaf-fin-col-loan-contact {
  flex: 1.2;
}
.repaf-fin-col-loan-original {
  flex: 1;
}
.repaf-fin-col-loan-outstanding {
  flex: 1;
}
.repaf-fin-col-loan-amort {
  flex: 1;
}
.repaf-fin-col-loan-collateral {
  flex: 1.2;
}

.repaf-fin-loans-header .repaf-fin-col-loan-type {
  flex: 1.2;
}
.repaf-fin-loans-header .repaf-fin-col-loan-bank {
  flex: 1.5;
}
.repaf-fin-loans-header .repaf-fin-col-loan-contact {
  flex: 1.2;
}
.repaf-fin-loans-header .repaf-fin-col-loan-original {
  flex: 1;
}
.repaf-fin-loans-header .repaf-fin-col-loan-outstanding {
  flex: 1;
}
.repaf-fin-loans-header .repaf-fin-col-loan-amort {
  flex: 1;
}
.repaf-fin-loans-header .repaf-fin-col-loan-collateral {
  flex: 1.2;
}

/* Reference row column widths */
.repaf-fin-col-ref-name {
  flex: 1.5;
}
.repaf-fin-col-ref-address {
  flex: 2;
}
.repaf-fin-col-ref-email {
  flex: 1.5;
}
.repaf-fin-col-ref-contact {
  flex: 1.2;
}

.repaf-fin-refs-header .repaf-fin-col-ref-name {
  flex: 1.5;
}
.repaf-fin-refs-header .repaf-fin-col-ref-address {
  flex: 2;
}
.repaf-fin-refs-header .repaf-fin-col-ref-email {
  flex: 1.5;
}
.repaf-fin-refs-header .repaf-fin-col-ref-contact {
  flex: 1.2;
}

/* Remove button column */
.repaf-fin-col-remove {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.repaf-fin-banks-header .repaf-fin-col-remove,
.repaf-fin-loans-header .repaf-fin-col-remove,
.repaf-fin-refs-header .repaf-fin-col-remove {
  flex: 0 0 32px;
}

.repaf-fin-remove {
  width: 28px;
  height: 28px;
  border: 1px solid #fca5a5;
  border-radius: 50%;
  background: #fff;
  color: #dc2626;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
}

.repaf-fin-remove:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.repaf-fin-add-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--repaf-primary-soft, #fff1f7);
  border: 1px solid var(--repaf-border);
  border-radius: 8px;
  color: var(--repaf-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.repaf-fin-add-btn:hover:not(:disabled) {
  background: var(--repaf-primary);
  color: #fff;
  border-color: var(--repaf-primary);
}

.repaf-fin-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.repaf-fin-limit-note {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--repaf-text-soft);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .repaf-fin-row {
    flex-wrap: wrap;
  }

  .repaf-fin-row .repaf-field,
  .repaf-fin-col-bank-name,
  .repaf-fin-col-bank-type,
  .repaf-fin-col-bank-date,
  .repaf-fin-col-bank-balance,
  .repaf-fin-col-loan-type,
  .repaf-fin-col-loan-bank,
  .repaf-fin-col-loan-contact,
  .repaf-fin-col-loan-original,
  .repaf-fin-col-loan-outstanding,
  .repaf-fin-col-loan-amort,
  .repaf-fin-col-loan-collateral,
  .repaf-fin-col-ref-name,
  .repaf-fin-col-ref-address,
  .repaf-fin-col-ref-email,
  .repaf-fin-col-ref-contact {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
  }

  .repaf-fin-row-header {
    display: none;
  }

  .repaf-fin-col-remove {
    flex: 0 0 100%;
    justify-content: flex-end;
  }
}

/* ============================================================
 * Salesperson-only steps (buyer mode)
 * ============================================================ */

.repaf-step--sp-only .repaf-field input,
.repaf-step--sp-only .repaf-field select,
.repaf-step--sp-only .repaf-field textarea,
.repaf-step--sp-only fieldset input,
.repaf-step--sp-only fieldset select,
.repaf-step--sp-only fieldset textarea {
  background: #f5f5f5;
  color: #aaa;
  cursor: not-allowed;
  border-color: #ddd;
  pointer-events: none;
}

.repaf-step--sp-only .repaf-radio-group label {
  cursor: not-allowed;
  color: #aaa;
}

.repaf-sp-only-banner {
  background: #f0f4ff;
  border: 1px solid #c5d0f5;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #3d5a99;
  font-weight: 500;
}

/* ============================================================
 * Edit mode — header badge
 * ============================================================ */

.repaf-edit-mode-badge {
  display: inline-block;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  color: #856404;
  font-weight: 600;
  margin-top: 6px;
}

/* ============================================================
 * Property / salesperson step layout
 * ============================================================ */

.repaf-step .repaf-fieldset {
  border: 1px solid var(--repaf-border, #f3c5dc);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: var(--repaf-bg-soft, #fff8fc);
}

.repaf-step .repaf-fieldset legend {
  font-weight: 600;
  color: var(--repaf-primary, #c2187a);
  padding: 0 8px;
  font-size: 14px;
}

.repaf-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.repaf-field-row .repaf-field {
  flex: 1 1 200px;
  min-width: 0;
}

.repaf-discount-options {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.repaf-inline-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: normal;
  cursor: pointer;
}

.repaf-field--conditional {
  display: none;
}

.repaf-field--conditional.is-visible {
  display: block;
}

/* ============================================================
 * Financial step — mobile layout (≤ 640px)
 * ============================================================ */

@media (max-width: 640px) {

  /* ---- A. Income table — card layout ---- */

  .repaf-fin-table-wrapper {
    overflow-x: visible;
  }

  .repaf-fin-table {
    min-width: 0;
    display: block;
  }

  .repaf-fin-table thead {
    display: none;
  }

  .repaf-fin-table tbody {
    display: block;
  }

  .repaf-fin-table tbody tr {
    display: block;
    border: 1px solid var(--repaf-border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
  }

  .repaf-fin-table tbody tr:last-child {
    margin-bottom: 0;
  }

  /* Source cell = dark card title */
  .repaf-fin-table tbody td.repaf-fin-col-source {
    display: block;
    background: var(--repaf-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 8px 12px;
    border: none;
    width: auto;
  }

  .repaf-fin-row-bold td.repaf-fin-col-source {
    background: var(--repaf-primary-dark, #1a4731);
  }

  /* Amount cells = label + input row */
  .repaf-fin-table tbody td:not(.repaf-fin-col-source) {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--repaf-border-soft);
    background: #fff;
    width: auto;
  }

  .repaf-fin-row-bold td:not(.repaf-fin-col-source) {
    background: #fef9ec;
  }

  .repaf-fin-table tbody td:last-child {
    border-bottom: none;
  }

  /* Column label via nth-child content */
  .repaf-fin-table tbody td:nth-child(2)::before { content: "Borrower"; }
  .repaf-fin-table tbody td:nth-child(3)::before { content: "Spouse"; }
  .repaf-fin-table tbody td:nth-child(4)::before { content: "Co-Borrower"; }
  .repaf-fin-table tbody td:nth-child(5)::before { content: "Total"; }

  .repaf-fin-table tbody td:not(.repaf-fin-col-source)::before {
    min-width: 84px;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--repaf-text-soft);
  }

  /* Input group fills remaining space */
  .repaf-fin-table .repaf-field {
    flex: 1;
    min-width: 0;
  }

  /* ---- B, C, D. Dynamic rows (banks / loans / refs) ---- */

  .repaf-fin-row-header {
    display: none;
  }

  .repaf-fin-row {
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--repaf-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
  }

  .repaf-fin-row:last-child {
    border-radius: 8px;
    margin-bottom: 0;
  }

  /* Reset flex proportions — all fields go full width */
  .repaf-fin-row .repaf-field,
  .repaf-fin-col-bank-name,
  .repaf-fin-col-bank-type,
  .repaf-fin-col-bank-date,
  .repaf-fin-col-bank-balance,
  .repaf-fin-col-loan-type,
  .repaf-fin-col-loan-bank,
  .repaf-fin-col-loan-contact,
  .repaf-fin-col-loan-original,
  .repaf-fin-col-loan-outstanding,
  .repaf-fin-col-loan-amort,
  .repaf-fin-col-loan-collateral,
  .repaf-fin-col-ref-name,
  .repaf-fin-col-ref-address,
  .repaf-fin-col-ref-email,
  .repaf-fin-col-ref-contact {
    flex: none;
    width: 100%;
  }

  .repaf-fin-col-remove {
    flex: none;
    width: auto;
    align-self: flex-end;
  }
}

@media (max-width: 600px) {
  .repaf-field-row {
    flex-direction: column;
  }

  /* Reset flex-basis so fields don't inherit a 200px min-height in column mode */
  .repaf-field-row .repaf-field {
    flex: none;
    width: 100%;
  }
}

/* Remove number input spinners */
.repaf-wizard input[type="number"]::-webkit-inner-spin-button,
.repaf-wizard input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.repaf-wizard input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
