/* pdfsimples.com — shared styles
   Friendly, simple, Portuguese-first. Big touch targets, warm colors. */

:root {
  --brand: #e2483d;          /* PDF red, warm */
  --brand-dark: #c23a30;
  --ink: #1f2430;
  --ink-soft: #5a6270;
  --bg: #fbf7f4;
  --card: #ffffff;
  --line: #ece5df;
  --ok: #1f9d63;
  --ok-bg: #e7f6ee;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(40, 30, 20, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo .mark {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 4px 9px;
  font-size: 0.95rem;
  font-weight: 800;
}
.logo .simples { color: var(--ink); }
.logo .pdf { color: var(--brand); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}
.hero { text-align: center; padding: 20px 8px 10px; }
.hero h1 {
  font-size: 2rem;
  margin: 8px 0 6px;
  letter-spacing: -0.8px;
}
.hero p { color: var(--ink-soft); font-size: 1.1rem; margin: 0 auto; max-width: 520px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.back:hover { color: var(--ink); }

/* ---------- Tool cards on landing ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 999px; line-height: 1.4;
}
.badge-free { background: var(--ok); color: #fff; }
.badge-paid { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(40, 30, 20, 0.12);
}
.tool-card .emoji { font-size: 1.9rem; }
.tool-card h3 { margin: 4px 0 0; font-size: 1.2rem; }
.tool-card p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }
.tool-card.soon { opacity: 0.55; box-shadow: none; cursor: default; }
.tool-card.soon:hover { transform: none; box-shadow: none; }
.badge-soon {
  font-size: 0.72rem;
  background: var(--line);
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

/* ---------- Tool card / work area ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-top: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 1.5rem; }
.card .sub { color: var(--ink-soft); margin: 0 0 20px; }

/* ---------- Drop zone ---------- */
.drop {
  border: 2px dashed #d9cfc6;
  border-radius: var(--radius);
  background: #fdfaf7;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop:hover, .drop.over {
  border-color: var(--brand);
  background: #fff4f2;
}
.drop .big { font-size: 2.4rem; }
.drop .line1 { font-weight: 700; font-size: 1.1rem; margin-top: 8px; }
.drop .line2 { color: var(--ink-soft); font-size: 0.95rem; margin-top: 2px; }
input[type="file"] { display: none; }

/* ---------- File list / document cards ---------- */
.files { list-style: none; margin: 18px 0 0; padding: 0; }

.doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  background: #fff;
  transition: box-shadow 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
.doc-card.dragging { opacity: 0.5; }
.doc-card.drop-target {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #fde1dd;
}

.drag-handle {
  cursor: grab;
  color: #c3b8ae;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 2px;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }

.thumb {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 68px;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #f3ece6;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.loading::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, #f3ece6 30%, #fbf7f4 50%, #f3ece6 70%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.thumb .pos {
  position: absolute;
  top: 3px; left: 3px;
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  z-index: 1;
}

.doc-info { flex: 1; min-width: 0; }
.fi-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-meta { display: block; color: var(--ink-soft); font-size: 0.85rem; margin-top: 2px; }
.fi-btns { display: flex; gap: 4px; flex: 0 0 auto; }
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 34px; height: 34px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 15px 26px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-link { text-decoration: none; }
.howto-title { margin: 26px 0 10px; font-size: 1.15rem; }
.howto { margin: 0; padding-left: 22px; color: var(--ink); }
.howto li { margin: 8px 0; line-height: 1.5; }
.article p { color: var(--ink); line-height: 1.6; margin: 0 0 14px; }
.article p a { color: var(--brand-dark); font-weight: 600; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #e6b6b1; cursor: default; }
.btn-block { width: 100%; margin-top: 20px; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }
.btn-pay { background: var(--ok); color: #fff; }
.btn-pay:hover { background: #178a54; }

/* ---------- Options (simple, no jargon) ---------- */
.options { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.opt {
  flex: 1 1 180px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
}
.opt.selected { border-color: var(--brand); background: #fff4f2; }
.opt .opt-title { font-weight: 700; }
.opt .opt-desc { color: var(--ink-soft); font-size: 0.9rem; }
.opt input { display: none; }

/* ---------- Progress / status ---------- */
.status {
  text-align: center;
  padding: 26px;
  color: var(--ink-soft);
}
.spinner {
  width: 42px; height: 42px;
  border: 4px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Result ---------- */
.result {
  text-align: center;
  padding: 10px 6px;
}
.result .check {
  width: 60px; height: 60px;
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 50%;
  font-size: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.result h3 { margin: 0 0 4px; font-size: 1.35rem; }
.result .savings {
  display: inline-block;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 10px 0;
}
.result .sizes { color: var(--ink-soft); margin: 6px 0 4px; }

/* ---------- Trust line ---------- */
.trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.trust span { display: inline-flex; align-items: center; gap: 6px; }

.foot {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 30px 16px;
}

/* ---------- Pix modal ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 15, 12, 0.5);
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
  z-index: 50;
}
.overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 18px;
  max-width: 380px;
  width: 100%;
  padding: 26px 24px 22px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 { margin: 0 0 2px; font-size: 1.3rem; }
.modal .price { font-size: 2rem; font-weight: 800; color: var(--ink); margin: 6px 0 2px; }
.modal .muted { color: var(--ink-soft); font-size: 0.92rem; }
.qr {
  width: 180px; height: 180px;
  margin: 16px auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px;
  background: #fff;
}
.pix-code {
  font-family: monospace;
  font-size: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  color: var(--ink-soft);
  margin: 8px 0 4px;
}
.qr-wrap {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 12px 0 2px;
}
.status-line .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

.proto-note {
  background: #fff7e6;
  color: #8a6d1f;
  border: 1px solid #f0e0b0;
  border-radius: 8px;
  font-size: 0.82rem;
  padding: 8px 10px;
  margin: 14px 0 4px;
}
.modal .close {
  background: none; border: none; color: var(--ink-soft);
  cursor: pointer; margin-top: 10px; font-size: 0.9rem;
}
.hidden { display: none !important; }

@media (max-width: 520px) {
  .hero h1 { font-size: 1.6rem; }
  .card { padding: 20px 16px; }
}

/* ---------- Opção de compactar (Juntar) ---------- */
.compress-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  margin: 4px 0 14px;
  cursor: pointer;
  text-align: left;
}
.compress-opt input {
  margin-top: 2px;
  width: 18px; height: 18px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}
.compress-opt .co-text { display: flex; flex-direction: column; gap: 2px; }
.compress-opt strong { font-weight: 700; color: var(--ink); font-size: 0.98rem; }
.compress-opt small { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- FAQ (SEO + confiança) ---------- */
.faq {
  max-width: 640px;
  margin: 44px auto 0;
}
.faq h2 {
  text-align: center;
  font-size: 1.3rem;
  margin: 0 0 16px;
  color: var(--ink);
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--brand);
  font-weight: 800;
  font-size: 1.25rem;
  flex: 0 0 auto;
  line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.faq-item a { color: var(--brand-dark); font-weight: 600; }

/* ---------- Controles de intervalo (Dividir) ---------- */
.range-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 4px;
}
.range-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
}
.range-row input {
  width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--ink);
}
.range-hint {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: 2px 0 14px;
}

/* ---------- Assinar PDF ---------- */
.sign-stage { margin-top: 6px; }
.page-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-bottom: 10px; color: var(--ink-soft); font-size: 0.92rem;
}
.page-holder {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
#page-canvas { display: block; max-width: 100%; height: auto; }
.sig-overlay {
  position: absolute; left: 0; top: 0;
  cursor: move; touch-action: none;
  border: 1px dashed var(--brand); border-radius: 4px;
}
.sig-overlay img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.sign-panel { margin-top: 16px; }
.seg {
  display: flex; gap: 6px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; margin-bottom: 10px;
}
.seg-btn {
  flex: 1; border: none; background: none; padding: 8px;
  border-radius: 8px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.seg-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
#pad-draw { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
#pad-draw .btn-ghost { align-self: flex-end; }
.sig-pad {
  width: 100%; height: 180px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: #fff; touch-action: none; display: block;
}
.sig-text-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 1.6rem; color: var(--ink);
  font-family: 'Segoe Script','Snell Roundhand','Brush Script MT', cursive;
}
.size-row { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); margin: 10px 0; }
.size-row input[type="range"] { flex: 1; accent-color: var(--brand); }

/* ---------- Organizar páginas ---------- */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin: 10px 0 12px;
}
.pg-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
  cursor: grab;
}
.pg-card.dragging { opacity: 0.45; }
.pg-card.drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; }
.pg-thumb {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); overflow: hidden;
}
.pg-thumb img { max-width: 100%; max-height: 100%; display: block; transition: transform 0.15s ease; }
.pg-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; font-size: 0.78rem; color: var(--ink-soft);
}
.pg-actions { display: flex; gap: 3px; }
.pg-actions .icon-btn { padding: 2px 6px; font-size: 0.85rem; min-width: 0; }
.org-hint { color: var(--ink-soft); font-size: 0.88rem; margin: 4px 0 12px; text-align: center; }

