/* Onboarding Wizard Styles - Xero-inspired */

/* Wizard Overlay */
.onboarding-wizard {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.onboarding-wizard.show {
  opacity: 1;
  visibility: visible;
}

.wizard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Wizard Container */
.wizard-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  margin: 1rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.onboarding-wizard.show .wizard-container {
  transform: scale(1);
}

/* Header */
.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.wizard-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
}

.wizard-logo i {
  color: #6b7280;
}

.wizard-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.wizard-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Progress */
.wizard-progress {
  padding: 1.5rem 2rem;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.progress-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-dot {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  color: #9ca3af;
  transition: all 0.3s;
}

.progress-step.active .step-dot {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.progress-step.completed .step-dot {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.step-label {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
  color: #374151;
}

/* Content */
.wizard-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.step-header {
  text-align: center;
  margin-bottom: 2rem;
}

.step-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.step-header p {
  color: #6b7280;
  font-size: 0.9375rem;
}

.step-header.success {
  padding: 2rem 0;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #10b981, #34d399);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon i {
  font-size: 2.5rem;
  color: white;
}

/* Customer Type Selection Cards */
.customer-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.customer-type-card {
  position: relative;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.customer-type-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.customer-type-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.customer-type-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 2rem;
}

.customer-type-icon.residential {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #2563eb;
}

.customer-type-icon.business {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
}

.customer-type-icon.both {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
}

.customer-type-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.customer-type-info p {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.customer-type-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.customer-type-examples span {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.25rem 0.625rem;
  border-radius: 50px;
}

.customer-type-card.selected .customer-type-examples span {
  background: #dbeafe;
  color: #1d4ed8;
}

.customer-type-check {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  background: #3b82f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.customer-type-card.selected .customer-type-check {
  opacity: 1;
  transform: scale(1);
}

/* Category Tabs */
.template-categories {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.category-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.category-tab:hover {
  border-color: #d1d5db;
  color: #374151;
}

.category-tab.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: white;
}

.category-tab.active i {
  color: white !important;
}

.tab-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

.category-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.2);
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.template-card {
  position: relative;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.template-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.template-card.popular {
  border-color: #f59e0b;
}

.popular-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 50px;
}

.template-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.template-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
}

.template-info p {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.template-price {
  margin-bottom: 1rem;
}

.template-price .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
}

.template-price .period {
  font-size: 0.875rem;
  color: #9ca3af;
}

.template-features {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.template-features .feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.template-features .feature i {
  color: #10b981;
  font-size: 0.875rem;
}

.no-templates {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #9ca3af;
}

/* Customize Form */
.selected-template-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.preview-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.25rem;
}

.preview-info {
  display: flex;
  flex-direction: column;
}

.preview-category {
  font-size: 0.625rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.05em;
}

.preview-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.customize-fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field-group {
  flex: 1;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.field-label .required {
  color: #ef4444;
}

.field-hint {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.375rem;
}

.field-section {
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.field-section h5 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

/* Created Product */
.created-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.created-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.5rem;
}

.created-info {
  flex: 1;
}

.created-info h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
}

.created-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.type-badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.created-check {
  font-size: 1.5rem;
}

/* Next Steps */
.next-steps h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  text-align: center;
}

.next-step-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.next-step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: #f9fafb;
  border-radius: 12px;
  text-decoration: none;
  color: #374151;
  transition: all 0.15s;
}

.next-step-card:hover {
  background: #f3f4f6;
  color: #1a1a1a;
  transform: translateY(-2px);
}

.next-step-card i {
  font-size: 1.5rem;
  color: #3b82f6;
}

.next-step-card span {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

/* Footer */
.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.wizard-footer .btn {
  display: inline-flex;
  align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
  .customer-type-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .customer-type-card {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 1.25rem;
    gap: 1rem;
  }

  .customer-type-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    margin: 0;
    font-size: 1.5rem;
  }

  .customer-type-info {
    flex: 1;
  }

  .customer-type-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
  }

  .customer-type-info p {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
  }

  .customer-type-examples {
    justify-content: flex-start;
  }

  .customer-type-check {
    top: 50%;
    transform: translateY(-50%) scale(0.5);
    right: 0.75rem;
  }

  .customer-type-card.selected .customer-type-check {
    transform: translateY(-50%) scale(1);
  }
}

@media (max-width: 640px) {
  .wizard-container {
    margin: 0;
    max-height: 100vh;
    border-radius: 0;
  }

  .wizard-content {
    padding: 1.5rem;
  }

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

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

  .next-step-cards {
    grid-template-columns: 1fr;
  }

  .progress-steps {
    display: none;
  }
}

@media (max-width: 480px) {
  .wizard-header {
    padding: 1rem;
  }

  .wizard-content {
    padding: 1rem;
  }

  .wizard-content h2 {
    font-size: 1.25rem;
  }

  .wizard-content p {
    font-size: 0.875rem;
  }

  .wizard-footer {
    padding: 1rem;
    gap: 0.5rem;
  }

  .wizard-footer .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }

  .customer-type-card {
    padding: 1rem;
  }

  .customer-type-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 1.25rem;
  }

  .customer-type-info h3 {
    font-size: 1rem;
  }

  .template-card {
    padding: 1rem;
  }
}
