/* PdfLovers — estilo global. Um único arquivo, sem dependências. */

:root {
  --brand: #e11d48;
  --brand-2: #fb7185;
  --brand-ink: #9f1239;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1017;
    --surface: #171a22;
    --surface-2: #1f2430;
    --text: #e8eaf0;
    --muted: #9aa2b1;
    --border: #2a2f3a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-size: 16px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, .35);
}
.logo .word { line-height: 1; letter-spacing: -.2px; }
.logo b { color: var(--brand); font-weight: inherit; }
.site-nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-radius: 9px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

/* Celular: logo em cima e nav vira trilho rolável na horizontal, em vez de
   quebrar em várias linhas dentro da faixa de 62px */
@media (max-width: 760px) {
  .site-header .wrap { height: auto; flex-wrap: wrap; gap: 0; padding-top: 10px; }
  .logo { font-size: 18px; }
  .site-nav {
    flex: 1 1 100%; margin: 6px -20px 0; padding: 0 20px 10px;
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 56px 0 30px; }
.hero h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.5px; }
.hero p { font-size: clamp(15px, 2.4vw, 19px); color: var(--muted); max-width: 640px; margin: 0 auto; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px;
  font-size: 13px; font-weight: 600; color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  padding: 6px 13px; border-radius: 999px;
}
@media (prefers-color-scheme: dark) { .hero .badge { color: var(--brand-2); } }

/* ---------- Grade de ferramentas ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; padding: 24px 0 60px;
}
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; display: block;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tool-card:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
}
.tool-card .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 13px; background: var(--surface-2); font-size: 22px;
}
.tool-card h3 { margin: 0 0 5px; font-size: 16.5px; color: var(--text); }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 30px 0 4px; font-weight: 700; }

/* ---------- Página de ferramenta ---------- */
.tool-hero { text-align: center; padding: 40px 0 8px; }
.tool-hero .ic-lg {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 8px 24px rgba(225, 29, 72, .3);
}
.tool-hero h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 8px; letter-spacing: -.4px; }
.tool-hero p { color: var(--muted); font-size: 16px; max-width: 560px; margin: 0 auto; }

.tool-panel {
  max-width: 760px; margin: 26px auto 60px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 24px;
}

/* Dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--border));
  border-radius: 14px; padding: 44px 20px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: background .12s, border-color .12s;
}
.dropzone .dz-ic, .dropzone strong, .dropzone span { width: 100%; }
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface-2));
}
.dropzone .dz-ic { font-size: 40px; margin-bottom: 8px; }
.dropzone strong { display: block; font-size: 17px; margin-bottom: 4px; }
.dropzone span { color: var(--muted); font-size: 14px; }
.dropzone input { display: none; }

/* Lista de arquivos */
.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
}
.file-item.dragging { opacity: .5; }
.file-item .grip { cursor: grab; color: var(--muted); font-size: 18px; user-select: none; }
.file-item .fi-ic { font-size: 22px; }
.file-item .fi-meta { flex: 1; min-width: 0; }
.file-item .fi-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .fi-size { font-size: 12.5px; color: var(--muted); }
.file-item .fi-x {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.file-item .fi-x:hover { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); }

