/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --success: #10B981;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --danger: #EF4444;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --radius: 12px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }
a { color: var(--primary); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
}
nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  margin-left: 16px;
}
nav a:hover { color: var(--primary); }

main { flex: 1; padding: 32px 0 48px; }

.hero { text-align: center; margin-bottom: 32px; }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Social proof (contador de imagens) ---------- */
.social-proof {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 14px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 500;
}
.social-proof strong { font-weight: 700; color: #047857; }
.sp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: spDotPulse 2s infinite;
}
@keyframes spDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Ad slots ---------- */
.ad-slot {
  background: #EEF2F7;
  border: 1px dashed #CBD5E1;
  color: #94A3B8;
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin: 24px 0;
}

/* ---------- Card / dropzone ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: #fff;
  display: block;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: #EFF6FF;
}
.dropzone svg {
  width: 56px; height: 56px;
  color: var(--primary);
  margin: 0 auto 12px;
}
.dropzone h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.dropzone p { color: var(--text-muted); font-size: 0.95rem; }
.dropzone small { display: block; margin-top: 10px; color: #94A3B8; font-size: 0.8rem; }
.dropzone input[type="file"] { display: none; }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  background: #F1F5F9;
  border-radius: var(--radius);
}
.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.controls label {
  font-weight: 500;
  font-size: 0.95rem;
  min-width: 64px;
  color: var(--text);
}
.level-group { display: flex; gap: 6px; flex-wrap: wrap; }
.format-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  min-width: 200px;
}
.format-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.level-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  transition: all 0.15s ease;
}
.level-btn:hover { border-color: var(--primary); }
.level-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Upload area toggle ---------- */
#upload-area.hidden { display: none; }

/* ---------- Result ---------- */
.result { display: none; }
.result.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Batch summary ---------- */
.batch-summary {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 20px;
  margin-bottom: 16px;
}
.bs-row { margin-bottom: 10px; }
.bs-progress {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.bs-progress.bs-ok  { color: var(--success); }
.bs-progress.bs-err { color: var(--danger); }
.bs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.bs-stat { display: flex; flex-direction: column; min-width: 90px; }
.bs-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.bs-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.bs-value.bs-success { color: var(--success); }

/* ---------- File list ---------- */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}
.file-item:hover { border-color: #CBD5E1; }
.fi-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #F1F5F9;
  display: grid;
  place-items: center;
}
.fi-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fi-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fi-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fi-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  align-items: center;
}
.fi-sizes strong { color: var(--text); }
.fi-reduction {
  font-weight: 700;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 99px;
}
.fi-reduction-ok  { background: #ECFDF5; color: #047857; }
.fi-reduction-bad { background: #FEF3C7; color: #92400E; }
.fi-convert {
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: #EFF6FF;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.fi-status { display: inline-flex; align-items: center; gap: 6px; font-style: italic; }
.fi-status-err { color: var(--danger); font-style: normal; font-weight: 600; }

.fi-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.fi-download, .fi-share {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.fi-download {
  background: var(--success);
  color: #fff;
}
.fi-download:hover { background: #059669; }
.fi-share {
  background: #EFF6FF;
  color: var(--primary);
  font-size: 1rem;
}
.fi-share:hover { background: #DBEAFE; }
.fi-download-disabled {
  background: #E5E7EB;
  color: #9CA3AF;
  cursor: not-allowed;
}

/* Mini spinner inside list items */
.mini-spinner {
  width: 12px; height: 12px;
  border: 2px solid #E2E8F0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@media (max-width: 480px) {
  .fi-thumb { width: 44px; height: 44px; }
  .fi-name { font-size: 0.85rem; }
  .fi-meta { font-size: 0.78rem; gap: 6px 10px; }
  .fi-download { width: 36px; height: 36px; font-size: 1rem; }
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary {
  background: var(--success);
  color: #fff;
  flex: 1;
  justify-content: center;
}
.btn-primary:hover { background: #059669; }
.btn-primary:disabled { background: #94A3B8; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Tool grid (hub PDF / ferramentas) ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tool-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
  position: relative;
}
.tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37,99,235,0.10);
}
.tool-card .tool-icon { font-size: 1.8rem; margin-bottom: 10px; }
.tool-card h3 { font-size: 1.05rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.45; }
.tool-card-soon {
  cursor: not-allowed;
  opacity: 0.65;
}
.tool-card-soon:hover { transform: none; box-shadow: none; border-color: var(--border); }
.tool-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: #FEF3C7;
  color: #92400E;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Breadcrumbs simples ---------- */
.breadcrumbs {
  margin-top: 16px;
  font-size: 0.85rem;
}
.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumbs a:hover { color: var(--primary); }

/* ---------- File item: thumb PDF + botões reorder ---------- */
.fi-thumb-pdf {
  background: #FEE2E2;
  color: #B91C1C;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  overflow: hidden;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fi-thumb-pdf:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.fi-thumb-pdf-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fi-thumb-pdf-label {
  pointer-events: none;
}
.fi-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #F1F5F9;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.12s ease;
  display: grid;
  place-items: center;
}
.fi-btn-icon:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: #EFF6FF;
}
.fi-btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.fi-btn-remove:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: #FEF2F2;
}

.hint-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin: 8px 0 16px;
}

/* ---------- Rotacionar PDF: grid de páginas ---------- */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.page-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.page-card.page-rotated { border-color: var(--primary); }
.page-card.page-selectable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.page-card.page-selectable:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.page-card.page-selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.18); }
.page-card .page-check {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(255,255,255,0.96);
  border: 2px solid #94A3B8;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; color: transparent; line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.page-card { position: relative; }
.page-card.page-selected .page-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-card.page-group-start { border-top-color: var(--primary); border-top-width: 3px; }
.page-thumb {
  flex: 1;
  display: grid;
  place-items: center;
  background: #F1F5F9;
  min-height: 180px;
  padding: 8px;
}
.page-thumb img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  transition: transform 0.25s ease;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.page-meta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.page-rot-btn { width: 28px; height: 28px; font-size: 0.95rem; }
.page-zoom-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; }
.page-meta-actions { display: inline-flex; gap: 4px; align-items: center; }

