/* ──────────────────────────────────────────────────────────
 * Mais IA Studio — visual light coerente com outras plataformas
 * Tema: violeta + lavanda (varinha mágica 🪄)
 * ────────────────────────────────────────────────────────── */

:root {
  --st-primary: #7c3aed;        /* violeta principal */
  --st-primary-dark: #6d28d9;
  --st-primary-light: #a78bfa;
  --st-accent: #ec4899;          /* rosa pra destaque */
  --st-bg: #faf7ff;              /* lavanda muito claro */
  --st-surface: #ffffff;
  --st-surface-alt: #f5f3ff;
  --st-border: #e9d5ff;
  --st-text: #1f1937;
  --st-text-soft: #4b5563;
  --st-text-muted: #6b7280;
  --st-success: #10b981;
  --st-warning: #f59e0b;
  --st-danger: #ef4444;
  --st-radius: 10px;
  --st-radius-lg: 16px;
  --st-shadow-sm: 0 2px 6px rgba(124, 58, 237, 0.08);
  --st-shadow: 0 8px 24px rgba(124, 58, 237, 0.10);
  --st-shadow-lg: 0 20px 50px rgba(124, 58, 237, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--st-bg);
  color: var(--st-text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 14px;
}

a { color: var(--st-primary); text-decoration: none; }
a:hover { color: var(--st-primary-dark); }

/* ── Header badge global slot ───────────────────────────── */
.st-badge-bar {
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  border-bottom: 1px solid var(--st-border);
  padding: 8px 18px;
}

/* ── Shell: sidebar + main ──────────────────────────────── */
.st-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 50px);
}
@media (max-width: 880px) {
  .st-shell { grid-template-columns: 1fr; }
  .st-sidebar { display: none; }
}

.st-sidebar {
  background: var(--st-surface);
  border-right: 1px solid var(--st-border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.st-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 22px;
  text-decoration: none;
}
.st-brand-emoji {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(124, 58, 237, 0.3));
}
.st-brand-name {
  font-weight: 800;
  font-size: 18px;
  color: var(--st-text);
  letter-spacing: -0.02em;
}
.st-brand-name em {
  font-style: normal;
  background: linear-gradient(135deg, var(--st-primary), var(--st-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.st-nav { display: flex; flex-direction: column; gap: 4px; }
.st-nav-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-text-muted);
  padding: 14px 12px 6px;
}
.st-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--st-text-soft);
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s;
}
.st-nav-item:hover {
  background: var(--st-surface-alt);
  color: var(--st-primary);
}
.st-nav-item.ativo {
  background: linear-gradient(135deg, var(--st-primary), var(--st-primary-dark));
  color: white;
  box-shadow: var(--st-shadow-sm);
}
.st-nav-item.ativo:hover { color: white; }
.st-nav-emoji { font-size: 18px; line-height: 1; }
.st-nav-badge {
  margin-left: auto;
  background: var(--st-accent);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
}

/* ── Main content ───────────────────────────────────────── */
.st-main { padding: 28px 36px; max-width: 1100px; }
@media (max-width: 880px) { .st-main { padding: 22px 18px; } }

.st-page-header {
  margin-bottom: 24px;
}
.st-page-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--st-text);
  margin-bottom: 6px;
}
.st-page-sub {
  color: var(--st-text-muted);
  font-size: 15px;
}

/* ── Cards de ferramentas ───────────────────────────────── */
.st-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.st-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-lg);
  padding: 22px;
  position: relative;
  transition: all 0.18s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--st-shadow);
  border-color: var(--st-primary-light);
  color: inherit;
}
.st-card-emoji {
  font-size: 36px;
  margin-bottom: 4px;
  line-height: 1;
}
.st-card-titulo {
  font-size: 17px;
  font-weight: 800;
  color: var(--st-text);
  letter-spacing: -0.01em;
}
.st-card-desc {
  font-size: 13px;
  color: var(--st-text-muted);
  line-height: 1.55;
  flex: 1;
}
.st-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--st-border);
}
.st-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.st-card-badge.gratis {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.st-card-badge.pago {
  background: rgba(124, 58, 237, 0.12);
  color: var(--st-primary);
}
.st-card-badge.novo {
  background: var(--st-accent);
  color: white;
}

/* Card destacado (Tier 3) */
.st-card.diferencial {
  background: linear-gradient(135deg, #faf5ff 0%, #fce7f3 100%);
  border: 2px solid var(--st-primary-light);
}
.st-card.diferencial::before {
  content: '⭐ EXCLUSIVO';
  position: absolute;
  top: -10px;
  right: 18px;
  background: linear-gradient(135deg, var(--st-primary), var(--st-accent));
  color: white;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

/* ── Tier headers (separadores) ─────────────────────────── */
.st-tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 14px;
}
.st-tier-titulo {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-text-muted);
}
.st-tier-linha {
  flex: 1;
  height: 1px;
  background: var(--st-border);
}

/* ── Forms ──────────────────────────────────────────────── */
.st-form { display: flex; flex-direction: column; gap: 16px; }

.st-campo { display: flex; flex-direction: column; gap: 6px; }
.st-campo-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--st-text);
}
.st-campo-hint {
  font-size: 12px;
  color: var(--st-text-muted);
}

