/* ===== TokenSaver — tema dev/dark ===== */

:root {
  --bg: #0f1115;
  --surface: #161a21;
  --surface-2: #1d222c;
  --border: #2a303c;
  --text: #e7eaf0;
  --text-dim: #9aa3b2;
  --accent: #a78bfa;
  --accent-strong: #8b5cf6;
  --accent-ink: #1a1030;
  --danger: #f87171;
  --radius: 12px;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

/* display nas classes (flex/grid) não pode vencer o atributo hidden */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
  min-height: 100vh;
}

.mono { font-family: var(--font-mono); }

/* ===== Topbar ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 8px;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.04em;
}

.brand-name em {
  font-style: normal;
  color: var(--accent);
}

/* ===== Navegação ===== */

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 18px;
  padding: 4px 10px;
  cursor: pointer;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.usage-pill {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

.usage-pill.pill-unlimited {
  color: var(--accent);
  border-color: var(--accent-strong);
}

.usage-pill.pill-exhausted { color: var(--danger); }

/* ===== Hero ===== */

.hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}

.hero-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0 auto 28px;
  font-size: 16px;
  color: var(--text-dim);
  max-width: 620px;
}

.hero p strong { color: var(--text); }

.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary.btn-inline,
.btn-ghost.btn-inline {
  display: inline-block;
  width: auto;
  padding-left: 28px;
  padding-right: 28px;
}

/* ===== Como funciona ===== */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px 16px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.step h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.step p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== Layout ===== */

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ===== Campos ===== */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.label-hint { color: var(--text-dim); font-weight: 400; }

.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.field textarea.mono { font-family: var(--font-mono); font-size: 13px; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-strong);
}

.field input::placeholder,
.field textarea::placeholder { color: #5b6472; }

.field.field-error input,
.field.field-error textarea { border-color: var(--danger); }

/* ===== Botões ===== */

.btn-primary {
  display: block;
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: scale(0.99); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover { border-color: var(--accent-strong); }

.privacy-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* ===== Métricas ===== */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.metric-highlight {
  border-color: var(--accent-strong);
  background: rgba(139, 92, 246, 0.10);
}

.metric-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.metric-highlight .metric-value { color: var(--accent); }

.metric-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ===== Output ===== */

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.output-title { font-size: 14px; font-weight: 600; }

.output-wrap { position: relative; }

.output {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 560px;
  overflow-y: auto;
  min-height: 200px;
}

.output.empty-state { color: #5b6472; }

/* Paywall: blur no conteúdo bloqueado */
.output.blurred {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}

.output-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
}

.lock-icon { font-size: 28px; }

/* ===== Benefícios ===== */

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 32px 48px;
}

.benefit { text-align: center; padding: 16px; }

.benefit-icon { font-size: 28px; display: block; margin-bottom: 8px; }

.benefit h3 {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.benefit p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== Rodapé completo ===== */

.footer-full {
  border-top: 1px solid var(--border);
  padding: 48px 32px 24px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto 32px;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 8px;
  transition: color 0.15s ease;
}

.footer-col a:hover { color: var(--accent); }

.footer-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin: 10px 0 0;
  max-width: 280px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  max-width: 1100px;
  margin: 0 auto;
}

.footer-bottom strong { color: var(--accent); }

/* ===== Slot de anúncio (placeholder até aprovação do AdSense) ===== */

.ad-slot {
  max-width: 728px;
  min-height: 100px;
  margin: 48px auto; /* >= 40px de qualquer elemento interativo (política AdSense) */
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5b6472;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== Banner de cookies ===== */

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.cookie-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  flex: 1;
  min-width: 220px;
}

.cookie-banner p a { color: var(--accent); }

.cookie-actions { display: flex; gap: 8px; }

.cookie-actions .btn-primary,
.cookie-actions .btn-ghost {
  width: auto;
  display: inline-block;
  padding: 8px 18px;
  font-size: 13px;
}

/* ===== Blog: lista ===== */

.page-head {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 8px;
  text-align: center;
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p { margin: 0; color: var(--text-dim); font-size: 15px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover { border-color: var(--accent-strong); transform: translateY(-2px); }

.post-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}

.post-card p { margin: 0 0 16px; font-size: 13px; color: var(--text-dim); flex: 1; }

.post-card .post-meta { font-size: 12px; color: #5b6472; }

/* ===== Blog: artigo ===== */

.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.article h1 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.article-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article p, .article li {
  font-size: 16px;
  line-height: 1.7;
  color: #c6ccd8;
}

.article h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}

.article h3 { font-size: 18px; margin: 28px 0 8px; }

.article code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

.article pre code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.6; }

.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0;
}

.article th, .article td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.article th { color: var(--text); font-weight: 600; }
.article td { color: #c6ccd8; }

.tip-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}

.tip-box p { margin: 0; font-size: 14px; }

.tip-box strong { color: var(--accent); }

.article-cta {
  background: var(--surface);
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin: 48px 0 8px;
}

.article-cta h3 { margin: 0 0 8px; font-size: 20px; }
.article-cta p { margin: 0 0 20px; font-size: 14px; color: var(--text-dim); }

.related {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.related h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.related a {
  display: block;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 8px;
}

.related a:hover { text-decoration: underline; }

/* ===== Página institucional (texto corrido) ===== */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.legal h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 8px; }
.legal h2 { font-size: 20px; margin: 32px 0 8px; }
.legal p, .legal li { font-size: 15px; line-height: 1.7; color: #c6ccd8; }
.legal .updated { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }
.legal a { color: var(--accent); }

/* ===== Modal ===== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-badge { font-size: 40px; margin-bottom: 8px; }

.modal h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.modal-copy {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-dim);
}

.modal-price { margin-bottom: 20px; }

.price-value {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.price-note { font-size: 12px; color: var(--text-dim); }

.btn-pay { margin-bottom: 24px; }

.activate {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: left;
}

.activate label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.activate-row { display: flex; gap: 8px; }

.activate-row input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.activate-row input:focus { outline: none; border-color: var(--accent-strong); }

.activate-feedback {
  margin: 8px 0 0;
  font-size: 12px;
  min-height: 16px;
}

.activate-feedback.ok { color: var(--accent); }
.activate-feedback.err { color: var(--danger); }

/* ===== Responsivo ===== */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .panel { padding: 20px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 12px 16px; }
  .hero { padding: 40px 16px 24px; }
  .hero h1 { font-size: 30px; }
  .hero h1 br { display: none; }
  .steps, .benefits { grid-template-columns: 1fr; padding: 0 16px 8px; }
  .benefits { padding: 8px 16px 32px; }

  /* Menu vira dropdown controlado pelo hambúrguer */
  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 16px;
    right: 16px;
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
  }

  .nav.open { display: flex; }

  .nav a { padding: 12px 16px; border-radius: 8px; }
  .nav a:hover { background: var(--surface); }

  .nav-toggle { display: block; }

  .usage-pill { display: none; }

  .topbar { position: relative; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .post-grid { grid-template-columns: 1fr; padding: 16px; }
  .article h1 { font-size: 26px; }
  .page-head h1 { font-size: 26px; }
}
