/* ===== Macaco Velho — tema dark minimalista ===== */
:root {
  --bg: #0e1116;
  --bg-soft: #161b22;
  --bg-card: #1a2029;
  --border: #2a313c;
  --border-soft: #232a33;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --text-faint: #6b7682;
  --accent: #f0a83c;       /* amarelo "banana" */
  --accent-2: #5ac8a8;     /* verde discreto */
  --danger: #f4685f;
  --radius: 12px;
  --maxw: 1080px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(14,17,22,0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 14px;
  height: 60px;
}
.brand {
  display: flex; align-items: center;
  font-weight: 700; font-size: 18px; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo { font-size: 24px; margin-right: 10px; }
.brand b { color: var(--accent); }
.brand .tld { color: var(--text-faint); font-weight: 500; }
.header-spacer { flex: 1; }
.header-link { color: var(--text-dim); font-size: 14px; white-space: nowrap; }
.header-tagline { color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; }
.header-tagline b, .header-tagline .hl { color: var(--accent); }
/* o texto central (branco, em destaque) tem prioridade: quando aperta, some primeiro o selo da direita; só em tela bem pequena o central some */
@media (max-width: 900px) { .header-link { display: none; } }
@media (max-width: 640px) { .header-tagline { display: none; } }

/* ===== Hero ===== */
.hero { text-align: center; padding: 54px 0 30px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -0.5px; }
.hero h1 .logo { font-size: 34px; }
.hero p { color: var(--text-dim); font-size: 16px; margin: 0 auto; max-width: 620px; }
.hero .pledge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 7px 14px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; color: var(--text-dim);
}
.hero .pledge b { color: var(--accent-2); font-weight: 600; }

/* ===== Busca ===== */
.search-box {
  display: flex; align-items: center; gap: 10px;
  max-width: 520px; margin: 26px auto 0;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 16px;
}
.search-box .icon { color: var(--text-faint); }

/* ===== Grid de ferramentas ===== */
.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-faint); margin: 40px 0 14px; font-weight: 600;
}
.grid {
  display: grid; gap: 9px; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 5px;
  min-height: 80px; padding: 12px 9px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .12s, border-color .12s, background .12s;
}
.card:hover {
  text-decoration: none; transform: translateY(-2px);
  border-color: var(--accent); background: #1e242e;
}
.card .card-icon { font-size: 25px; line-height: 1; }
.card h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.25; }
/* descrição = tooltip flutuante no hover (não empurra o layout) */
.card p {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: 220px;
  margin: 0; padding: 8px 11px; font-size: 12px; line-height: 1.4;
  color: var(--text-dim); background: #0b0d10;
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 30;
  transition: opacity .14s;
}
.card:hover p { opacity: 1; visibility: visible; }
/* telas de toque (sem mouse): tooltip não funciona, então só o nome aparece */
@media (hover: none) { .card p { display: none; } }
.card.hidden { display: none !important; }
/* "encolher" categorias grandes: esconde as extras até clicar em "mostrar mais" */
.card.extra { display: none; }
.grid.aberta .card.extra { display: flex; }
#painel.buscando .card.extra { display: flex; }
.mostrar-mais {
  display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 2px;
  padding: 7px 16px; font-size: 13px; cursor: pointer;
  background: var(--bg-soft); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px; transition: border-color .12s, color .12s;
}
.mostrar-mais:hover { border-color: var(--accent); color: var(--text); }
#painel.buscando .mostrar-mais { display: none; }
.no-results { color: var(--text-dim); padding: 20px 0; display: none; }

/* estrela de favoritar (canto superior direito do card) */
.fav-star {
  position: absolute; top: 7px; right: 8px;
  background: none; border: none; padding: 2px;
  font-size: 17px; line-height: 1; cursor: pointer;
  color: var(--text-faint); z-index: 6;
  transition: color .12s, transform .1s;
}
.fav-star:hover { color: var(--accent); transform: scale(1.18); }
.fav-star.on { color: var(--accent); }

/* ===== Selo "MAIS USADO" (faixa de canto) ===== */
/* caixinha no canto superior esquerdo com overflow próprio (não corta o tooltip da descrição) */
.selo-wrap {
  position: absolute; top: 0; left: 0; width: 66px; height: 66px;
  overflow: hidden; pointer-events: none; z-index: 4;
  border-top-left-radius: var(--radius);
}
.selo-wrap .selo {
  position: absolute; top: 15px; left: -23px;
  width: 108px; text-align: center;       /* largura fixa + centralizado = texto nunca encosta na borda */
  transform: rotate(-45deg);
  padding: 3px 0; font-size: 8.5px; font-weight: 800; letter-spacing: .3px;
  color: #1a1205; background: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* subcategorias dentro de uma categoria */
.subcat { margin-top: 14px; }
.sub-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  margin: 0 0 10px; padding-left: 2px;
}
.sub-title::before { content: "\21B3"; color: var(--text-faint); }

