/* =========================================================
   NotionIA Design System v2 (dark premium)
   Regras: variaveis centralizadas + componentes reutilizaveis
   ========================================================= */

/* Import de tipografia global solicitada */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Backgrounds */
  --bg-primary:    #0A0A0F;
  --bg-secondary:  #111118;
  --bg-tertiary:   #1A1A24;
  --bg-hover:      #1E1E2E;

  /* Accent */
  --accent:        #00D4A0;
  --accent-dim:    #00D4A015;
  --accent-border: #00D4A030;

  /* Textos */
  --text-primary:   #F0F0F8;
  --text-secondary: #8888AA;
  --text-muted:     #44445A;

  /* Bordas */
  --border:        #1E1E30;
  --border-accent: #00D4A040;

  /* Status */
  --success: #00D4A0;
  --error:   #FF4D6D;
  --warning: #FFB347;

  /* Gradientes */
  --gradient-hero: linear-gradient(135deg, #00D4A015 0%, #7B61FF10 100%);
  --gradient-card: linear-gradient(145deg, #111118 0%, #0A0A0F 100%);
  --gradient-text: linear-gradient(90deg, #00D4A0, #7B61FF);
  --gradient-btn:  linear-gradient(135deg, #00D4A0, #00B388);

  /* Fontes */
  --font-sans: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Compatibilidade com classes antigas */
  --bg: var(--bg-primary);
  --surface: var(--bg-secondary);
  --surface-alt: var(--bg-tertiary);
  --text: var(--text-primary);
  --primary: var(--accent);
  --primary-dark: #00B388;
  --primary-light: var(--accent-dim);
  --danger: var(--error);
  --warn: var(--warning);
}

/* Base global */
html { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.7;
}
::selection {
  background: var(--accent-dim);
  color: var(--accent);
}
* {
  scrollbar-width: thin;
  scrollbar-color: #2A2A3A var(--bg-primary);
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: var(--bg-primary); }
*::-webkit-scrollbar-thumb {
  background: #2A2A3A;
  border-radius: 999px;
  border: 2px solid var(--bg-primary);
}
*::-webkit-scrollbar-thumb:hover { background: #3B3B52; }

.container { max-width: 1240px; }
.muted { color: var(--text-secondary); }
.lead { color: var(--text-secondary); line-height: 1.75; }
.gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Escala tipografica */
h1 { font-size: clamp(2.2rem, 4vw + 1rem, 3.5rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 2vw + 1rem, 2.25rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 1vw + 1rem, 1.5rem); line-height: 1.3; font-weight: 600; }
h4 { font-size: 1.125rem; line-height: 1.4; font-weight: 500; }
small { font-size: 0.875rem; line-height: 1.6; }

/* Header / Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 10, 15, 0.65);
  border-bottom: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, backdrop-filter 180ms ease;
}
.site-header.scrolled {
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 15, 0.88);
  border-color: var(--border);
}
.nav { padding-top: .95rem; padding-bottom: .95rem; }
.brand { color: var(--text-primary); }
.brand-mark {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.brand-name .ia { color: var(--accent); }
.nav-links a { color: var(--text-secondary); }
.nav-links a:hover { color: var(--text-primary); }

/* Componentes de botao */
.btn {
  border-radius: 12px;
  padding: .86rem 1.4rem;
  font-size: .94rem;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.btn-primary {
  background: var(--gradient-btn);
  color: #0A0A0F;
  border: none;
  box-shadow: 0 0 30px #00D4A025;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px #00D4A040;
  color: #0A0A0F;
}
.btn-ghost,
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover,
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,.25);
  border-top-color: rgba(0,0,0,.8);
  border-radius: 50%;
  margin-left: .35rem;
  animation: btnSpin .8s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Cards, inputs, badge */
.card,
.hero-card,
.plan-card,
.gallery-card,
.auth-card,
.chat-area,
.table-wrap,
.checkout-card,
.np-page,
.np-db,
.np-blocks,
.faq details {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.card:hover,
.plan-card:hover,
.gallery-card:hover,
.hero-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px #00000040;
}
.pill,
.badge,
.np-badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
}
.form input,
.form textarea,
.form select,
.referral-box input,
.chat-controls textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 12px;
}
.form input:focus,
.form textarea:focus,
.form select:focus,
.chat-controls textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Hero */
.hero {
  background: radial-gradient(circle at 78% 18%, #00d4a018, transparent 32%), var(--gradient-hero);
  padding-top: 5rem;
}
.hero-grid { gap: 2.5rem; }
.hero-bullets { color: var(--text-secondary); }
.hero-social-proof {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: .86rem;
}

/* Passos */
.how-grid article { position: relative; overflow: hidden; }
.how-grid .step {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  width: 46px;
  height: 46px;
  font-size: 1rem;
}

/* Preview e browser frame */
.browser-frame {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-secondary);
  overflow: hidden;
}
.browser-frame .bar {
  border-bottom: 1px solid var(--border);
  background: #0e0e15;
  padding: .65rem .9rem;
  display: flex;
  gap: .5rem;
}
.browser-frame .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #2f2f44;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
}
.preview-pane {
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 210px;
  background: #0d0d13;
  padding: .85rem;
}
.preview-pane h4 { margin: 0 0 .65rem; color: var(--text-secondary); font-size: .9rem; }
.preview-line { height: 10px; border-radius: 999px; background: #202032; margin-bottom: .55rem; }

/* Categorias e depoimentos */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .85rem;
}
.category-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-secondary);
  padding: 1rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.category-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border), 0 0 35px #00d4a022;
  transform: translateY(-3px);
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.testimonial-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-secondary);
  padding: 1.2rem;
}
.stars { color: #FFD76A; letter-spacing: 2px; margin-bottom: .6rem; }

/* Planos */
.plans-grid { margin-top: 1.3rem; }
.plan-card ul li { border-bottom-color: #27273a; color: var(--text-secondary); }
.plan-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border), 0 18px 55px #00d4a018;
}
.plan-tag {
  background: var(--accent);
  color: #03241c;
  font-weight: 700;
}

