/* ─── LOAN FORM WIZARD STYLES ───────────────────────────────── */

/* Wizard Container & Transitions */
.wizard-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

@media(max-width: 575.98px) {
  .wizard-card {
    padding: 24px 16px;
  }
}

/* Stepper Progress Bar */
.stepper-wrapper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 32px;
  padding: 0 10px;
}

.stepper-wrapper::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gray-200);
  z-index: 1;
}

.stepper-progress {
  position: absolute;
  top: 15px;
  left: 0;
  height: 3px;
  background: var(--primary);
  z-index: 2;
  transition: width 0.4s ease;
  width: 0%;
}

.stepper-item {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stepper-item .step-counter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-600);
  transition: all 0.3s ease;
}

.stepper-item .step-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  margin-top: 6px;
  text-align: center;
  display: none; /* Hidden on small screens, shown on active or large screen */
}

@media(min-width: 768px) {
  .stepper-item .step-name {
    display: block;
  }
}

.stepper-item.active .step-counter {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.15);
}

.stepper-item.active .step-name {
  color: var(--primary);
  display: block;
}

.stepper-item.completed .step-counter {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

/* Step content visibility */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeInStep 0.4s ease-in-out;
}

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

/* Step Header */
.step-header {
  margin-bottom: 24px;
}

.step-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-subtitle {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 4px;
}

/* Form layouts */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media(min-width: 576px) {
  .form-grid.two-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

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

/* Autocomplete Suggestion Box */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-items {
  position: absolute;
  border: 1px solid var(--gray-200);
  border-top: none;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--white);
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-md);
}

.autocomplete-item {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
  transition: background 0.15s;
}

.autocomplete-item:hover {
  background-color: var(--gray-100);
}

.autocomplete-item strong {
  color: var(--primary);
}

/* Verification Overlay */
.otp-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.otp-input {
  width: 48px;
  height: 52px;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
}

.otp-input:focus {
  border-color: var(--primary);
  background: var(--white);
}

/* Timer and Resend Button */
.resend-container {
  text-align: center;
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 12px;
}

.resend-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.resend-btn:disabled {
  color: var(--gray-200);
  cursor: not-allowed;
  text-decoration: none;
}

/* Gender and Selection Pill Boxes */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.selection-pill {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  background: var(--gray-50);
  transition: all 0.2s;
}

.selection-pill:hover {
  border-color: var(--primary);
}

.selection-pill.active {
  background: rgba(26, 86, 219, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}

/* Slider Controls */
.slider-container {
  padding: 10px 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.slider-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
}

.slider-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.custom-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: var(--gray-200);
  outline: none;
  margin: 12px 0;
}

.custom-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.25);
}

.custom-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-limits {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 600;
}

/* File Upload drag-and-drop zone */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(26, 86, 219, 0.02);
}

.upload-icon {
  font-size: 28px;
  color: var(--primary);
}

.upload-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.upload-text span {
  color: var(--primary);
  text-decoration: underline;
}

.upload-hint {
  font-size: 11px;
  color: var(--gray-600);
}

.upload-status-bar {
  width: 100%;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
  display: none;
}

.upload-progress {
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 0.3s;
}

.upload-success {
  display: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.upload-success.active {
  display: flex;
}

/* Action Navigation Buttons */
.wizard-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
}

.wizard-actions .btn {
  flex: 1;
  padding: 16px;
  font-size: 16px;
  border-radius: 8px;
}

.wizard-actions .btn-back {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  flex: 0 0 100px;
}

.wizard-actions .btn-back:hover {
  background: var(--gray-50);
  border-color: var(--gray-600);
}

.wizard-actions .btn-next {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
}

.wizard-actions .btn-next:hover {
  background: var(--accent-dark);
}

.wizard-actions .btn-next:disabled {
  background: var(--gray-200);
  color: var(--gray-600);
  cursor: not-allowed;
  box-shadow: none;
}

/* Validation & Feedback alert messages */
.validation-error {
  color: #DC2626;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  display: none;
}

.validation-error.active {
  display: block;
}

input.is-invalid, select.is-invalid {
  border-color: #DC2626;
}

.wizard-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  display: none;
}

.wizard-alert.alert-error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

.wizard-alert.alert-success {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
}

.wizard-alert.active {
  display: block;
}

/* Loading Spinners */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
  display: none;
  vertical-align: text-bottom;
  border: .15em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

.loading .spinner-border-sm {
  display: inline-block;
}

/* Summary screen check marks */
.success-screen {
  text-align: center;
  padding: 30px 10px;
}

.success-check-icon {
  font-size: 64px;
  color: var(--green);
  margin-bottom: 16px;
}
