/* ==========================================================================
   Instrutor Ativo - Onboarding Multi-etapas CSS
   ========================================================================== */

/* Modal Container & Overrides */
.onboarding-modal .modal-content {
  max-width: 680px;
  width: 95%;
  padding: 2rem;
  border-radius: 20px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .onboarding-modal .modal-content {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* Stepper Progress Bar */
.onboarding-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  position: relative;
  padding: 0 0.5rem;
}

.onboarding-stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: var(--border-color, #e2e8f0);
  z-index: 1;
}

.stepper-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-primary, #f8fafc);
  border: 2px solid var(--border-color, #cbd5e1);
  color: var(--text-secondary, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

[data-theme="dark"] .step-number {
  background: #1f2937;
  border-color: #374151;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  transition: color 0.3s ease;
}

.stepper-step.active .step-number {
  background: var(--primary-gold, #eab308);
  border-color: var(--primary-gold, #eab308);
  color: #000000;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);
}

.stepper-step.active .step-label {
  color: var(--text-primary, #0f172a);
}

.stepper-step.completed .step-number {
  background: #84cc16;
  border-color: #84cc16;
  color: #ffffff;
}

/* Step Panes */
.onboarding-steps-wrapper {
  overflow-y: auto;
  padding-right: 0.25rem;
  flex: 1;
}

.onboarding-step-pane {
  display: none;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-step-pane.active {
  display: block;
}

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

/* Step Titles */
.step-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.step-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.step-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
}

/* Form Styling & Layout */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

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

.form-input:focus {
  border-color: var(--primary-gold, #eab308);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
  outline: none;
}

/* Document Type Radio Pills */
.doc-type-selector {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.doc-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  transition: all 0.2s ease;
}

.doc-pill input[type="radio"] {
  display: none;
}

.doc-pill.selected {
  border-color: var(--primary-gold, #eab308);
  background: rgba(234, 179, 8, 0.08);
  color: var(--text-primary, #0f172a);
}

/* Carousel Section (Passo 2) */
.carousel-container {
  position: relative;
  background: var(--bg-primary, #f8fafc);
  border-radius: 16px;
  padding: 1.75rem 1.5rem 1.5rem;
  border: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .carousel-container {
  background: #1f2937;
  border-color: #374151;
}

.carousel-slides {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateX(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  position: relative;
}

.slide-image {
  width: 100%;
  max-width: 480px;
  height: 250px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color, #e2e8f0);
  position: relative;
  cursor: pointer;
  background: var(--bg-surface-2, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .slide-image {
  background: #111827;
  border-color: #374151;
}

.slide-image:hover {
  transform: translateY(-2px) scale(1.015);
  border-color: var(--primary-gold, #eab308);
  box-shadow: 0 8px 24px rgba(234, 179, 8, 0.25);
}

.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}

.zoom-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.slide-image:hover .zoom-badge {
  background: var(--primary-gold, #eab308);
  color: #000;
}

/* Lightbox Image Preview Modal */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.image-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: -5px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  font-size: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  background: var(--primary-gold, #eab308);
  color: #000;
  transform: scale(1.1);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 0.85rem;
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.slide-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(132, 204, 22, 0.2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--primary-gold, #eab308);
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.15);
}

.slide-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.5rem;
}

.slide-description {
  font-size: 0.9rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
  max-width: 480px;
}

/* Carousel Controls & Indicators */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .carousel-controls {
  border-color: #374151;
}

.carousel-btn {
  background: transparent;
  border: 1px solid var(--border-color, #cbd5e1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-btn:hover {
  background: var(--primary-gold, #eab308);
  border-color: var(--primary-gold, #eab308);
  color: #000;
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color, #cbd5e1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  width: 24px;
  border-radius: 12px;
  background: var(--primary-gold, #eab308);
}

/* Decision Cards (Passo 3) */
.decision-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (max-width: 580px) {
  .onboarding-modal .modal-content {
    padding: 1.25rem 1rem;
  }
  .onboarding-stepper {
    margin-bottom: 0.85rem;
  }
  .step-header {
    margin-bottom: 0.5rem;
  }
  .step-title {
    font-size: 1.15rem;
  }
  .step-subtitle {
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
  }
  .decision-cards {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 0.5rem 0;
  }
  .decision-card {
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
  }
  .decision-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }
  .decision-title {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
  }
  .decision-desc {
    font-size: 0.75rem;
    line-height: 1.25;
    margin-bottom: 0.4rem;
  }
  .decision-card .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem !important;
  }
}

.decision-card {
  background: var(--bg-primary, #f8fafc);
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .decision-card {
  background: #1f2937;
  border-color: #374151;
}

.decision-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.12);
}

.decision-card.whatsapp-card {
  border-color: rgba(37, 211, 102, 0.4);
}

.decision-card.whatsapp-card:hover {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.05);
}

.decision-card.finish-card {
  border-color: rgba(234, 179, 8, 0.4);
}

.decision-card.finish-card:hover {
  border-color: var(--primary-gold, #eab308);
  background: rgba(234, 179, 8, 0.05);
}

.decision-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.whatsapp-card .decision-icon {
  background: rgba(37, 211, 102, 0.15);
  color: #25D366;
}

.finish-card .decision-icon {
  background: rgba(234, 179, 8, 0.15);
  color: var(--primary-gold, #eab308);
}

.decision-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.4rem;
}

.decision-desc {
  font-size: 0.82rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

/* Plans Selection Grid (Passo 4) */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  background: var(--bg-primary, #f8fafc);
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

[data-theme="dark"] .plan-card {
  background: #1f2937;
  border-color: #374151;
}

.plan-card.selected {
  border-color: var(--primary-gold, #eab308);
  background: rgba(234, 179, 8, 0.08);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-gold, #eab308);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.plan-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-top: 0.2rem;
}

.plan-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin: 0.3rem 0;
}

.plan-price span {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary, #64748b);
}

/* Actions Footer Button Row */
.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 1rem;
}

.btn-back {
  background: transparent;
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-secondary, #64748b);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--bg-primary, #f8fafc);
  color: var(--text-primary, #0f172a);
}

/* Success State Screen (Passo 5) */
.success-screen {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(132, 204, 22, 0.15);
  color: #84cc16;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  animation: pulseSuccess 2s infinite;
}

@keyframes pulseSuccess {
  0% {
    box-shadow: 0 0 0 0 rgba(132, 204, 22, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(132, 204, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(132, 204, 22, 0);
  }
}

.success-badge {
  background: rgba(132, 204, 22, 0.15);
  color: #84cc16;
  border: 1px solid rgba(132, 204, 22, 0.3);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 1rem;
}

.info-box {
  background: var(--bg-primary, #f8fafc);
  border: 1px dashed var(--border-color, #cbd5e1);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

[data-theme="dark"] .info-box {
  background: #1f2937;
  border-color: #374151;
}

.info-box i {
  font-size: 1.4rem;
  color: var(--primary-gold, #eab308);
  margin-top: 0.2rem;
}

.info-box-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.25rem;
}

.info-box-text p {
  font-size: 0.82rem;
  color: var(--text-secondary, #64748b);
  margin: 0;
  line-height: 1.4;
}

/* Spinner helper */
.fa-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}