/* Opções */
.options { margin-top: 20px; display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.field input[type=text], .field input[type=number], .field input[type=password], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 14.5px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.radio-row, .check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted); background: var(--surface); user-select: none;
}
.seg:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.seg.active { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.seg input { display: none; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: 12px; padding: 14px 22px; font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: filter .12s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; filter: none; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.actions { margin-top: 22px; }

/* Progresso */
.progress { margin-top: 20px; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s ease; }
.progress-msg { margin-top: 8px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* Resultado */
.result { margin-top: 22px; text-align: center; }
.result .ok-ic { font-size: 46px; }
.result h3 { margin: 6px 0 4px; }
.result p { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.result .dl-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

/* Pré-visualização do resultado */
.result-preview { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0 18px; }
.preview-card { width: 130px; }
.preview-thumb {
  position: relative; width: 130px; height: 168px; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center;
}
.preview-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.preview-badge {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.66); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 6px; font-weight: 600;
}
.preview-fallback { font-size: 42px; }
.preview-spin { color: var(--muted); font-size: 20px; }
.preview-cap { font-size: 11.5px; color: var(--muted); margin-top: 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-more { align-self: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.preview-loading { color: var(--muted); font-size: 13.5px; padding: 10px; }
.preview-thumb.clickable { cursor: zoom-in; transition: border-color .12s, transform .12s; }
.preview-thumb.clickable:hover { border-color: var(--brand); transform: translateY(-2px); }
.preview-thumb.clickable::after {
  content: '🔍'; position: absolute; top: 6px; left: 6px; font-size: 12px;
  background: rgba(0,0,0,.6); color: #fff; padding: 2px 6px; border-radius: 6px; pointer-events: none;
}

/* Visualizador em tela cheia (conferir antes de baixar) */
.viewer-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(8,10,15,.86);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(2px);
}
.viewer-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  width: min(960px, 96vw); height: min(92vh, 1000px); display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.viewer-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.viewer-title { font-weight: 600; font-size: 14.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-close {
  border: none; background: var(--surface-2); color: var(--text); cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; font-size: 16px; flex: 0 0 auto;
}
.viewer-close:hover { color: var(--err); }
.viewer-stage {
  flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px;
  background: var(--surface-2); overflow: auto;
}
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.25); background: #fff; }
.viewer-msg { color: var(--muted); font-size: 14px; text-align: center; padding: 24px; }
.viewer-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.viewer-nav .btn { padding: 9px 16px; font-size: 14px; }
.viewer-nav .btn:disabled { opacity: .45; cursor: default; }
.viewer-page { font-weight: 700; font-size: 14px; min-width: 74px; text-align: center; }

/* Avisos */
.notice { padding: 12px 14px; border-radius: 11px; font-size: 13.5px; margin-top: 16px; }
.notice-info { background: color-mix(in srgb, #3b82f6 12%, transparent); color: #1d4ed8; }
.notice-err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
@media (prefers-color-scheme: dark) { .notice-info { color: #93c5fd; } }

.hidden { display: none !important; }

/* ---------- Rodapé ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.site-footer .wrap { padding: 34px 20px; display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 44px; }
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--text); font-size: 14px; }
.site-footer .copy { color: var(--muted); font-size: 13px; }
.privacy-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent);
  padding: 7px 13px; border-radius: 999px;
}

/* ---------- Conteúdo (home + artigos/guias) ---------- */
.section-band { padding: 40px 0 10px; }
.band-title { font-size: clamp(22px, 3.4vw, 30px); text-align: center; margin: 26px 0 22px; letter-spacing: -.3px; }

.steps-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 20px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step-n {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); margin-bottom: 12px;
}
.step h3 { margin: 0 0 5px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding: 20px 0 10px; }
.feature { padding: 22px; }
.feature .fic { font-size: 30px; margin-bottom: 8px; }
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* FAQ (accordion nativo) */
.faq { padding: 20px 0 50px; max-width: 780px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 15px 18px; font-weight: 600; font-size: 15.5px; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--brand); font-weight: 700; font-size: 20px; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-a { padding: 0 18px 16px; color: var(--muted); font-size: 14.5px; }

/* Artigos / guias */
.article { max-width: 780px; margin: 30px auto 20px; }
.article-guide { margin-top: 10px; }
.article h1 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.4px; margin: 6px 0 14px; }
.article h2 { font-size: 22px; margin: 32px 0 12px; letter-spacing: -.2px; }
.article p { font-size: 16px; color: var(--text); }
.article .lead { font-size: 18px; color: var(--muted); }
.article ol.steps, .article ul.tips { padding-left: 22px; }
.article ol.steps li, .article ul.tips li { margin: 8px 0; font-size: 15.5px; }
.article .tools-grid { padding: 8px 0 30px; }
.guide-link { font-weight: 600; }

.crumbs { font-size: 13.5px; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

.cta-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  border-radius: 14px; padding: 18px 20px; margin: 24px 0;
}
.cta-band span { font-weight: 700; font-size: 16px; }
.cta-band .btn { padding: 11px 20px; font-size: 15px; }

/* Bloco de anúncio (AdSense) — reservado, some se não houver anúncio */
.ad-slot { display: block; margin: 22px auto; min-height: 0; text-align: center; }

/* Blog */
.blog-list { list-style: none; margin: 20px auto 50px; padding: 0; max-width: 780px; display: grid; gap: 14px; }
.blog-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; transition: border-color .12s, transform .12s, box-shadow .12s;
}
.blog-item:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow); }
.blog-title { font-size: 18px; font-weight: 700; color: var(--text); display: inline-block; }
.blog-title:hover { color: var(--brand); text-decoration: none; }
.blog-resumo { margin: 6px 0 8px; color: var(--muted); font-size: 14.5px; }
.blog-date { font-size: 12.5px; color: var(--muted); }
.blog-post .blog-meta { color: var(--muted); font-size: 13.5px; }
.blog-post .blog-meta a { color: var(--muted); }
.blog-post .blog-meta a:hover { color: var(--brand); }
.article .blog-list { margin: 12px 0 20px; }
.article code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 90%; }

/* Blog: cartões com miniatura */
.blog-item-thumb { display: flex; gap: 16px; align-items: center; padding: 14px; }
.blog-thumb-link { flex: 0 0 auto; display: block; }
.blog-thumb { width: 160px; height: auto; aspect-ratio: 1200 / 628; object-fit: cover; border-radius: 10px; display: block; }
.blog-item-text { flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .blog-item-thumb { flex-direction: column; align-items: stretch; }
  .blog-thumb { width: 100%; }
}

/* Blog: imagens do artigo */
.blog-cover { width: 100%; height: auto; aspect-ratio: 1200 / 628; object-fit: cover; border-radius: 14px; margin: 16px 0 10px; display: block; box-shadow: var(--shadow); }
.blog-figure { margin: 26px 0; }
.blog-body-img { width: 100%; height: auto; border-radius: 12px; display: block; border: 1px solid var(--border); }

/* Tabela de cookies / legal */
.legal-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 14px; }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; vertical-align: top; }
.legal-table th { background: var(--surface-2); font-weight: 700; }

/* Aviso de cookies (LGPD) */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(16,24,40,.12);
}
.cookie-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cookie-inner p { margin: 0; flex: 1 1 340px; font-size: 13.5px; color: var(--muted); }
.cookie-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-actions .btn { padding: 10px 18px; font-size: 14px; }
@media (max-width: 560px) {
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}
