/**
 * Tex Notas — Estilização do Onboarding Guiado (Wizard)
 * Design Level Apple/Vercel (Glassmorphism, Transições suaves)
 */

/* Container Principal (Túnel) */
.onboarding-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-body);
  position: relative;
  overflow: hidden;
}

/* Bolhas de Fundo Decorativas (Glassmorphism effect) */
.onboarding-container::before,
.onboarding-container::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}
.onboarding-container::before {
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: rgba(37, 99, 235, 0.15); /* primary */
}
.onboarding-container::after {
  bottom: -100px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: rgba(16, 185, 129, 0.1); /* emerald */
}

/* Header do Onboarding (Compacto — Zero Scroll) */
.onboarding-header {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 8px;
  text-align: center;
}

/* Logo — Alternância Light / Dark automática */
.onboarding-logo {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-logo img {
  height: 32px;
  width: auto;
}
/* Modo claro: mostra logo colorida, esconde branca */
html.light .onb-logo-light { display: block; }
html.light .onb-logo-dark  { display: none;  }
/* Modo escuro: mostra logo branca, esconde colorida */
html.dark .onb-logo-light  { display: none;  }
html.dark .onb-logo-dark   { display: block; }
/* Fallback (sem classe no html) */
.onb-logo-light { display: block; }
.onb-logo-dark  { display: none;  }

.onboarding-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.onboarding-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 480px;
}

/* Card Único de Contexto da Empresa (SSoT - Compacto) */
.onb-company-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  text-align: left;
  max-width: 520px;
}

.onb-company-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #1D4ED8);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onb-company-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.onb-company-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onb-company-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.onb-meta-divider {
  opacity: 0.4;
}

/* Stepper Moderno Vercel/Linear Level (Zero poluição de bordas) */
.stepper-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 14px 0 18px;
  width: 100%;
  max-width: 480px;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.3s ease, font-weight 0.3s ease;
  white-space: nowrap;
}

/* Linha contínua por trás do Stepper */
.stepper-container::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.step-line {
  display: none; /* Substituído pelo trilho contínuo */
}

/* Estados do Stepper (Ativo / Concluído) */
.step-indicator.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.18);
}
.step-indicator.active .step-label {
  color: var(--primary);
  font-weight: 700;
}

.step-indicator.completed .step-circle {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: white;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.step-indicator.completed .step-label {
  color: var(--accent-emerald);
}

/* Main Content Area (Layout Compacto sem Scroll) */
.onboarding-main {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex: 1;
  padding: 0 16px 20px;
}

/* Animação Suave das Etapas (Fade In + Slide Up) */
@keyframes wizardStepIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Wizard Steps (Cartão Compacto de Conteúdo) */
.wizard-step {
  display: none;
  width: 100%;
  max-width: 580px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.wizard-step#step-4 {
  max-width: 640px; /* Largura ideal para a grade de 2 colunas sem qualquer estouro */
}

.wizard-step.active {
  display: block;
  animation: wizardStepIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html.dark .wizard-step {
  background: rgba(30, 30, 30, 0.7);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Painel de Sucesso Final (Passo 4) */
.success-panel {
  text-align: center;
  padding: 8px 0;
  width: 100%;
}
.success-icon-wrapper {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border: 2px solid rgba(16, 185, 129, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--accent-emerald);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}
.success-icon-wrapper i {
  width: 32px;
  height: 32px;
}

/* Resumo da Configuração Final (Passo 4 - Grid Blindada contra Overflow) */
.onb-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0 20px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  min-width: 0; /* Previne estouro do container pai */
  box-sizing: border-box;
}

.summary-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-card-icon i {
  width: 16px;
  height: 16px;
}

.summary-card-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0; /* Blinda contra vazamento de texto */
}

.summary-card-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.summary-card-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--text-muted);
  flex-shrink: 0;
}

.summary-badge.success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}

/* Navegação do Wizard e Estilização de Botões Premium */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.btn-wizard-back {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.btn-wizard-back:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-wizard-next {
  background: linear-gradient(135deg, var(--primary), #1D4ED8);
  color: white;
  border: none;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.btn-wizard-next:hover {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.btn-wizard-next:active {
  transform: translateY(0);
}

.btn-wizard-skip {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  margin-right: auto;
  margin-left: 12px;
  transition: color 0.2s ease;
}
.btn-wizard-skip:hover {
  color: var(--primary);
}
