/* ============================================================
   TECH SILVA SOLUTIONS — Guia Interativo de Instalação
   Mapa/jornada passo a passo. Reutiliza o design system (tokens).
   ============================================================ */

/* === BREADCRUMB (padrão do site — regra de consistência) === */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  font-size: var(--text-sm); color: var(--color-text-muted);
  width: min(100% - var(--container-padding), var(--container-max));
  margin-inline: auto;
  padding-top: 88px;
  margin-bottom: var(--space-lg);
}
.breadcrumb a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--color-border); }
.breadcrumb [aria-current="page"] { color: var(--color-text); font-weight: 600; }

/* === HERO DO GUIA === */
.guide-hero {
  padding-block: var(--space-lg) var(--space-xl);
}
.guide-hero .container { max-width: var(--container-max); }
.guide-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800;
  color: var(--color-navy); line-height: 1.15; margin-bottom: var(--space-sm);
}
.guide-hero-sub {
  font-size: var(--text-lg); color: var(--color-text-muted); max-width: 640px;
}

/* === BARRA DE PROGRESSO === */
.progress-card {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-sm);
}
.progress-label {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-md); margin-bottom: var(--space-md); flex-wrap: wrap;
}
.progress-label h2 {
  font-family: var(--font-heading); font-size: var(--text-lg); font-weight: 700;
  color: var(--color-navy);
}
.progress-pct {
  font-family: var(--font-heading); font-weight: 800;
  color: var(--color-primary); font-size: var(--text-lg);
}
.progress-pct-wrap {
  display: flex; align-items: baseline; gap: var(--space-md); flex-wrap: wrap;
}
.progress-count { font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 600; }
.progress-bar-track {
  height: 12px; background: var(--color-blue-light);
  border-radius: var(--radius-full); overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-cyan));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}
.progress-actions {
  display: flex; gap: var(--space-md); margin-top: var(--space-lg); flex-wrap: wrap;
}
.progress-actions .btn { min-height: 44px; }
.btn-resume {
  background: var(--color-green); color: white;
}
.btn-resume:hover { filter: brightness(1.1); }
.btn-reset-progress {
  background: transparent; color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-reset-progress:hover { color: var(--color-danger); border-color: var(--color-danger); }

/* === MAPA / JORNADA === */
.journey { position: relative; max-width: 900px; margin: 0 auto; }

/* Linha conectora vertical (linha do mapa) */
.journey::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 34px; width: 3px;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-border) 100%);
  border-radius: var(--radius-full);
}

.step-node { position: relative; padding-left: 88px; margin-bottom: var(--space-xl); }

/* Círculo numerado */
.step-circle {
  position: absolute; left: 0; top: 0;
  width: 68px; height: 68px; display: flex; align-items: center; justify-content: center;
  background: var(--color-white); color: var(--color-primary);
  border: 3px solid var(--color-primary); border-radius: var(--radius-full);
  font-family: var(--font-heading); font-size: var(--text-xl); font-weight: 800;
  z-index: 2; transition: all var(--transition-base);
  box-shadow: 0 0 0 4px var(--color-white);
}
.step-node.completed .step-circle {
  background: var(--color-green); border-color: var(--color-green); color: white;
}
.step-node.current .step-circle {
  background: var(--color-primary); color: white;
  box-shadow: 0 0 0 6px rgba(7,95,234,0.18);
  animation: pulse-circle 2s infinite;
}
.step-node.locked .step-circle { background: var(--color-blue-light); border-color: var(--color-border); color: var(--color-text-muted); }

@keyframes pulse-circle {
  0%, 100% { box-shadow: 0 0 0 4px var(--color-white), 0 0 0 8px rgba(7,95,234,0.18); }
  50% { box-shadow: 0 0 0 4px var(--color-white), 0 0 0 13px rgba(7,95,234,0.06); }
}

/* Card da etapa */
.step-card {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-xl);
  text-align: left;
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}
.step-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.step-node.current .step-card {
  border-color: var(--color-primary); box-shadow: var(--shadow-primary);
}
.step-node.completed .step-card { border-color: rgba(32,184,106,0.45); background: #FBFEFC; }

.step-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.step-header-text { min-width: 0; }
.step-label {
  display: inline-block; font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-primary); margin-bottom: 0.25rem;
}
.step-node.completed .step-label { color: var(--color-green); }
.step-title {
  font-family: var(--font-heading); font-size: var(--text-xl); font-weight: 700;
  color: var(--color-navy); margin-bottom: 0.35rem;
}
.step-desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; max-width: 620px; }