/* FAQ */
.faq details {
  padding: 1rem 1.1rem;
}
.faq summary {
  color: var(--text-primary);
}
.faq p {
  color: var(--text-secondary);
}

/* CTA final */
.section-cta {
  background: linear-gradient(160deg, #0e0e15, #141426);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Dashboard */
.stats-grid { gap: 1rem; }
.stat-card { padding: 1.1rem; }
.stat-label { color: var(--text-secondary); }
.stat-value { color: var(--text-primary); }
.chip { background: #212132; color: var(--text-secondary); }
.chip-installed { background: #0d2b24; color: var(--success); }
.chip-failed { background: #341722; color: var(--error); }
.chip-generated { background: #162a2a; color: #45efd0; }
.empty {
  background: var(--bg-secondary);
  border-color: #292940;
  color: var(--text-secondary);
}

/* Chat / Geracao */
.generator-layout {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 1rem;
}
.chat-message.from-user { justify-content: flex-end; }
.chat-message {
  display: flex;
  align-items: flex-end;
  gap: .55rem;
}
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-avatar.assistant {
  background: #00D4A015;
  border: 1px solid #00D4A040;
  color: #00D4A0;
}
.chat-avatar.user {
  background: #7B61FF20;
  border: 1px solid #7B61FF35;
  color: #c8bbff;
}
.chat-message.from-user .chat-avatar {
  order: 2;
}
.chat-bubble {
  background: #171727;
  color: var(--text-primary);
  max-width: 78%;
  padding: .72rem .95rem;
  border-radius: 14px;
  line-height: 1.5;
  border: 1px solid #232339;
}
.from-user .chat-bubble {
  background: var(--accent);
  color: #05261f;
  border-color: #00D4A0;
}
.chat-bubble.typing {
  color: var(--text-secondary);
}
.btn.pulse {
  animation: pulseGlow 1.2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 #00D4A020; }
  50% { box-shadow: 0 0 0 10px #00D4A000; }
}
.chat-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
  font-size: .88rem;
  color: var(--text-secondary);
}
.chat-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #202033;
  overflow: hidden;
}
.chat-progress-fill {
  height: 100%;
  width: 60%;
  background: var(--gradient-btn);
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-secondary);
  animation: typingPulse 900ms infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 120ms; }
.typing-dots span:nth-child(3) { animation-delay: 240ms; }
@keyframes typingPulse {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.live-preview {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-secondary);
  min-height: 500px;
  padding: 1rem;
}

/* Overlay de geração */
.gen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.78);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 180;
  opacity: 1;
  transition: opacity .18s ease;
}
.gen-overlay.out { opacity: 0; }
.gen-overlay-card {
  width: min(92vw, 520px);
  background: linear-gradient(160deg, #111118, #0C0C13);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.3rem 1.35rem;
  text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,.45);
}
.gen-overlay-card h3 {
  margin: .4rem 0 .35rem;
}
.gen-overlay-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .92rem;
}
.gen-figures {
  display: flex;
  justify-content: center;
  gap: .7rem;
}
.gen-figures .f {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1A1A24;
  border: 1px solid #2A2A3A;
  font-size: 1.25rem;
  animation: floatY 1200ms ease-in-out infinite;
}
.gen-figures .f2 { animation-delay: 140ms; }
.gen-figures .f3 { animation-delay: 280ms; }
.gen-loader {
  margin-top: .95rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.gen-loader span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #00D4A0;
  animation: loaderDot .9s ease-in-out infinite;
}
.gen-loader span:nth-child(2) { animation-delay: .12s; }
.gen-loader span:nth-child(3) { animation-delay: .24s; }
@keyframes loaderDot {
  0%, 80%, 100% { transform: scale(.6); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Footer */
.site-footer {
  background: #07070b;
  border-top: 1px solid var(--border);
}
.footer-grid { border-bottom-color: #1f1f31; }
.footer-grid a { color: var(--text-secondary); }
.footer-grid a:hover { color: var(--accent); }
.footer-copy,
.footer-support { color: var(--text-secondary); }

/* Animacoes de entrada (intersection observer) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s ease, transform .35s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsividade */
@media (max-width: 1280px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .generator-layout { grid-template-columns: 1fr; }
  .preview-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .plans-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 3.5rem; }
}
@media (max-width: 480px) {
  .categories-grid { grid-template-columns: 1fr; }
}