/* ===== Página de ferramenta ===== */
.tool-head { padding: 30px 0 10px; }
.breadcrumb { font-size: 13px; color: var(--text-faint); margin-bottom: 14px; }
.tool-head h1 { font-size: 26px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.tool-head p { color: var(--text-dim); margin: 0; }

/* lista de capacidades (ex.: Editar PDF) */
.cap-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.cap-list li { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px; font-size: 13px; color: var(--text-dim); }

/* selo "Online e ilimitado · use à vontade · 100% seguro" */
.tool-badges { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; font-size: 13px; color: var(--text-dim); }
.tool-badges span { display: inline-flex; align-items: center; gap: 6px; }
.tool-badges span::before { content: "\2713"; color: var(--accent-2); font-weight: 700; }

.panel {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin: 22px 0;
}
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 240px; }

label.field { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }

textarea, input[type=text], input[type=number], select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 200px; font-family: "Consolas", "SF Mono", Menlo, monospace; font-size: 13.5px; line-height: 1.5; }
.mono { font-family: "Consolas", "SF Mono", Menlo, monospace; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: #1a1205; border: none;
  border-radius: 9px; padding: 11px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: filter .12s, transform .05s; font-family: inherit;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--accent); filter: none; }
.btn.ghost { background: none; color: var(--text-dim); border: 1px solid var(--border); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* checkboxes / opções */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text); cursor: pointer; }
.opt input { width: 16px; height: 16px; accent-color: var(--accent); }
.inline-opts { display: flex; gap: 18px; flex-wrap: wrap; }

/* range */
input[type=range] { width: 100%; accent-color: var(--accent); }

/* dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; color: var(--text-dim);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--bg-card); }
.dropzone .dz-icon { font-size: 36px; }
.dropzone b { color: var(--text); }
.dropzone input[type=file] { display: none; }

/* lista de arquivos */
.file-list { margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 13px; font-size: 14px;
}
.file-item .fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-size { color: var(--text-faint); font-size: 12px; }
.file-item .fi-handle { cursor: grab; color: var(--text-faint); }
.file-item .fi-del { cursor: pointer; color: var(--text-faint); background: none; border: none; font-size: 16px; }
.file-item .fi-del:hover { color: var(--danger); }
.file-item.dragging { opacity: .5; }

/* status / mensagens */
.status { font-size: 14px; margin-top: 12px; min-height: 20px; }
.status.ok { color: var(--accent-2); }
.status.err { color: var(--danger); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: rgba(90,200,168,.15); color: var(--accent-2); }
.badge.err { background: rgba(244,104,95,.15); color: var(--danger); }

.stat { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.stat div { font-size: 13px; color: var(--text-dim); }
.stat b { display: block; font-size: 22px; color: var(--text); font-weight: 700; }

.qr-out { display: flex; justify-content: center; padding: 20px; background: #fff; border-radius: var(--radius); }
.qr-out img, .qr-out canvas { display: block; max-width: 100%; }

.thumbs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); margin-top: 16px; }
.thumb { background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px; padding: 10px; text-align: center; }
.thumb img { max-width: 100%; border-radius: 5px; }
.thumb .btn { margin-top: 8px; width: 100%; padding: 7px; font-size: 12.5px; }

