/* Components — cards, buttons, badges */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--brand-purple); color: white; }
.btn-primary:hover { background: #7c3aed; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.lang-toggle { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary); }
.lang-toggle:hover { color: var(--brand-white); border-color: var(--border-strong); }

/* Card básico */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.card-title {
  font-size: var(--label-sm);
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-white);
}

/* KPI grid (4-6 cards lado a lado) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

/* Section wrap */
.section-wrap {
  margin-bottom: 32px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--brand-purple);
  color: white;
  font-size: 11px;
  font-weight: 600;
}
.section-title {
  font-size: 16px;
  font-weight: 500;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}
.pricing-card.pricing-current { border-color: var(--brand-purple); }
.pricing-card h3 { font-size: 14px; letter-spacing: 1.5px; color: var(--text-secondary); margin-bottom: 16px; }
.pricing-card .price { font-family: var(--font-mono); font-size: 36px; font-weight: 600; color: var(--brand-white); margin-bottom: 24px; }
.pricing-card .price span { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.pricing-card ul { list-style: none; text-align: left; margin: 0 0 24px; padding: 0; }
.pricing-card ul li { padding: 6px 0; font-size: 13px; color: var(--text-secondary); }

/* Loading state */
.loading {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

/* Empty/placeholder state */
.placeholder {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ─────────────────────────────────────────────────────────────
 * Module loading — Heartbeat ECG (2026-06-01)
 * Padrão único pra TODAS as telas de carregamento do site.
 * ───────────────────────────────────────────────────────────── */
.module-loading-ecg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 80px 20px;
  gap: 14px;
  user-select: none;
}
.module-loading-ecg svg {
  width: 100%;
  max-width: 200px;
  height: 56px;
  overflow: visible;
}
.module-loading-ecg svg path {
  fill: none;
  stroke: #22c55e;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: mlEcgPulse 2s linear infinite;
}
.module-loading-ecg .ml-ecg-label {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #666;
  text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-top: 4px;
}
@keyframes mlEcgPulse {
  0%   { stroke-dashoffset: 220; }
  55%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -220; }
}
@media (prefers-reduced-motion: reduce) {
  .module-loading-ecg svg path { animation: none; stroke-dashoffset: 0; opacity: 0.4; }
}

/* Skeleton loader (mantido como fallback opcional) */
.section-skeleton {
  padding: 4px 0 20px;
  user-select: none;
}
.section-skeleton > * + * { margin-top: 14px; }
.sk-row, .sk-card, .sk-chart {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 100%);
  background-color: rgba(255,255,255,0.025);
  background-size: 200% 100%;
  animation: skShimmer 1.4s linear infinite;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.04);
}
.sk-row-title { height: 26px; width: 240px; }
.sk-row-bar { height: 10px; width: 100%; max-width: 480px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.sk-card { height: 110px; }
.sk-chart { height: 380px; }
@keyframes skShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────────────────────
 * Skeleton loader (2026-06-01) — substitui o "Carregando..." chato.
 * Aparece imediatamente ao trocar feature; cobre o vazio durante
 * o fetch async de cada módulo.
 * ───────────────────────────────────────────────────────────── */
.section-skeleton {
  padding: 4px 0 20px;
  user-select: none;
}
.section-skeleton > * + * { margin-top: 14px; }

.sk-row,
.sk-card,
.sk-chart {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.02) 100%
  );
  background-color: rgba(255, 255, 255, 0.025);
  background-size: 200% 100%;
  animation: skShimmer 1.4s linear infinite;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.sk-row-title { height: 26px; width: 240px; }
.sk-row-bar   { height: 10px; width: 100%; max-width: 480px; }

.sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.sk-card  { height: 110px; }
.sk-chart { height: 380px; }

@keyframes skShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Acessibilidade: respeitar prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .sk-row, .sk-card, .sk-chart { animation: none; opacity: 0.6; }
}