.page-zoom-overlay {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
  z-index: 9999;
}
.page-zoom-overlay.visible { opacity: 1; }
.page-zoom-overlay img {
  max-width: min(80vw, 720px);
  max-height: 85vh;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  border-radius: 6px;
  transition: transform .25s ease;
}

/* ---------- PDF handoff (continuar com outra ferramenta) ---------- */
.pdf-handoff {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #EFF6FF 0%, #ECFDF5 100%);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
}
.pdf-handoff h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: var(--text);
}
.pdf-handoff > p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.pdf-handoff-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.pdf-handoff-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: all 0.15s ease;
}
.pdf-handoff-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: #EFF6FF;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.08);
}
.pdf-handoff-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pdf-handoff-icon { font-size: 1.2rem; line-height: 1; flex: 0 0 auto; }
.pdf-handoff-label { flex: 1; }

/* Notice quando um PDF chega via handoff */
.handoff-notice {
  margin-top: 16px;
  padding: 10px 14px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  border-radius: 8px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- PDF preview modal ---------- */
.pdf-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: ppmFadeIn 0.18s ease;
}
.pdf-preview-modal[hidden] { display: none; }
@keyframes ppmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ppm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ppm-content {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 16px 16px 16px;
  max-width: min(720px, 95vw);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  animation: ppmZoom 0.18s ease;
}
@keyframes ppmZoom {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.ppm-img-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #F1F5F9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ppm-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #fff;
  display: block;
}
.ppm-name {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
  padding: 0 8px;
}
.ppm-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s ease;
}
.ppm-close:hover { background: var(--danger); color: #fff; }

/* ---------- Drag-to-reorder (SortableJS) ---------- */
.file-item-draggable { user-select: none; }
.fi-drag {
  flex: 0 0 auto;
  width: 28px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #94A3B8;
  cursor: grab;
  font-size: 1.05rem;
  letter-spacing: -3px;
  font-weight: 700;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
  touch-action: none;  /* essencial pra drag funcionar bem em mobile */
}
.fi-drag:hover {
  background: #F1F5F9;
  color: var(--primary);
}
.fi-drag:active { cursor: grabbing; }

/* Estados durante arrasto */
.fi-ghost {
  opacity: 0.35;
  background: #EFF6FF;
  border-color: var(--primary);
}
.fi-chosen { box-shadow: 0 0 0 2px var(--primary); }
.fi-dragging {
  opacity: 0.95;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  cursor: grabbing;
}

/* ---------- Background Removal page ---------- */
.bg-info {
  margin-top: 16px;
  padding: 12px 16px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  color: #92400E;
  font-size: 0.88rem;
}
.bg-info p { margin: 0; }

.bg-progress {
  margin-top: 20px;
  padding: 20px;
  background: #F1F5F9;
  border-radius: var(--radius);
  text-align: center;
}
.bg-progress .spinner { margin: 0 auto 12px; }
.bg-progress p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 500;
}
.bg-progress-bar {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
}
.bg-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  width: 0%;
  transition: width 0.25s ease;
}