/* ---------- Prévia de rotação (Girar) ---------- */
.rotate-preview {
  width: 220px; height: 220px; max-width: 80%;
  margin: 8px auto 6px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.rotate-preview img { max-width: 100%; max-height: 100%; display: block; transition: transform 0.2s ease; }
.rotate-label { text-align: center; color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 12px; }

/* ---------- Prévia grande da 1ª página (ferramentas de arquivo único) ---------- */
.page-preview {
  width: 220px; max-width: 80%;
  margin: 10px auto 14px;
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--bg);
  box-shadow: var(--shadow);
}
.page-preview img { display: block; width: 100%; height: auto; }

/* ---------- Preencher formulário ---------- */
.fields-info { color: var(--ink-soft); font-size: 0.88rem; margin: 8px 0 12px; text-align: center; }
.field-row { margin-bottom: 14px; text-align: left; }
.field-label { display: block; font-weight: 600; color: var(--ink); font-size: 0.92rem; margin-bottom: 5px; }
.field-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; color: var(--ink); font-family: inherit;
}
.field-check, .field-radio { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.field-radios { display: flex; flex-wrap: wrap; gap: 14px; }
.no-fields {
  background: #fff7e6; color: #8a6d1f; border: 1px solid #f0e0b0;
  border-radius: 10px; padding: 14px; font-size: 0.92rem; margin: 8px 0 4px; text-align: left;
}

/* ---------- Editor de PDF (Fabric) ---------- */
.or-sep {
  display: flex; align-items: center; text-align: center;
  color: var(--ink-soft); font-size: 0.85rem; margin: 14px 0;
}
.or-sep::before, .or-sep::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.or-sep span { padding: 0 12px; }
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
}
.tool-btn {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer;
  font-size: 0.9rem;
}
.tool-btn:hover { border-color: var(--brand); }
.editor-pagenav {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-soft); font-size: 0.9rem;
}
.field-props {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
  margin-bottom: 12px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.9rem; color: var(--ink);
}
.field-props label { display: inline-flex; align-items: center; gap: 6px; }
.field-props input[type="number"] {
  width: 58px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink);
}
.field-props select {
  padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink);
}
.field-props .fp-toggle { font-weight: 600; }
.field-props .fp-table { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.editor-stage {
  max-width: 100%; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  display: flex; justify-content: center; margin-bottom: 14px;
}
.editor-stage .canvas-container { margin: 0 auto; }

/* modal de assinatura do editor */
.sig-modal {
  position: fixed; inset: 0; background: rgba(20, 15, 12, 0.5);
  display: none; align-items: center; justify-content: center; padding: 16px; z-index: 60;
}
.sig-modal.show { display: flex; }
.sig-modal .modal {
  background: #fff; border-radius: 16px; max-width: 440px; width: 100%;
  padding: 22px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.sig-modal .modal h3 { margin: 0 0 12px; }