.step-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; flex-shrink: 0; }
.btn-done {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--color-primary); color: white;
  font-weight: 600; font-size: var(--text-sm);
  padding: 0.65rem 1.25rem; border-radius: var(--radius-full);
  transition: all var(--transition-fast); border: 2px solid transparent;
}
.btn-done:hover { background: var(--color-primary-dark); }
.btn-done.done {
  background: var(--color-green); border-color: var(--color-green);
}
.btn-done.done:hover { filter: brightness(1.05); }
.btn-done.undone {
  background: transparent; color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-done.undone:hover { color: var(--color-danger); border-color: var(--color-danger); }
.btn-expand {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted);
  transition: color var(--transition-fast);
}
.btn-expand:hover { color: var(--color-primary); }
.btn-expand .expand-icon { transition: transform var(--transition-fast); }
.step-node.open .btn-expand .expand-icon { transform: rotate(180deg); }

/* Conteúdo expandido */
.step-details {
  max-height: 0; overflow: hidden;
  transition: max-height var(--transition-base);
}
.step-node.open .step-details { max-height: 3000px; }
.step-details-inner {
  border-top: 1px dashed var(--color-border);
  margin-top: var(--space-lg); padding-top: var(--space-lg);
  display: grid; gap: var(--space-lg);
}
.step-instructions h4 {
  font-family: var(--font-heading); font-size: var(--text-base); font-weight: 700;
  color: var(--color-navy); margin-bottom: var(--space-sm);
}
.step-instructions ol { list-style: none; counter-reset: step; display: grid; gap: 0.6rem; }
.step-instructions li {
  counter-increment: step; position: relative;
  padding-left: 2.1rem; font-size: var(--text-sm); color: var(--color-text);
  line-height: 1.65;
}
.step-instructions li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05rem;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: var(--color-blue-light); color: var(--color-primary);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 700;
}
.step-instructions p { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 0.5rem; }

/* Links úteis */
.useful-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.useful-links h4 {
  width: 100%; font-family: var(--font-heading); font-size: var(--text-base);
  font-weight: 700; color: var(--color-navy); margin-bottom: 0.25rem;
}
.useful-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: var(--text-sm); font-weight: 600; color: var(--color-primary);
  background: var(--color-blue-light); border: 1px solid transparent;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}
.useful-link:hover { background: var(--color-primary); color: white; }

/* Vídeo */
.video-box {
  background: var(--color-blue-soft); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden;
}
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--color-navy); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem; color: rgba(255,255,255,0.75);
  font-size: var(--text-sm); text-align: center; padding: var(--space-md);
}
.video-placeholder .play-icon {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12); border-radius: var(--radius-full);
  font-size: 1.4rem;
}
.video-title { font-size: var(--text-xs); color: var(--color-text-muted); padding: 0.6rem var(--space-md); }

/* Próximo passo */
.next-step-badge {
  display: none; align-items: center; gap: 0.5rem;
  margin-top: var(--space-md);
  font-size: var(--text-xs); font-weight: 700; color: var(--color-primary);
}
.step-node.is-next .next-step-badge { display: inline-flex; animation: fade-in-up 0.5s ease; }
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === FINALIZAÇÃO (todas concluídas) === */
.completion-card {
  display: none;
  text-align: center; background: var(--color-green-light);
  border: 2px solid var(--color-green); border-radius: var(--radius-lg);
  padding: var(--space-2xl); margin-top: var(--space-2xl);
}
.completion-card.visible { display: block; animation: fade-in-up 0.6s ease; }
.completion-icon {
  width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-md); background: var(--color-green); color: white;
  border-radius: var(--radius-full); font-size: 2rem;
}
.completion-card h2 {
  font-family: var(--font-heading); font-size: var(--text-3xl); font-weight: 800;
  color: var(--color-green); margin-bottom: var(--space-sm);
}
.completion-card p { color: var(--color-text-muted); max-width: 520px; margin: 0 auto var(--space-lg); }
.support-box {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-lg);
  margin-top: var(--space-lg); max-width: 480px; margin-inline: auto;
}
.support-box h3 { font-family: var(--font-heading); font-size: var(--text-base); color: var(--color-navy); margin-bottom: 0.25rem; }
.support-box p { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-md); font-size: var(--text-sm); }

/* Aviso de confirmação de reset */
.reset-warning {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  background: var(--color-warning-bg); border: 1px solid #FED7AA;
  border-radius: var(--radius-sm); padding: var(--space-md);
  font-size: var(--text-xs); color: #9A3412; line-height: 1.6;
}
.reset-warning .warn-icon { flex-shrink: 0; }

/* === RESPONSIVO (mobile-first) === */
@media (max-width: 768px) {
  .journey::before { left: 24px; }
  .step-node { padding-left: 64px; }
  .step-circle { width: 52px; height: 52px; font-size: var(--text-lg); }
  .step-header { flex-direction: column; }
  .step-actions { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .step-card { padding: var(--space-lg); }
  .progress-label { flex-direction: column; gap: 0.25rem; }
  .progress-actions .btn { width: 100%; }
}
@media (max-width: 430px) {
  .step-node { padding-left: 0; }
  .journey::before { display: none; }
  .step-circle { position: static; margin-bottom: var(--space-sm); }
}
