/* ========================================
   NotionIA — estilo base
   ======================================== */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-alt: #f5f5f4;
  --text: #18181b;
  --text-muted: #71717a;
  --border: #e4e4e7;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 1rem; }
h1 { font-size: clamp(1.75rem, 3vw + 1rem, 3rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1rem; }
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.lead { font-size: 1.125rem; color: var(--text-muted); max-width: 680px; }
.gradient { background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pill { display: inline-block; background: var(--primary-light); color: var(--primary-dark); padding: 0.3rem 0.85rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; margin-bottom: 1rem; }
.hidden { display: none !important; }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Header */
.site-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 1.25rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white; display: inline-grid; place-items: center; font-weight: 900; font-size: 0.9rem;
}
.brand-name { letter-spacing: -0.02em; font-size: 1.1rem; }
.nav-links { display: flex; gap: 1.25rem; margin-left: 2rem; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.nav-burger { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 800px) {
  .nav-links, .nav-actions { display: none; }
  .nav-burger { display: block; margin-left: auto; }
  .nav.open .nav-links, .nav.open .nav-actions { display: flex; flex-direction: column; width: 100%; align-items: stretch; margin: 1rem 0 0; }
  .nav.open { flex-wrap: wrap; }
}

/* Flash */
.flash { padding: 0.85rem 1.25rem; text-align: center; font-weight: 500; }
.flash-success { background: #ecfdf5; color: var(--success); }
.flash-error { background: #fef2f2; color: var(--danger); }
.flash-info { background: var(--primary-light); color: var(--primary-dark); border-radius: var(--radius-sm); margin-bottom: 1rem; }

/* Hero */
.hero { padding: 4rem 0 3rem; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { margin-bottom: 1.25rem; }
.hero .cta-row { display: flex; gap: 0.75rem; margin: 1.5rem 0; flex-wrap: wrap; }
.hero-bullets { list-style: none; padding: 0; display: grid; gap: 0.5rem; color: var(--text-muted); }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.5rem; }

.mock .mock-top { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.mock .mock-top span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.mock .mock-line { height: 10px; background: var(--surface-alt); border-radius: 4px; margin: 0.6rem 0; }
.mock .mock-line.long { width: 90%; }
.mock .mock-line.medium { width: 65%; }
.mock .mock-line.short { width: 40%; }
.mock .mock-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 1rem 0; }
.mock .mock-grid > div { height: 60px; background: var(--surface-alt); border-radius: 6px; }

@media (max-width: 800px) { .hero-grid { grid-template-columns: 1fr; } }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--surface-alt); }
.section-cta { background: linear-gradient(135deg, var(--primary-light), #faf5ff); }
.section h2 { font-size: 2rem; margin-bottom: 1.5rem; }

/* Cards "como funciona" */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.how-grid article { background: var(--surface); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.how-grid .step { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; display: grid; place-items: center; font-weight: 700; margin-bottom: 0.75rem; }
@media (max-width: 800px) { .how-grid { grid-template-columns: 1fr; } }

/* Planos */
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 2rem; }
.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  display: flex; flex-direction: column;
  transition: var(--transition);
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.plan-card .price { font-size: 1.75rem; font-weight: 800; margin: 0.75rem 0 1rem; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.plan-card ul li { padding: 0.4rem 0; border-bottom: 1px dashed var(--border); font-size: 0.925rem; color: var(--text-muted); }
.plan-card .btn { margin-top: auto; }
.plan-featured { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-6px); }
.plan-featured:hover { transform: translateY(-8px); }
.plan-tag { position: absolute; top: -10px; right: 1rem; background: var(--primary); color: white; padding: 0.2rem 0.7rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
@media (max-width: 1000px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .plans-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq { margin-top: 3rem; max-width: 760px; margin-inline: auto; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.75rem; padding: 1rem 1.25rem; }
.faq summary { font-weight: 600; cursor: pointer; }

/* Auth */
.auth-container { max-width: 460px; margin: 0 auto; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.auth-foot { margin-top: 1.25rem; text-align: center; color: var(--text-muted); }

/* Form */
.form label { display: block; margin-bottom: 1rem; }
.form label > span { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--text); }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  transition: var(--transition);
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form .checkbox { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.9rem; color: var(--text-muted); }
.form .checkbox input { width: auto; margin-top: 0.2rem; }
@media (max-width: 500px) { .form .row { grid-template-columns: 1fr; } }

/* Dashboard */
.dash-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-label { display: block; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; }
.stat-value { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 800px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.muted-form { display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; color: var(--text-muted); }

/* Tabela */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 2rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table th { background: var(--surface-alt); font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.03em; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-alt); }

.chip { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--surface-alt); }
.chip-installed { background: #ecfdf5; color: var(--success); }
.chip-failed { background: #fef2f2; color: var(--danger); }
.chip-generated { background: var(--primary-light); color: var(--primary-dark); }
.chip-draft { background: var(--surface-alt); color: var(--text-muted); }

.empty { background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius); padding: 3rem 1rem; text-align: center; }

/* Gerador / Chat */
.generator-wrap { max-width: 960px; margin: 0 auto; }
.gen-head { margin-bottom: 1.5rem; }

.chat-area { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-height: 500px; }
.chat-messages { padding: 1.5rem; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.85rem; max-height: 60vh; }
.chat-message { display: flex; }
.chat-message.from-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 75%; padding: 0.8rem 1.1rem; border-radius: 18px;
  background: var(--surface-alt); color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
  animation: popIn 0.25s ease;
}
.from-user .chat-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.from-assistant .chat-bubble { border-bottom-left-radius: 4px; }
.chat-bubble.typing { color: var(--text-muted); font-style: italic; }
@keyframes popIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.chat-controls { border-top: 1px solid var(--border); padding: 0.85rem; display: flex; gap: 0.5rem; align-items: flex-end; background: var(--surface-alt); }
.chat-controls textarea {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem; resize: none; font-family: inherit; font-size: 0.95rem;
  background: white;
}

.chat-cta { border-top: 1px solid var(--border); padding: 1rem 1.25rem; text-align: center; background: var(--primary-light); }

/* Resultado */
.result-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.feedback { display: inline-flex; gap: 0.5rem; align-items: center; margin-left: auto; }

.preview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.notion-preview .np-root { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.notion-preview .np-title { display: flex; align-items: center; gap: 0.75rem; }
.notion-preview .np-title h2 { margin: 0; font-size: 1.75rem; }
.notion-preview .np-icon { font-size: 1.5rem; }
.notion-preview .np-desc { color: var(--text-muted); margin-top: 0.5rem; }

.np-page { margin-bottom: 2rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.np-page header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.np-page header h3 { margin: 0; }
.np-badge { margin-left: auto; background: var(--primary-light); color: var(--primary-dark); padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }

.np-db { overflow-x: auto; background: white; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.np-db table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.np-db th, .np-db td { padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--border); text-align: left; }
.np-db th { background: var(--surface-alt); font-weight: 600; }
.np-db th small { color: var(--text-muted); font-weight: 400; }

.np-blocks { background: white; border-radius: var(--radius-sm); padding: 1.25rem; border: 1px solid var(--border); }
.np-h1 { font-size: 1.5rem; margin: 1rem 0 0.5rem; }
.np-h2 { font-size: 1.25rem; margin: 1rem 0 0.5rem; }
.np-h3 { font-size: 1.1rem; margin: 0.75rem 0 0.4rem; }
.np-p { margin: 0.4rem 0; }
.np-bullet, .np-num { margin: 0.25rem 0; padding-left: 0.5rem; }
.np-todo { display: flex; align-items: center; gap: 0.5rem; margin: 0.3rem 0; }
.np-quote { border-left: 3px solid var(--primary); margin: 0.6rem 0; padding: 0.25rem 0 0.25rem 1rem; color: var(--text-muted); }
.np-callout { display: flex; gap: 0.65rem; padding: 0.8rem 1rem; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary-dark); margin: 0.6rem 0; }
.np-callout-icon { font-size: 1.1rem; }
.np-divider { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.np-toggle { margin: 0.5rem 0; }
.np-code { background: #1e293b; color: #e2e8f0; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; }

/* Checkout & status */
.checkout-wrap { max-width: 560px; margin: 0 auto; }
.checkout-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.checkout-card .plan-summary { background: var(--primary-light); padding: 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; }
.checkout-card .plan-summary h2 { margin: 0 0 0.5rem; font-size: 1.25rem; color: var(--primary-dark); }
.checkout-card .plan-summary .price { font-size: 2rem; font-weight: 800; }
.checkout-card .plan-summary ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.checkout-card .plan-summary li { padding: 0.25rem 0; color: var(--primary-dark); }

.status-icon { font-size: 4rem; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; margin: 1rem auto; }
.status-success { background: #dcfce7; color: var(--success); }
.status-pending { background: #fef9c3; color: var(--warn); }
.status-error { background: #fee2e2; color: var(--danger); }

/* Referral */
.referral-box { display: flex; gap: 0.5rem; margin-top: 1rem; }
.referral-box input { flex: 1; padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-family: monospace; font-size: 0.9rem; }

/* Vitrine */
.cat-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0 2rem; }
.cat-filter a { padding: 0.4rem 0.85rem; border-radius: 999px; background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); font-size: 0.9rem; }
.cat-filter a.active { background: var(--primary); color: white; border-color: var(--primary); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.gallery-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; color: var(--text); transition: var(--transition); }
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.gallery-card h4 { margin: 0 0 0.35rem; }
.gallery-meta { margin-top: 0.75rem; font-weight: 600; color: var(--primary-dark); }

/* Preview bloqueado */
.preview-locked { margin-top: 2rem; background: linear-gradient(135deg, var(--primary-light), #faf5ff); padding: 2rem; border-radius: var(--radius); text-align: center; }
.preview-locked h3 { margin-top: 0; }

/* Footer */
.site-footer { background: var(--text); color: #d4d4d8; padding: 3rem 0 1.5rem; margin-top: 4rem; }
.site-footer .brand { color: white; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid #3f3f46; }
.footer-grid h4 { color: white; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: 0.2rem 0; }
.footer-grid a { color: #a1a1aa; font-size: 0.9rem; }
.footer-grid a:hover { color: white; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.footer-copy { color: #71717a; font-size: 0.85rem; margin: 0; }
.footer-support { color: #a1a1aa; font-size: 0.85rem; margin: 0; }
.footer-support a { color: #d4d4d8; }
.footer-support a:hover { color: white; }
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* Cookie banner */
[hidden] { display: none !important; }

.cookie-banner {
  position: fixed; bottom: 1rem; left: 1rem; right: 1rem; max-width: 520px; margin: 0 auto;
  background: var(--text); color: white; padding: 1rem 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; gap: 1rem; align-items: center; z-index: 100;
}
.cookie-banner p { margin: 0; font-size: 0.85rem; flex: 1; }
.cookie-banner a { color: white; text-decoration: underline; }
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Content (legal) */
.content { max-width: 760px; margin: 0 auto; }
.content h2 { margin-top: 2rem; font-size: 1.25rem; }
.content ul li { margin-bottom: 0.35rem; }
