/* ==========================================================================
   NEXUS POS — Onboarding Wizard
   Uses design system tokens (works with both industrial + modern themes)
   ========================================================================== */

/* Overlay backdrop */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-backdrop);
  opacity: 0;
  animation: onb-fade-in var(--duration-normal) var(--ease-out) forwards;
}

@keyframes onb-fade-in {
  to { opacity: 1; }
}

/* Modal card */
.onboarding-modal {
  width: 92vw;
  max-width: 500px;
  max-height: 90vh;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  animation: onb-slide-up var(--duration-normal) var(--ease-out) forwards;
}

[data-theme="industrial"] .onboarding-modal {
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}

[data-theme="modern"] .onboarding-modal {
  border-radius: var(--radius-lg);
}

@keyframes onb-slide-up {
  to { transform: translateY(0); }
}

/* Step content area */
.onboarding-body {
  padding: var(--space-8) var(--space-6);
  overflow-y: auto;
  flex: 1;
}

/* Step icon */
.onb-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--color-primary-muted);
  color: var(--color-primary);
}

[data-theme="industrial"] .onb-icon {
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

[data-theme="modern"] .onb-icon {
  border-radius: var(--radius-lg);
}

/* Titles */
.onb-title {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight-primary);
  font-size: var(--text-h4);
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: var(--space-2);
  letter-spacing: var(--tracking-snug);
}

[data-theme="industrial"] .onb-title {
  text-transform: uppercase;
}

.onb-desc {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  text-align: center;
  line-height: var(--leading-body-sm);
  margin-bottom: var(--space-6);
}

/* Form fields inside wizard */
.onb-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.onb-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.onb-label {
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  letter-spacing: var(--tracking-wide);
}

[data-theme="industrial"] .onb-label {
  text-transform: uppercase;
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-wider);
}

.onb-input {
  height: 40px;
  padding: 0 var(--space-3);
  background: var(--color-bg-base);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  transition: var(--transition-fast);
  outline: none;
}

[data-theme="industrial"] .onb-input {
  border-radius: 0;
}

[data-theme="modern"] .onb-input {
  border-radius: var(--radius-md);
}

.onb-input:focus {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-focus);
}

.onb-input::placeholder {
  color: var(--color-text-muted);
}

.onb-select {
  height: 40px;
  padding: 0 var(--space-3);
  background: var(--color-bg-base);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  transition: var(--transition-fast);
  outline: none;
  cursor: pointer;
}

[data-theme="industrial"] .onb-select {
  border-radius: 0;
}

[data-theme="modern"] .onb-select {
  border-radius: var(--radius-md);
}

.onb-select:focus {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-focus);
}

/* Inline error */
.onb-error {
  font-size: var(--text-caption);
  color: var(--color-error);
  min-height: 18px;
  margin-top: var(--space-1);
}

/* Success message in step */
.onb-success {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-success-light);
  color: var(--color-success-dark);
  font-size: var(--text-body-sm);
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-3);
}

[data-theme="industrial"] .onb-success {
  border-radius: 0;
}

[data-theme="modern"] .onb-success {
  border-radius: var(--radius-md);
}

/* Footer: buttons + progress */
.onboarding-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--color-bg-elevated);
}

.onb-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Buttons */
.onb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 40px;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: var(--font-weight-semibold);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  letter-spacing: var(--tracking-wide);
}

[data-theme="industrial"] .onb-btn {
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  text-transform: uppercase;
}

[data-theme="modern"] .onb-btn {
  border-radius: var(--radius-md);
}

.onb-btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.onb-btn--primary:hover {
  background: var(--btn-primary-bg-hover);
}

.onb-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.onb-btn--secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--btn-secondary-border);
}

.onb-btn--secondary:hover {
  background: var(--btn-secondary-bg-hover);
}

.onb-btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

.onb-btn--ghost:hover {
  color: var(--color-text-primary);
}

/* Progress dots */
.onb-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.onb-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--color-border-strong);
  background: transparent;
  transition: var(--transition-normal);
}

[data-theme="industrial"] .onb-dot {
  border-radius: 0;
}

[data-theme="modern"] .onb-dot {
  border-radius: var(--radius-full);
}

.onb-dot.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.2);
}

.onb-dot.is-done {
  background: var(--color-primary-muted);
  border-color: var(--color-primary);
}

/* Step counter label */
.onb-step-label {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  text-align: center;
  letter-spacing: var(--tracking-wide);
}

/* "No mostrar de nuevo" checkbox row */
.onb-dismiss-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.onb-dismiss-row label {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  cursor: pointer;
}

.onb-dismiss-row input[type="checkbox"] {
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Final step link grid */
.onb-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.onb-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  background: var(--color-bg-base);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: var(--text-body-sm);
  font-weight: var(--font-weight-semibold);
  transition: var(--transition-fast);
}

[data-theme="industrial"] .onb-link-card {
  border-radius: 0;
}

[data-theme="modern"] .onb-link-card {
  border-radius: var(--radius-md);
}

.onb-link-card:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.onb-link-card span.onb-link-icon {
  font-size: 1.5rem;
}

/* Step transition */
.onb-step-enter {
  animation: onb-step-in var(--duration-normal) var(--ease-out) forwards;
}

@keyframes onb-step-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .onboarding-modal {
    width: 96vw;
    max-height: 95vh;
  }
  .onboarding-body {
    padding: var(--space-6) var(--space-4);
  }
  .onboarding-footer {
    padding: var(--space-3) var(--space-4);
  }
  .onb-links {
    grid-template-columns: 1fr;
  }
}
