/* ==========================================================
   StudioV — Página de demonstração
========================================================== */

.demo-page {
  min-height: 100vh;

  color: var(--color-text-primary, #0f172a);

  background:
    radial-gradient(circle at top left, rgba(109, 40, 217, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.12), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #f5f3ff 52%, #eef2ff 100%);
}

/* ==========================================================
   Estrutura principal
========================================================== */

.demo-main {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 100vh;

  padding: 48px 24px;
}

/* ==========================================================
   Card principal
========================================================== */

.demo-card {
  position: relative;

  width: 100%;
  max-width: 720px;

  padding: 40px;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.94);

  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;

  box-shadow:
    0 30px 80px rgba(15, 23, 42, 0.12),
    0 10px 30px rgba(109, 40, 217, 0.08);

  backdrop-filter: blur(18px);
}

.demo-card::before {
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 4px;

  content: "";

  background: linear-gradient(90deg, #6d28d9, #8b5cf6, #a78bfa);
}

/* ==========================================================
   Logo
========================================================== */

.demo-logo {
  display: inline-flex;
  align-items: center;

  gap: 10px;

  margin-bottom: 32px;

  color: var(--color-text-primary, #0f172a);

  text-decoration: none;
}

.demo-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;

  color: #ffffff;
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);

  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;

  border-radius: 12px;

  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.24);
}

.demo-logo-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ==========================================================
   Loader principal
========================================================== */

.demo-loader {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 96px;
  height: 96px;

  margin: 0 auto 28px;
}

