/* ==========================================================================
   REGISTRATION FORM ("FOMU YA MWANAKIKUNDI") STYLES
   ========================================================================== */

.form-app-wrapper {
  padding-top: calc(72px + 2rem);
  padding-bottom: 5rem;
}

.registration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
  position: relative;
  overflow: hidden;
}

/* Stepper Header */
.stepper-header {
  margin-bottom: 3rem;
}

.stepper-brand-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.stepper-titles h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.stepper-titles h2 {
  font-size: 0.95rem;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stepper-indicator-bar {
  position: relative;
  margin-top: 1.5rem;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

[data-theme="light"] .progress-track {
  background: rgba(0, 0, 0, 0.08);
}

.progress-fill {
  height: 100%;
  width: 20%;
  background: var(--color-primary-gradient);
  box-shadow: 0 0 12px var(--color-primary-glow);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stepper-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: all var(--transition-fast);
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
  transition: all var(--transition-smooth);
}

.step-node.active .step-circle {
  background: var(--color-primary);
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 0 20px var(--color-primary-glow);
  transform: scale(1.12);
}

.step-node.completed .step-circle {
  background: var(--color-accent);
  border-color: #34d399;
  color: #ffffff;
}

.step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  max-width: 90px;
  transition: color var(--transition-fast);
}

.step-node.active .step-label {
  color: var(--text-primary);
  font-weight: 700;
}

.step-node.completed .step-label {
  color: var(--color-accent);
}

/* Step Content Section */
.form-step-pane {
  display: none;
  animation: stepFadeIn 0.35s ease forwards;
}

.form-step-pane.active {
  display: block;
}

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

.step-intro-banner {
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.1rem 1.4rem;
  margin-bottom: 2rem;
}

.step-intro-banner h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.step-intro-banner p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Passport Photo Upload Zone */
.photo-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.passport-dropzone {
  width: 190px;
  height: 230px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.passport-dropzone:hover,
.passport-dropzone.drag-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 25px var(--color-primary-glow);
  transform: translateY(-2px);
}

.passport-dropzone .file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dropzone-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.dropzone-placeholder svg {
  color: var(--color-primary);
  opacity: 0.85;
}

.dropzone-placeholder span {
  font-size: 0.88rem;
  font-weight: 600;
}

.dropzone-placeholder small {
  font-size: 0.72rem;
  opacity: 0.7;
}

.passport-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 5;
}

.btn-remove-photo {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--color-danger);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 15;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast);
}

.btn-remove-photo:hover {
  background: var(--color-danger-hover);
}

/* Dependents Management (Step 3) */
.dependents-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dependent-entry-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  animation: stepFadeIn 0.3s ease;
}

.dependent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dependent-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-remove-dependent {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-remove-dependent:hover {
  background: var(--color-danger);
  color: #ffffff;
}

.dependent-photo-box {
  width: 140px;
  height: 170px;
}

/* Data Tables (Step 4) */
.table-responsive-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  margin-bottom: 2rem;
}

.form-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.form-data-table th,
.form-data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.form-data-table th {
  background: rgba(15, 23, 42, 0.95);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

[data-theme="light"] .form-data-table th {
  background: #f1f5f9;
}

.form-data-table input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px dashed var(--border-medium);
  padding: 0.5rem 0.4rem;
  color: var(--text-primary);
  border-radius: 0;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-data-table input:focus {
  border-bottom: 2px solid var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
}

/* Step 5: Declaration & Digital Signature */
.declaration-callout {
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.declaration-callout p {
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-primary);
}

.signature-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.signature-pad-card {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  touch-action: none;
}

.signature-canvas {
  width: 100%;
  height: 200px;
  display: block;
  cursor: crosshair;
  touch-action: none !important;
}

.signature-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 540px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Navigation Step Actions Buttons */
.form-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2.5rem;
  gap: 1rem;
}

/* Success Card After Submission */
.success-card {
  text-align: center;
  padding: 3.5rem 2.5rem;
}