.page-card { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px; padding: 8px; text-align: center; }
.page-card.removed { opacity: .35; }
.page-card canvas { max-width: 100%; border-radius: 4px; background:#fff; }
.page-card .pc-num { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.page-card .pc-ctrls { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.page-card .pc-ctrls button { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-dim); border-radius: 6px; cursor: pointer; padding: 3px 8px; font-size: 12px; }
.page-card .pc-ctrls button:hover { border-color: var(--accent); color: var(--text); }

.note {
  font-size: 13px; color: var(--text-dim);
  background: var(--bg-card); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 12px 14px; margin-top: 16px;
}

footer.site-footer {
  border-top: 1px solid var(--border-soft); margin-top: 60px;
  padding: 26px 0; color: var(--text-faint); font-size: 13px; text-align: center;
}
.site-footer .foot-links { margin-bottom: 8px; }
.site-footer .foot-links a { color: var(--text-dim); }
.site-footer .foot-links a:hover { color: var(--accent); }

/* ===== Seletor de temas ===== */
.tema-btn {
  background: none; border: 2px solid var(--text-faint); color: var(--text-dim);
  border-radius: 999px; height: 34px; min-width: 34px; padding: 0 13px;
  cursor: pointer; font-size: 13.5px; font-weight: 600; line-height: 1; transition: border-color .12s, color .12s;
}
.tema-btn:hover { border-color: var(--accent); color: var(--text); }
.tema-menu {
  display: none; position: fixed; z-index: 100; min-width: 190px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.tema-menu.aberto { display: block; }
.tema-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text-dim); padding: 9px 12px; border-radius: 7px; cursor: pointer;
  font-size: 14px; font-family: inherit;
}
.tema-item:hover { background: var(--bg-card); color: var(--text); }
.tema-item.on { color: var(--accent); font-weight: 700; }

/* paletas (o padrão "escuro" usa o :root lá em cima) */
html[data-tema="claro"] {
  --bg: #f4f6f9; --bg-soft: #ffffff; --bg-card: #ffffff;
  --border: #d7dee6; --border-soft: #e6ebf0;
  --text: #1a2029; --text-dim: #4a5560; --text-faint: #7b8693;
  --accent: #d98a17; --accent-2: #1f9d78;
}
html[data-tema="claro"] .site-header { background: rgba(255,255,255,.85); }
html[data-tema="claro"] .card:hover { background: #eef2f7; }

html[data-tema="sepia"] {
  --bg: #f1e7d0; --bg-soft: #ece0c4; --bg-card: #f7efdc;
  --border: #d8c7a0; --border-soft: #e2d4b4;
  --text: #43341f; --text-dim: #6b5839; --text-faint: #9a875f;
  --accent: #b9781a; --accent-2: #4a8f5f;
}
html[data-tema="sepia"] .site-header { background: rgba(241,231,208,.88); }
html[data-tema="sepia"] .card:hover { background: #efe4ca; }

html[data-tema="contraste"] {
  --bg: #000000; --bg-soft: #0b0b0b; --bg-card: #141414;
  --border: #4a4a4a; --border-soft: #2c2c2c;
  --text: #ffffff; --text-dim: #dcdcdc; --text-faint: #9a9a9a;
  --accent: #ffcc33; --accent-2: #4fd6b0;
}
html[data-tema="contraste"] .site-header { background: rgba(0,0,0,.92); }
html[data-tema="contraste"] .card:hover { background: #1c1c1c; }

/* ===== Home: barra de filtro (categorias + busca menor) ===== */
.filterbar { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding: 22px 0 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; align-items: center; justify-content: center; }
.chip {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); cursor: pointer;
  background: var(--bg-soft); white-space: nowrap; transition: border-color .12s, color .12s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { background: var(--accent); color: #1a1205; border-color: var(--accent); font-weight: 700; }
/* "Mais usadas" fica neutro quando desligado (só a ⭐ o diferencia); verde só quando ativo */
.chip-mu:hover { border-color: var(--accent-2); color: var(--text); }
.chip-mu.on { background: var(--accent-2); color: #06241c; border-color: var(--accent-2); }
.search-mini {
  display: flex; align-items: center; gap: 8px; width: 230px; flex: 0 0 auto;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 6px 15px;
  transition: border-color .15s;
}
.search-mini:focus-within { border-color: var(--accent); }
.search-mini .icon { color: var(--text-faint); font-size: 13px; }
.search-mini input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 14px; line-height: 1.4; }
/* busca centralizada logo abaixo das categorias */
.busca-central { display: flex; justify-content: center; margin: 10px 0 4px; }
.busca-central .search-mini { width: min(340px, 92%); }
/* título da home agora aparece no cabeçalho; aqui fica oculto (mantido pra SEO/acessibilidade) */
.home-h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.home-intro { text-align: center; max-width: 680px; margin: 0 auto 6px; color: var(--text-faint); font-size: 14.5px; line-height: 1.55; }
.home-intro b { color: var(--text); }
.pop-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin: 28px 0 14px; font-weight: 700; }

/* pledge no rodapé */
.pledge-foot { text-align: center; margin: 50px 0 0; }
.pledge-foot .pledge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px;
  font-size: 13.5px; color: var(--text-dim);
}
.pledge-foot .pledge b { color: var(--accent-2); font-weight: 700; }

/* ===== Ferramenta em 2 colunas (carregar + opções) ===== */
.tool-cols { display: flex; gap: 18px; align-items: flex-start; margin: 20px 0; }
.tool-cols .col-load { flex: 1.6; min-width: 0; margin: 0; }
.tool-cols .col-opts { flex: 1; min-width: 0; margin: 0; }
.opts-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); font-weight: 700; margin: 0 0 14px; }
.btn-stack { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.btn-stack .btn { width: 100%; }

@media (max-width: 760px) {
  .tool-cols { flex-direction: column; }
}
@media (max-width: 620px) {
  .search-mini { width: 100%; }
  .chip-mu { margin-left: 0; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .tool-head h1 { font-size: 22px; }
}