.bg-result { display: block; }

.bg-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
@media (max-width: 600px) {
  .bg-preview-grid { grid-template-columns: 1fr; }
}
.bg-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bg-preview-label {
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
}
.bg-preview-img {
  flex: 1;
  display: grid;
  place-items: center;
  background: #F1F5F9;
  min-height: 220px;
  padding: 8px;
}
.bg-preview-img img {
  max-height: 280px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
}
/* checkered background to show transparency */
.bg-checkered {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d1d5db 75%),
    linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* ---------- Loader & error ---------- */
.loader { display: none; text-align: center; padding: 24px; }
.loader.visible { display: block; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  display: none;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 0.9rem;
}
.error.visible { display: block; }

/* ---------- CTA banner (promover features novas) ---------- */
.cta-banner {
  margin-top: 32px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}
.cta-banner-text {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}
.cta-banner-icon { font-size: 2rem; line-height: 1; }
.cta-banner strong { font-size: 1.05rem; display: block; margin-bottom: 2px; }
.cta-banner p { font-size: 0.9rem; opacity: 0.92; margin: 0; }
.cta-banner .btn-primary {
  background: #fff;
  color: var(--primary);
  flex: 0 0 auto;
}
.cta-banner .btn-primary:hover { background: #F1F5F9; color: var(--primary-dark); }
@media (max-width: 480px) {
  .cta-banner .btn-primary { width: 100%; justify-content: center; }
}

/* ---------- Share site section ---------- */
.share-site {
  margin-top: 32px;
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.share-site h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
  color: var(--text);
}
.share-site > p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.share-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.share-icon { font-size: 1rem; line-height: 1; }
.share-wa:hover   { border-color: #25D366; color: #128C7E; }
.share-tg:hover   { border-color: #2AABEE; color: #1E96D6; }
.share-fb:hover   { border-color: #1877F2; color: #1565D8; }
.share-x:hover    { border-color: #000; color: #000; }
.share-copy:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 480px) {
  .share-btn { padding: 8px 12px; font-size: 0.82rem; }
}

/* ---------- Header CTA (botão "Comprimir" em páginas internas) ---------- */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
  padding: 7px 14px;
  background: var(--primary);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease;
}
.header-cta:hover { background: var(--primary-dark); color: #fff !important; }

/* Language suggestion banner (shown to non-PT visitors on PT pages) */
.lang-banner {
  background: linear-gradient(90deg, #2563EB 0%, #1D4ED8 100%);
  color: #fff;
  padding: 8px 12px;
  font-size: 0.92rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.lang-banner-inner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}
.lang-banner-icon { font-size: 1rem; line-height: 1; }
.lang-banner-text { font-weight: 500; opacity: 0.95; }
.lang-banner-yes {
  background: #fff;
  color: var(--primary-dark);
  padding: 5px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform 0.12s ease;
}
.lang-banner-yes:hover { transform: translateY(-1px); color: var(--primary-dark); }
.lang-banner-no {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.8;
  transition: opacity 0.12s ease, background 0.12s ease;
}
.lang-banner-no:hover { opacity: 1; background: rgba(255,255,255,0.15); }
@media (max-width: 480px) {
  .lang-banner { font-size: 0.82rem; padding: 6px 8px; }
  .lang-banner-inner { gap: 8px; }
  .lang-banner-yes { padding: 4px 10px; font-size: 0.8rem; }
}

/* Language switcher */
.lang-switcher {
  display: inline-block;
  margin-left: 12px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-muted) !important;
  text-decoration: none;
  transition: all 0.15s ease;
}
.lang-switcher:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  background: #EFF6FF;
}
@media (max-width: 480px) {
  .lang-switcher { margin-left: 6px; padding: 4px 7px; font-size: 0.72rem; }
}
@media (max-width: 480px) {
  .header-cta { padding: 6px 10px; font-size: 0.82rem; margin-left: 8px; }
}

/* ---------- Features section ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.feature { text-align: center; padding: 20px; }
.feature-icon {
  width: 48px; height: 48px;
  background: #EFF6FF;
  color: var(--primary);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  font-size: 1.4rem;
}
.feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- FAQ ---------- */
.faq {
  margin-top: 48px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.faq h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  text-align: center;
}
.faq-item {
  border-top: 1px solid var(--border);
  padding: 14px 4px;
}
.faq-item:first-of-type { border-top: none; }
.faq-item summary {
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item summary:hover { color: var(--primary); }
.faq-item p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.faq-item p a { color: var(--primary); }

/* ---------- Content pages (Sobre / Blog) ---------- */
.content-page { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.content-page h1 { font-size: 1.8rem; margin-bottom: 16px; letter-spacing: -0.02em; }
.content-page h2 { font-size: 1.3rem; margin: 24px 0 10px; }
.content-page p { margin-bottom: 12px; color: var(--text); }
.content-page ul { margin: 0 0 16px 20px; color: var(--text); }
.content-page ul li { margin-bottom: 6px; }

/* Blog figures, diagrams and screenshots */
.content-page figure {
  margin: 24px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.content-page figure svg,
.content-page figure img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 6px;
}
.content-page figure img {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.content-page figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}
.content-page figure.diagram { background: #fff; }
.content-page figure.screenshot { background: #f1f5f9; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: none; }
.post-list a { font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.post-list .meta { display: block; color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ---------- Footer ---------- */
footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: auto;
}
footer a { color: var(--primary); text-decoration: none; }

/* ========== Home Hub (2026-06-04) ========== */

/* Header fixo ao rolar — cara de suite moderna (todas as páginas) */
header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Hero do hub */
.hero-hub { padding-top: 8px; margin-bottom: 24px; }
.hero-hub h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.hero-hub > p { font-size: 1.12rem; max-width: 660px; margin: 0 auto; }

/* Cabeçalho de seção de ferramentas */
.tools-section { margin-bottom: 30px; }
.tools-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.tools-section-head h2 { font-size: 1.25rem; letter-spacing: -0.01em; }
.tools-section-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.tools-section-link:hover { text-decoration: underline; }

/* Ícone colorido nos tool-cards da home — retrocompatível com emoji do /pdf/ */
.tool-card .tool-icon.ic {
  width: 46px; height: 46px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.tool-icon.ic svg { width: 24px; height: 24px; }
.tool-icon.ic-img   { background: #EFF6FF; color: #2563EB; }
.tool-icon.ic-pdf   { background: #FEE2E2; color: #DC2626; }
.tool-icon.ic-magic { background: #F5F3FF; color: #7C3AED; }
.tool-icon.ic-webp  { background: #ECFDF5; color: #059669; }

/* Primeiro card (comprimir) destacado */
.tool-card.is-featured {
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 4px 14px rgba(37,99,235,0.08);
}

/* Seção do compressor (uploader) destacada abaixo da grade */
.compress-anchor { scroll-margin-top: 80px; }
.compress-head { text-align: center; margin: 8px 0 16px; }
.compress-head h2 { font-size: 1.5rem; margin-bottom: 4px; }
.compress-head p { color: var(--text-muted); max-width: 560px; margin: 0 auto; }

@media (max-width: 600px) {
  .hero-hub h1 { font-size: 1.7rem; }
}
