/* PropostaJá — estilos (dark, limpo, responsivo, print-friendly) */
:root {
  --bg: #0e1116;
  --panel: #151b24;
  --panel2: #1c2530;
  --line: #263140;
  --text: #e8edf4;
  --muted: #93a1b3;
  --accent: #f5b301;
  --accent2: #ffd34d;
  --ok: #37d67a;
  --err: #ff5d5d;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 500px at 80% -10%, #182231 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 22, 0.85);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand span { color: var(--accent); }
.topnav { display: flex; gap: 10px; align-items: center; }

/* ---------- botões ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); padding: 9px 16px; border-radius: 999px;
  cursor: pointer; font-size: 14px; font-weight: 600;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: #232f3e; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #14161a; }
.btn.primary:hover { background: var(--accent2); }
.btn.secondary { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 4px 10px; font-size: 12px; }
.btn.block { display: block; text-align: center; width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- layout ---------- */
.app {
  display: grid; grid-template-columns: minmax(340px, 470px) minmax(420px, 1fr);
  gap: 22px; max-width: 1280px; margin: 26px auto; padding: 0 22px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}

/* ---------- formulário ---------- */
fieldset { border: 1px dashed var(--line); border-radius: var(--radius); margin: 0 0 18px; padding: 14px 16px 16px; }
legend { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; padding: 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input, textarea {
  width: 100%; margin-top: 5px; padding: 9px 11px; color: var(--text);
  background: #10151d; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }

.items { width: 100%; border-collapse: collapse; margin: 8px 0 10px; }
.items th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 4px 6px; }
.items td { padding: 3px 4px; }
.items input { margin-top: 0; }
.items th.num, .items td.num { width: 90px; }
.items td.num input { text-align: right; }
.items .rm { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.items .rm:hover { color: var(--err); }

.discount-row { max-width: 180px; }
.totals.bar {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px;
}
.totals .big { font-size: 26px; font-weight: 800; color: var(--accent); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.error { color: var(--err); font-weight: 600; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.hint.center { text-align: center; }

/* ---------- documento (preview) ---------- */
.preview { align-self: start; }
.doc {
  background: #fdfdfb; color: #17202a; border-radius: 10px;
  padding: 30px 32px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.doc-company { font-size: 19px; font-weight: 800; }
.doc-meta { color: #5c6b7a; font-size: 12px; margin-top: 2px; }
.doc-kind { font-size: 11px; letter-spacing: 2px; color: #8b6f00; font-weight: 700; }
.doc-numbox { text-align: right; }
.doc-numbox > div + div { margin-top: 2px; }
#pv-number { font-weight: 700; }
.doc-parties { display: flex; gap: 40px; margin: 20px 0 6px; }
.doc-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #7a8896; font-weight: 700; }
.doc-title { font-size: 17px; margin: 14px 0 10px; }
.doc-items { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-items th { text-align: left; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: #7a8896; border-bottom: 2px solid #d9dee5; padding: 6px 4px; }
.doc-items td { border-bottom: 1px solid #eceff3; padding: 8px 4px; vertical-align: top; }
.doc-items tfoot td { border-bottom: none; }
.doc-items th.num, .doc-items td.num { text-align: right; white-space: nowrap; }
.doc-items tr.doc-total td { font-weight: 800; font-size: 15px; border-top: 2px solid #17202a; padding-top: 8px; }
.doc-notes { margin-top: 18px; font-size: 13px; }
.doc-notes p { margin: 4px 0 0; white-space: pre-wrap; }
.doc-pix { margin-top: 18px; background: #f4f6ef; border: 1px dashed #b9c48f; border-radius: 8px; padding: 12px 14px; }
.doc-pix code {
  display: block; word-break: break-all; font-size: 11px; background: #fff;
  border: 1px solid #dde3d0; border-radius: 6px; padding: 8px; margin-bottom: 8px;
}
.pix-line { display: flex; gap: 8px; align-items: flex-start; }
.pix-line .btn { border-color: #b9c48f; color: #55631f; background: #fff; }
.doc-foot { margin-top: 26px; text-align: center; color: #98a4b0; font-size: 11px; }

/* ---------- pricing ---------- */
.pricing { max-width: 900px; margin: 40px auto 30px; padding: 0 22px; text-align: center; }
.pricing h2 { font-size: 24px; margin-bottom: 22px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.plan {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; text-align: left; position: relative;
}
.plan.featured { border-color: var(--accent); border-width: 2px; }
.tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #14161a; font-size: 11px; font-weight: 800;
  padding: 3px 12px; border-radius: 999px; letter-spacing: .5px;
}
.price { font-size: 34px; font-weight: 800; margin: 6px 0 14px; }
.price span { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.plan ul { list-style: none; margin: 0 0 18px; padding: 0; font-size: 14px; line-height: 2; }
.pro-badge {
  background: linear-gradient(135deg, var(--accent), #ff8a00);
  color: #14161a; font-weight: 800; font-size: 11px; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 999px;
}

/* ---------- modais ---------- */
.modal { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); max-width: 520px; width: calc(100% - 40px); padding: 22px; }
.modal::backdrop { background: rgba(5, 8, 12, .65); backdrop-filter: blur(2px); }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.modal textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.site-foot {
  max-width: 1280px; margin: 30px auto 0; padding: 18px 22px 30px;
  display: flex; justify-content: space-between; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--line);
}
.site-foot a { color: var(--muted); }

/* ---------- hero ---------- */
.hero { max-width: 1240px; margin: 18px auto 6px; padding: 0 16px; }
.hero svg { width: 100%; height: auto; display: block; border-radius: 16px; }
.hero .hint.center { margin-top: 8px; }

/* ---------- seletor de idioma ---------- */
#lang-select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- responsivo ---------- */
@media (max-width: 1020px) {
  .app { grid-template-columns: 1fr; }
  .preview { order: -1; }
}

/* ---------- impressão / PDF ---------- */
@media print {
  body { background: #fff; }
  body:has(.print-mode-doc) .topbar,
  body:has(.print-mode-doc) .editor,
  body:has(.print-mode-doc) .pricing,
  body:has(.print-mode-doc) .site-foot,
  body:has(.print-mode-doc) .hero,
  .doc-pix .btn,
  #btn-copy-pix { display: none !important; }
  body:has(.print-mode-doc) .app { display: block; margin: 0; padding: 0; max-width: none; }
  @page { margin: 12mm; }
}