.success-badge-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  box-shadow: 0 10px 30px var(--color-accent-glow);
  animation: victoryBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes victoryBounce {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.success-sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Payment Instructions Receipt Box */
.payment-receipt-box {
  max-width: 560px;
  margin: 0 auto 2.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: left;
  box-shadow: var(--shadow-md);
}

.receipt-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .receipt-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt-row .label {
  color: var(--text-muted);
}

.receipt-row .value {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-copy-num {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-num:hover {
  background: var(--color-primary);
  color: #ffffff;
}

/* Helper Classes to eliminate inline styles */
.fomu-header-box {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.fomu-grid-start {
  align-items: start;
}

.fomu-label-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.fomu-hint-center {
  text-align: center;
  margin-top: 0.6rem;
}

.fomu-banner-mt {
  margin-top: 2rem;
}

.fomu-sig-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.fomu-sig-date-box {
  width: 100%;
  max-width: 320px;
  margin-top: 1rem;
}

.fomu-fee-val {
  color: var(--color-accent);
  font-size: 1.15rem;
}

.fomu-success-info-box {
  max-width: 560px;
  margin: 0 auto 2.5rem;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background: rgba(59, 130, 246, 0.08);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
}

.fomu-success-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-scroll-hint {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   Responsive & Mobile Phone Optimization (<768px, <640px, <480px)
   ========================================================================== */
@media (max-width: 768px) {
  .form-app-wrapper {
    padding-top: calc(64px + 1.5rem);
    padding-bottom: 3.5rem;
  }

  .registration-card {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
  }

  .stepper-header {
    margin-bottom: 2rem;
  }

  .stepper-brand-block {
    margin-bottom: 1.5rem;
    gap: 0.75rem;
  }

  .stepper-titles h1 {
    font-size: 1.55rem;
  }

  .stepper-titles h2 {
    font-size: 0.85rem;
  }

  .step-label {
    display: none;
  }

  .step-circle {
    width: 38px;
    height: 38px;
    font-size: 0.92rem;
  }

  .step-node.active .step-circle {
    transform: scale(1.08);
  }

  .form-step-actions {
    flex-direction: column-reverse;
    gap: 0.85rem;
    padding-top: 1.5rem;
    margin-top: 1.75rem;
  }

  .form-step-actions .btn {
    width: 100% !important;
    min-height: 50px;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
  }

  .table-scroll-hint {
    display: flex;
  }

  .table-responsive-wrapper {
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .form-data-table {
    min-width: 560px;
  }

  .declaration-callout {
    padding: 1.25rem 1rem;
  }

  .declaration-callout p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .signature-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    text-align: center;
  }

  .signature-actions-row .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .fomu-sig-date-box {
    max-width: 100%;
  }

  .success-card {
    padding: 2.5rem 1.25rem;
  }

  .success-title {
    font-size: 1.75rem;
  }

  .payment-receipt-box {
    padding: 1.5rem 1.25rem;
  }

  .fomu-success-actions {
    flex-direction: column;
    gap: 0.85rem;
  }

  .fomu-success-actions .btn {
    width: 100% !important;
    min-height: 50px;
    justify-content: center;
    font-size: 0.98rem;
  }
}

@media (max-width: 480px) {
  .registration-card {
    padding: 1.25rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .fomu-header-box {
    gap: 0.75rem;
  }

  .fomu-header-box .brand-logo-img {
    width: 44px;
    height: 44px;
  }

  .stepper-titles h1 {
    font-size: 1.3rem;
  }

  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }

  .step-intro-banner {
    padding: 0.9rem 1rem;
    margin-bottom: 1.5rem;
  }

  .step-intro-banner h3 {
    font-size: 1.1rem;
  }

  .passport-dropzone {
    width: 165px;
    height: 205px;
  }

  .signature-canvas {
    height: 175px;
  }

  .dependent-entry-card {
    padding: 1rem 0.85rem;
  }

  .receipt-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.75rem 0;
  }

  .receipt-row .value {
    width: 100%;
    justify-content: space-between;
  }
}