.demo-loader-ring {
  position: absolute;
  inset: 0;

  border: 5px solid rgba(109, 40, 217, 0.12);
  border-top-color: var(--color-primary, #6d28d9);
  border-radius: 50%;

  animation: demo-spin 1s linear infinite;
}

.demo-loader-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 58px;
  height: 58px;

  color: var(--color-primary, #6d28d9);
  background: rgba(109, 40, 217, 0.08);

  border-radius: 18px;
}

.demo-loader-icon svg {
  width: 28px;
  height: 28px;
}

@keyframes demo-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================
   Conteúdo principal
========================================================== */

.demo-content {
  max-width: 590px;

  margin: 0 auto 30px;

  text-align: center;
}

.demo-badge {
  display: inline-flex;
  align-items: center;

  gap: 7px;

  margin-bottom: 18px;
  padding: 7px 12px;

  color: var(--color-primary, #6d28d9);
  background: rgba(109, 40, 217, 0.08);

  font-size: 0.78rem;
  font-weight: 600;

  border: 1px solid rgba(109, 40, 217, 0.14);
  border-radius: 999px;
}

.demo-badge svg {
  width: 15px;
  height: 15px;
}

.demo-content h1 {
  margin: 0 0 14px;

  color: var(--color-text-primary, #0f172a);

  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.demo-content p {
  max-width: 560px;

  margin: 0 auto;

  color: var(--color-text-secondary, #64748b);

  font-size: 1rem;
  line-height: 1.7;
}

/* ==========================================================
   Progresso
========================================================== */

.demo-progress {
  margin-bottom: 28px;
}

.demo-progress-bar {
  width: 100%;
  height: 9px;

  overflow: hidden;

  background: #ede9fe;

  border-radius: 999px;
}

.demo-progress-value {
  display: block;

  width: 8%;
  height: 100%;

  background: linear-gradient(90deg, #6d28d9, #8b5cf6);

  border-radius: inherit;

  transition: width 0.45s ease;
}

.demo-status {
  margin: 10px 0 0;

  color: var(--color-text-secondary, #64748b);

  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* ==========================================================
   Etapas
========================================================== */

.demo-steps {
  display: grid;

  gap: 12px;

  margin-bottom: 28px;
}

.demo-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;

  gap: 14px;

  padding: 16px;

  background: #f8fafc;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  transition:
    border-color 0.25s ease,
    background-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.demo-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;

  color: #64748b;
  background: #ffffff;

  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.demo-step-icon svg {
  width: 19px;
  height: 19px;
}

.demo-step-content {
  display: flex;
  flex-direction: column;

  gap: 4px;

  min-width: 0;
}

.demo-step-content strong {
  color: #0f172a;

  font-size: 0.9rem;
  font-weight: 600;
}

.demo-step-content span {
  color: #64748b;

  font-size: 0.78rem;
  line-height: 1.45;
}

.demo-step-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #cbd5e1;
}

.demo-step-status svg {
  width: 18px;
  height: 18px;
}

/* Estado em processamento */

.demo-step[data-status="active"] {
  background: rgba(109, 40, 217, 0.05);

  border-color: rgba(109, 40, 217, 0.35);

  transform: translateY(-1px);

  box-shadow: 0 10px 24px rgba(109, 40, 217, 0.08);
}

.demo-step[data-status="active"] .demo-step-icon {
  color: var(--color-primary, #6d28d9);
  background: rgba(109, 40, 217, 0.08);

  border-color: rgba(109, 40, 217, 0.2);
}

.demo-step[data-status="active"] .demo-step-status {
  color: var(--color-primary, #6d28d9);
}

.demo-step[data-status="active"] .demo-step-status svg {
  animation: demo-pulse 1.2s ease-in-out infinite;
}

/* Estado concluído */

.demo-step[data-status="completed"] {
  background: #f0fdf4;

  border-color: #bbf7d0;
}

.demo-step[data-status="completed"] .demo-step-icon {
  color: #15803d;
  background: #dcfce7;

  border-color: #bbf7d0;
}

.demo-step[data-status="completed"] .demo-step-status {
  color: #16a34a;
}

/* Estado de erro */

.demo-step[data-status="error"] {
  background: #fff7ed;

  border-color: #fed7aa;
}

.demo-step[data-status="error"] .demo-step-icon,
.demo-step[data-status="error"] .demo-step-status {
  color: #ea580c;
}

@keyframes demo-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* ==========================================================
   Caixa de erro
========================================================== */

.demo-error {
  display: flex;
  align-items: flex-start;

  gap: 12px;

  margin-bottom: 24px;
  padding: 16px;

  color: #991b1b;
  background: #fef2f2;

  border: 1px solid #fecaca;
  border-radius: 14px;
}

.demo-error[hidden] {
  display: none;
}

.demo-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  width: 38px;
  height: 38px;

  color: #dc2626;
  background: #fee2e2;

  border-radius: 10px;
}

.demo-error-icon svg {
  width: 20px;
  height: 20px;
}

.demo-error-content strong {
  display: block;

  margin-bottom: 4px;

  color: #991b1b;

  font-size: 0.9rem;
}

.demo-error-content p {
  margin: 0;

  color: #b91c1c;

  font-size: 0.8rem;
  line-height: 1.55;
}

/* ==========================================================
   Ações
========================================================== */

.demo-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;

  gap: 12px;

  margin-top: 8px;
}

.demo-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  min-height: 44px;
  padding: 11px 18px;

  font-size: 0.86rem;
  font-weight: 600;

  border-radius: 11px;
}

.demo-actions .btn svg {
  width: 17px;
  height: 17px;
}

.demo-actions .btn[hidden] {
  display: none;
}

/* ==========================================================
   Nota inferior
========================================================== */

.demo-note {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  margin: 24px 0 0;

  color: #94a3b8;

  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

.demo-note svg {
  flex-shrink: 0;

  width: 15px;
  height: 15px;
}

/* ==========================================================
   Estado concluído da página
========================================================== */

.demo-page.is-completed .demo-loader-ring {
  border-color: #bbf7d0;
  border-top-color: #16a34a;

  animation: none;
}

.demo-page.is-completed .demo-loader-icon {
  color: #15803d;
  background: #dcfce7;
}

/* ==========================================================
   Estado de erro da página
========================================================== */

.demo-page.has-error .demo-loader-ring {
  border-color: #fecaca;
  border-top-color: #dc2626;

  animation: none;
}

.demo-page.has-error .demo-loader-icon {
  color: #dc2626;
  background: #fee2e2;
}

/* ==========================================================
   Responsividade
========================================================== */

@media (max-width: 700px) {
  .demo-main {
    align-items: flex-start;

    padding: 24px 16px;
  }

  .demo-card {
    padding: 28px 20px;

    border-radius: 18px;
  }

  .demo-logo {
    margin-bottom: 26px;
  }

  .demo-loader {
    width: 82px;
    height: 82px;

    margin-bottom: 24px;
  }

  .demo-loader-icon {
    width: 50px;
    height: 50px;
  }

  .demo-content h1 {
    font-size: 2rem;
  }

  .demo-content p {
    font-size: 0.92rem;
  }

  .demo-step {
    grid-template-columns: auto 1fr;

    padding: 14px;
  }

  .demo-step-status {
    display: none;
  }

  .demo-actions {
    flex-direction: column;
  }

  .demo-actions .btn {
    width: 100%;
  }

  .demo-note {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .demo-card {
    padding: 24px 16px;
  }

  .demo-content h1 {
    font-size: 1.72rem;
  }

  .demo-step-icon {
    width: 38px;
    height: 38px;
  }
}

/* ==========================================================
   Redução de movimento
========================================================== */

@media (prefers-reduced-motion: reduce) {
  .demo-loader-ring,
  .demo-step[data-status="active"] .demo-step-status svg {
    animation: none;
  }

  .demo-progress-value,
  .demo-step {
    transition: none;
  }
}
