:root {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --card: #141e33;
  --card-2: #1a2540;
  --field: #0e1628;
  --line: #24314f;
  --line-2: #2f3e61;
  --text: #e6ecf5;
  --muted: #8f9bb3;
  --accent: #22c38e;
  --accent-2: #16a374;
  --accent-soft: rgba(34, 195, 142, .12);
  --danger: #f06a6a;
  --blue: #5b8def;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -200px, #12284a 0%, transparent 70%), var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
main { flex: 1; outline: none; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 18, 32, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #062b1d; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.active { color: var(--text); background: var(--card-2); }
@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 16px; }
  .nav { margin: 0 -8px; }
}

/* Layout */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 {
  margin: 0 0 12px; font-size: clamp(32px, 6vw, 54px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800;
  background: linear-gradient(90deg, #3fe0a6, #22c38e 50%, #7fd8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0 auto; max-width: 560px; color: #c3cde0; font-size: 17px; }
.hero .for { margin-top: 10px; font-size: 13px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.badge { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 99px; }

.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
@media (max-width: 640px) { .card-pad { padding: 16px; } }
.card + .card, .section { margin-top: 22px; }
.divider { height: 1px; background: var(--line); margin: 18px -22px; }
@media (max-width: 640px) { .divider { margin: 16px -16px; } }

/* Tools grid */
.tools-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tool {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--field);
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600;
  min-width: 0;
}
.tool span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool:hover { border-color: var(--line-2); background: var(--card-2); }
.tool.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--accent); }
.tool-ico { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: #c3cde0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.input, .select, .textarea {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #5f6b84; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.phone { display: flex; gap: 8px; flex-wrap: wrap; }
.phone-box { flex: 1 1 280px; display: flex; align-items: stretch; background: var(--field); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.phone-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cc { position: relative; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 28px 0 13px; border-right: 1px solid var(--line); font-weight: 600; white-space: nowrap; cursor: pointer; }
.cc::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.cc select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; border: 0; background: var(--card); color: var(--text); }
.phone-box input { border: 0; background: transparent; box-shadow: none !important; border-radius: 0; flex: 1; min-width: 0; font-size: 16px; }
.phone-actions { display: flex; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--line-2); background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn-danger { color: var(--danger); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #052a1c; }
.btn-primary:hover { background: #2fd49d; border-color: #2fd49d; }
.btn-big { padding: 14px 34px; font-size: 17px; border-radius: 14px; min-width: 240px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 6px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--card-2); color: var(--text); }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card-2); color: var(--accent); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.seg-blue button.on { color: var(--blue); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: #c3cde0; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.on { border-color: var(--accent); color: var(--accent); }

/* Editor */
.editor { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--field); }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.editor-bar .fmt { width: 32px; height: 30px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: #c3cde0; font-size: 14px; }
.editor-bar .fmt:hover { background: var(--card-2); color: var(--text); }
.editor-bar .hint { margin-left: auto; font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .editor-bar .hint { display: none; } }
.editor .textarea { border: 0; border-radius: 0; box-shadow: none !important; background: transparent; }
.counter { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; color: var(--muted); padding: 6px 12px; border-top: 1px solid var(--line); }

/* Chat preview */
.chat { background: #0b141a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23ffffff' fill-opacity='.035'/%3E%3C/svg%3E"); border-radius: 14px; padding: 16px; border: 1px solid var(--line); }
.bubble { position: relative; margin-left: auto; max-width: 92%; width: fit-content; background: #005c4b; color: #e9edef; padding: 8px 10px 20px; border-radius: 10px 0 10px 10px; font-size: 14.5px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; min-width: 90px; }
.bubble code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.bubble .meta { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: rgba(233,237,239,.65); }
.bubble.empty { color: rgba(233,237,239,.55); font-style: italic; }

/* Send area */
.send-area { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 18px; }
.send-hint { font-size: 12px; color: var(--muted); margin-top: -6px; }

/* Content sections */
.prose h2 { font-size: 22px; letter-spacing: -.01em; margin: 0 0 10px; }
.prose h3 { font-size: 16px; margin: 18px 0 6px; }
.prose p, .prose li { color: #c3cde0; }
.prose ol, .prose ul { padding-left: 20px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--field); }
.step-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 8px; }
.step h3 { margin: 0 0 4px; font-size: 15px; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 8px 0 0; color: #c3cde0; }

.page-head { text-align: center; padding: 36px 0 20px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(26px, 5vw, 38px); letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); }

/* Results, lists */
.result-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1px dashed var(--line-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.result-box span { flex: 1; min-width: 0; }
.qr-holder { display: grid; place-items: center; padding: 18px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); min-height: 220px; text-align: center; color: var(--muted); font-size: 14px; }
.qr-holder canvas { max-width: 100%; height: auto; border-radius: 8px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: #fff; }
input[type="color"] { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 2px; cursor: pointer; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { text-align: center; padding: 28px 12px; color: var(--muted); }

.items-table { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: grid; grid-template-columns: 28px 1fr 80px 120px 36px; gap: 8px; align-items: center; }
.item-row .n { color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 640px) {
  .item-row { grid-template-columns: 24px 1fr 1fr 36px; }
  .item-row .desc { grid-column: 2 / 5; }
  .item-row .n { grid-row: 1; }
}
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.total-line strong { font-size: 22px; }
.inline-pair { display: flex; gap: 6px; }
.inline-pair .select { width: 72px; flex: none; }

.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.font-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); }
.font-card .name { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.font-card .out { font-size: 17px; overflow-wrap: anywhere; min-height: 26px; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tpl { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.tpl:hover { border-color: var(--accent); }
.tpl .t { font-weight: 700; }
.tpl .d { font-size: 13px; color: var(--muted); }
.tpl .p { font-size: 13px; color: #c3cde0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--card-2); color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }

.ref-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ref-table td, .ref-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ref-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ref-table code { background: var(--field); padding: 2px 6px; border-radius: 6px; }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 48px; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 24px 16px 36px; font-size: 14px; }
.footer-inner p { margin: 0 0 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* Toast & modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #e6ecf5; color: #0b1220; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 15, .7); }
.modal-card { position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.modal-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--line); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px; }

/* Static SEO text below each tool (built from seo/pages.mjs) */
.seo { margin-top: 22px; }
.seo .section:first-child { margin-top: 0; }
.prose blockquote { margin: 12px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: #c3cde0; }
.prose code { background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .92em; }
.prose a.btn { text-decoration: none; }
.article { margin-top: 28px; }
.article h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
.article .lead { font-size: 17px; color: var(--text); }
.article h2 { margin-top: 28px; }

/* Cookie consent */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70; max-width: 560px; margin: 0 auto; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.consent p { margin: 0; flex: 1 1 260px; color: #c3cde0; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }

/* Print (orçamento PDF) */
#print-area { display: none; }
@media print {
  body { background: #fff !important; color: #111; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; font-family: "Inter", Arial, sans-serif; color: #111; padding: 24px; }
  #print-area table { width: 100%; border-collapse: collapse; margin: 16px 0; }
  #print-area th, #print-area td { border-bottom: 1px solid #ddd; padding: 8px; text-align: left; font-size: 13px; }
  #print-area .tot { text-align: right; font-size: 18px; font-weight: 800; }
}
