:root {
  --bs-primary: #2952e3;
  --bs-primary-rgb: 41, 82, 227;
  --bs-link-color: #2952e3;
  --bs-link-color-rgb: 41, 82, 227;
  --app-bg: #f5f7fb;
  --ink: #1b2333;
  --muted: #5f6b7d;
  --line: #e3e8f0;
}
body { background: var(--app-bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.btn-primary { --bs-btn-bg: #2952e3; --bs-btn-border-color: #2952e3; --bs-btn-hover-bg: #1f43c4; --bs-btn-hover-border-color: #1f43c4; --bs-btn-active-bg: #1a39a8; }
.btn-outline-primary { --bs-btn-color: #2952e3; --bs-btn-border-color: #2952e3; --bs-btn-hover-bg: #2952e3; --bs-btn-hover-border-color: #2952e3; --bs-btn-active-bg: #2952e3; --bs-btn-active-border-color: #2952e3; }
.text-primary { color: #2952e3 !important; }

.app-nav { background: #fff; border-bottom: 1px solid var(--line); }
.app-nav .nav-link.active { color: #2952e3; font-weight: 600; }
.app-footer { padding: 1.5rem 0; border-top: 1px solid var(--line); background: #fff; margin-top: 3rem; }
.card { border-color: var(--line); }
.min-w-0 { min-width: 0; }

/* Landing */
.hero { background: linear-gradient(135deg, #eef2ff 0%, #f7f9ff 55%, #e9fbf3 100%); border-bottom: 1px solid var(--line); }
.hero-card { background: #fff; border-radius: 16px; padding: 2rem; transform: rotate(-1.5deg); position: relative; z-index: 1; }
.total-pill { background: #2952e3; color: #fff; border-radius: 999px; padding: .4rem 1rem; font-weight: 700; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.feature i { font-size: 1.8rem; color: #2952e3; }

/* Auth */
.auth-card { max-width: 440px; margin: 2rem auto; border-radius: 16px; }

.empty-state { text-align: center; padding: 3rem 1rem; background: #fff; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

.logo-preview { width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; flex-shrink: 0; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview i { font-size: 2rem; color: #b8c1cf; }

/* Editor: alterna campos por tipo de invoice */
body.type-service .only-product { display: none !important; }
body.type-product .only-service { display: none !important; }
.items-table th { font-size: .78rem; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.items-table td { border-bottom-color: #f0f2f6; }
.items-table .col-sku { width: 110px; }
.items-table .col-qty { width: 90px; }
.items-table .col-unit { width: 80px; }
.items-table .col-price { width: 130px; }
.items-table .col-amount { width: 130px; white-space: nowrap; }
.items-table .col-del { width: 36px; }
.items-table textarea { resize: none; overflow: hidden; min-width: 200px; }
.totals input { max-width: 140px; }
.from-box { background: var(--app-bg); border-radius: 10px; padding: .9rem 1rem; }

/* Documento (sempre claro, pronto para PDF) */
.paper-wrap { overflow-x: auto; padding-bottom: 1rem; }
.invoice-paper {
  position: relative; background: #fff; color: #1b2333; width: 210mm; min-height: 270mm; margin: 0 auto;
  padding: 16mm 15mm; box-shadow: 0 10px 40px rgba(20, 30, 60, .12); border-radius: 6px;
  font-size: 13px; line-height: 1.45; overflow: hidden;
}
/* Cópia usada só para gerar o PDF: 190mm = A4 menos margens de 10mm */
.pdf-host { position: fixed; left: 0; top: 0; z-index: -1; background: #fff; pointer-events: none; }
.pdf-host .invoice-paper { box-shadow: none; border-radius: 0; min-height: 0; width: 718px; padding: 0; margin: 0; overflow: visible; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 3px solid #2952e3; }
.inv-logo { max-height: 70px; max-width: 200px; object-fit: contain; display: block; margin-bottom: 10px; }
.inv-company { font-size: 18px; font-weight: 700; }
.inv-muted { color: #5f6b7d; }
.inv-title-box { text-align: right; min-width: 220px; }
.inv-title { font-size: 30px; font-weight: 800; letter-spacing: 2px; color: #2952e3; text-transform: uppercase; line-height: 1; }
.inv-number { font-weight: 600; margin: 6px 0 10px; color: #5f6b7d; }
.inv-meta { margin-left: auto; }
.inv-meta th { font-weight: 500; color: #5f6b7d; padding: 1px 12px 1px 0; text-align: right; }
.inv-meta td { font-weight: 600; text-align: right; }
.inv-balance { margin-top: 12px; background: #eef2ff; border-radius: 8px; padding: 8px 12px; display: flex; justify-content: space-between; gap: 16px; }
.inv-balance strong { color: #2952e3; font-size: 15px; }
.inv-parties { display: flex; gap: 40px; padding: 20px 0; }
.inv-parties > div { flex: 1; }
.inv-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #2952e3; margin-bottom: 4px; }
.inv-items { width: 100%; border-collapse: collapse; margin-top: 4px; }
.inv-items th { background: #1b2333; color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; text-align: left; }
.inv-items th:first-child { border-radius: 6px 0 0 6px; }
.inv-items th:last-child { border-radius: 0 6px 6px 0; }
.inv-items td { padding: 9px 10px; border-bottom: 1px solid #e9edf3; vertical-align: top; }
.inv-items .num { text-align: right; white-space: nowrap; }
.inv-items .w-sku { width: 90px; }
.inv-bottom { display: flex; justify-content: space-between; gap: 32px; margin-top: 20px; }
.inv-notes { flex: 1; }
.inv-totals { min-width: 260px; border-collapse: collapse; align-self: flex-start; }
.inv-totals th { font-weight: 500; color: #5f6b7d; padding: 5px 0; }
.inv-totals td { text-align: right; padding: 5px 0 5px 24px; white-space: nowrap; font-weight: 600; }
.inv-totals tr.grand th, .inv-totals tr.grand td { border-top: 2px solid #1b2333; font-size: 16px; font-weight: 800; color: #1b2333; padding-top: 9px; }
.inv-totals tr.due th, .inv-totals tr.due td { color: #2952e3; font-weight: 800; }
.inv-stamp {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg);
  border: 5px solid rgba(25, 135, 84, .35); color: rgba(25, 135, 84, .35); font-size: 64px; font-weight: 900;
  text-transform: uppercase; padding: 4px 28px; border-radius: 12px; pointer-events: none; letter-spacing: 4px;
}

@media (max-width: 575.98px) {
  .hero-card { transform: none; padding: 1.25rem; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .no-print, .app-nav, .app-footer { display: none !important; }
  main.container { max-width: none; padding: 0 !important; }
  .invoice-paper { box-shadow: none; width: auto; min-height: 0; padding: 0; border-radius: 0; }
  .inv-items th, .inv-balance { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Marca */
.brand-name { color: #1b2333; }
.brand-sub { color: #2952e3; font-weight: 500; }
.inv-powered { margin-top: 36px; padding-top: 10px; border-top: 1px solid #e9edf3; text-align: center; font-size: 11px; color: #8a94a6; }
.inv-powered a { color: #5f6b7d; text-decoration: none; }
.inv-powered img { vertical-align: -2px; }
.inv-dev { margin-top: 3px; font-size: 10.5px; }

/* Tradução automática no editor */
.translate-box { background: #f3f6ff; border: 1px solid #dfe6ff; border-radius: 10px; padding: .75rem .85rem; }
.translate-box .tr-same { display: none; }
.translate-box.is-same .tr-options { display: none; }
.translate-box.is-same .tr-same { display: block; margin-top: 0; }

/* Páginas legais */
.legal { max-width: 860px; margin: 0 auto; }
.legal h2 { font-size: 1.1rem; margin-top: 1.75rem; }
.legal table { font-size: .9rem; }

/* Landing */
.landing .hero h1 { letter-spacing: -.02em; }
.hero-stage { position: relative; padding: 1.5rem 1rem 2.5rem; }
.paid-chip { color: #198754; border: 2px solid #19875455; border-radius: 8px; padding: .15rem .6rem; font-weight: 800; font-size: .8rem; letter-spacing: .08em; }
.float-chip { position: absolute; z-index: 2; background: #fff; border-radius: 12px; padding: .6rem .85rem; display: flex; gap: .6rem; align-items: center; font-size: .85rem; border: 1px solid var(--line); }
.float-chip > i { font-size: 1.3rem; color: #2952e3; }
.chip-translate { left: -.5rem; bottom: 0; max-width: 320px; }
.chip-pdf { right: -.25rem; top: 0; }
.trust-strip { background: #1b2333; color: #fff; padding: 1.1rem 0; }
.trust-strip i { color: #8fb0ff; margin-right: .35rem; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2rem 1.5rem 1.5rem; }
.step-num { position: absolute; top: -14px; left: 1.5rem; width: 30px; height: 30px; border-radius: 50%; background: #2952e3; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-icon { font-size: 2rem; color: #2952e3; }
.type-card { background: var(--app-bg); border: 1px solid var(--line); border-radius: 16px; padding: 1.75rem; }
.type-icon { width: 52px; height: 52px; border-radius: 14px; background: #2952e3; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.translate-demo { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; box-shadow: 0 10px 30px rgba(20, 30, 60, .08); }
.td-row { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 10px; background: var(--app-bg); margin-bottom: .6rem; }
.td-row.active { background: #eef2ff; }
.td-flag { flex-shrink: 0; font-weight: 800; font-size: .75rem; background: #1b2333; color: #fff; border-radius: 6px; padding: .2rem .45rem; }
.td-row.active .td-flag { background: #2952e3; }
.td-arrow { text-align: center; color: var(--muted); font-size: .85rem; margin: .2rem 0 .8rem; }
.who { display: flex; gap: .9rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; }
.who > i { font-size: 1.6rem; color: #2952e3; }
.compare th { font-size: .85rem; }
.compare td, .compare th { padding: .8rem 1rem; vertical-align: middle; }
.compare td:nth-child(2) { background: #f3f6ff; }
.privacy-band { display: flex; gap: 1.25rem; align-items: center; background: #e9fbf3; border: 1px solid #c4ecd9; border-radius: 16px; padding: 1.5rem 1.75rem; }
.privacy-band > i { font-size: 2.5rem; color: #198754; }
.faq { max-width: 820px; }
.faq .accordion-button { font-weight: 600; }
.faq .accordion-button:not(.collapsed) { background: #eef2ff; color: #1b2333; }
.final-cta { background: linear-gradient(135deg, #2952e3, #1a39a8); color: #fff; }
.final-cta .btn-light { color: #2952e3; }
.landing .app-footer { margin-top: 0; }
@media (max-width: 575.98px) {
  .chip-translate { position: relative; left: 0; bottom: 0; margin-top: 1rem; max-width: none; }
  .chip-pdf { display: none; }
  .hero-stage { padding: 0; }
  .privacy-band { flex-direction: column; text-align: center; }
}

@media (max-width: 575.98px) { .hero-card { transform: none; } .landing { overflow-x: hidden; } }
