/**
 * credit-phase-one.css
 * Custom styles for Phase 1 Business Credit Foundation Wizard
 * Enhances WowDash base styles for a polished BAE experience
 */

/* ========================================================================
   STEP INDICATOR (Labeled Stepper)
   ======================================================================== */
.phase1-stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 0.5rem 0;
}

.phase1-stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.phase1-stepper-item.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.phase1-stepper-item:not(.disabled):hover .phase1-stepper-circle {
  transform: scale(1.1);
}

.phase1-stepper-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  background-color: #f0f0f0;
  color: #666;
  border: 2px solid #ddd;
  transition: all 0.2s ease;
  z-index: 2;
  position: relative;
}

.phase1-stepper-item.active .phase1-stepper-circle {
  background-color: var(--bs-primary, #0d6efd);
  color: white;
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.phase1-stepper-item.completed .phase1-stepper-circle {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
}

.phase1-stepper-label {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
  color: #666;
  max-width: 80px;
  line-height: 1.2;
}

.phase1-stepper-item.active .phase1-stepper-label {
  color: var(--bs-primary, #0d6efd);
  font-weight: 600;
}

.phase1-stepper-item.completed .phase1-stepper-label {
  color: #28a745;
  font-weight: 500;
}

/* Connector line between steps */
.phase1-stepper-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(50% + 25px);
  width: calc(100% - 50px);
  height: 2px;
  background-color: #ddd;
  z-index: 1;
}

.phase1-stepper-item.completed:not(:last-child)::after {
  background-color: #28a745;
}

/* ========================================================================
   FORM FIELDS & VALIDATION
   ======================================================================== */
.form-section-heading {
  font-size: 0.95rem;
  color: #6c757d;
  margin-bottom: 1rem;
  font-weight: 500;
}

.icon-field {
  position: relative;
  display: flex;
  align-items: center;
}

.icon-field .icon {
  position: absolute;
  left: 12px;
  color: #6c757d;
  pointer-events: none;
  z-index: 3;
  font-size: 1.1rem;
}

.icon-field input,
.icon-field select {
  padding-left: 38px;
}

/* Validation states */
.form-control.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
}

.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Help text */
.form-text {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* Required field indicator */
.text-danger {
  color: #dc3545 !important;
}

/* ========================================================================
   CHECKLIST SIDEBAR
   ======================================================================== */
#phase1-checklist .list-group-item {
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

#phase1-checklist .list-group-item:hover {
  background-color: #f8f9fa;
  border-left-color: var(--bs-primary, #0d6efd);
}

#phase1-checklist .list-group-item.active {
  background-color: rgba(13, 110, 253, 0.1);
  border-left-color: var(--bs-primary, #0d6efd);
  color: var(--bs-primary, #0d6efd);
}

#phase1-checklist .list-group-item iconify-icon {
  font-size: 1.2rem;
}

/* ========================================================================
   BANKING STEP CONDITIONAL FIELDS
   ======================================================================== */
#banking-fields-container {
  transition: opacity 0.3s ease, max-height 0.3s ease;
  overflow: hidden;
}

#banking-fields-container.hidden {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

/* ========================================================================
   ALERTS & NOTIFICATIONS
   ======================================================================== */
.alert-concierge {
  background-color: #e7f3ff;
  border-color: #b3d9ff;
  color: #004085;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.alert-concierge iconify-icon {
  font-size: 1.2rem;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* ========================================================================
   RESPONSIVE ADJUSTMENTS
   ======================================================================== */
@media (max-width: 767px) {
  /* Stack stepper vertically on mobile */
  .phase1-stepper {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .phase1-stepper-item {
    flex-direction: row;
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .phase1-stepper-item:not(:last-child)::after {
    display: none;
  }
  
  .phase1-stepper-label {
    margin-top: 0;
    margin-left: 1rem;
    text-align: left;
    max-width: none;
  }
  
  /* Hide sidebar on mobile, show as accordion or tabs */
  #phase1-checklist {
    font-size: 0.875rem;
  }
}

/* ========================================================================
   BUTTON STATES
   ======================================================================== */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn .spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* ========================================================================
   STEP CONTENT TRANSITIONS
   ======================================================================== */
#phase1-step-container {
  min-height: 300px;
  transition: opacity 0.2s ease;
}

#phase1-step-container.loading {
  opacity: 0.5;
}