.st-input, .st-textarea, .st-select {
  background: var(--st-surface);
  border: 1.5px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--st-text);
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.st-input:focus, .st-textarea:focus, .st-select:focus {
  outline: none;
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.st-textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

/* ── Botões ─────────────────────────────────────────────── */
.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--st-radius);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}
.st-btn-primary {
  background: linear-gradient(135deg, var(--st-primary), var(--st-primary-dark));
  color: white;
  box-shadow: var(--st-shadow-sm);
}
.st-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
  color: white;
}
.st-btn-secondary {
  background: var(--st-surface);
  color: var(--st-primary);
  border: 1.5px solid var(--st-primary-light);
}
.st-btn-secondary:hover {
  background: var(--st-surface-alt);
  border-color: var(--st-primary);
}
.st-btn-ghost {
  background: transparent;
  color: var(--st-text-muted);
  border: 1px solid var(--st-border);
}
.st-btn-ghost:hover {
  color: var(--st-text);
  border-color: var(--st-text-muted);
}
.st-btn:disabled, .st-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Caixa de output ────────────────────────────────────── */
.st-output-box {
  background: var(--st-surface);
  border: 1.5px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 18px;
  min-height: 200px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--st-text);
  position: relative;
}
.st-output-box.vazio {
  color: var(--st-text-muted);
  font-style: italic;
  font-family: inherit;
}

.st-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 12px;
  padding: 6px 12px;
  background: var(--st-surface-alt);
  border: 1px solid var(--st-border);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: var(--st-primary);
  font-family: inherit;
}
.st-copy-btn:hover { background: var(--st-primary); color: white; border-color: var(--st-primary); }

/* ── Alerta / banners ───────────────────────────────────── */
.st-alerta {
  border-radius: var(--st-radius);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.55;
  margin: 12px 0;
}
.st-alerta-info {
  background: rgba(124, 58, 237, 0.08);
  border-left: 3px solid var(--st-primary);
  color: var(--st-primary-dark);
}
.st-alerta-success {
  background: rgba(16, 185, 129, 0.10);
  border-left: 3px solid var(--st-success);
  color: #047857;
}
.st-alerta-erro {
  background: rgba(239, 68, 68, 0.10);
  border-left: 3px solid var(--st-danger);
  color: #b91c1c;
}
.st-alerta-warning {
  background: rgba(245, 158, 11, 0.10);
  border-left: 3px solid var(--st-warning);
  color: #92400e;
}

/* ── Custo preview ──────────────────────────────────────── */
.st-custo-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--st-surface-alt);
  border: 1px solid var(--st-border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--st-primary-dark);
}
.st-custo-box.gratis { background: rgba(16, 185, 129, 0.10); color: #047857; border-color: rgba(16, 185, 129, 0.25); }

/* ── Login standalone ───────────────────────────────────── */
.st-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #faf5ff 0%, #fdf2f8 100%);
  padding: 20px;
}
.st-login-card {
  background: white;
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-lg);
  padding: 36px;
  max-width: 420px;
  width: 100%;
}
.st-login-brand {
  text-align: center;
  margin-bottom: 24px;
}
.st-login-emoji {
  font-size: 56px;
  filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.4));
  margin-bottom: 10px;
}
.st-login-titulo {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}
.st-login-sub {
  color: var(--st-text-muted);
  font-size: 14px;
}

/* ── Histórico ──────────────────────────────────────────── */
.st-historico-tabela {
  width: 100%;
  border-collapse: collapse;
  background: var(--st-surface);
  border-radius: var(--st-radius);
  overflow: hidden;
  box-shadow: var(--st-shadow-sm);
}
.st-historico-tabela th,
.st-historico-tabela td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--st-border);
  font-size: 13px;
}
.st-historico-tabela th {
  background: var(--st-surface-alt);
  font-weight: 700;
  color: var(--st-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.st-historico-tabela tr:last-child td { border-bottom: none; }

/* Spinner */
.st-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(124, 58, 237, 0.2);
  border-top-color: var(--st-primary);
  border-radius: 50%;
  animation: st-spin 0.6s linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }
