/* =========================================================
   Fábio G. Apps — base visual compartilhada dos apps
   Mesma identidade do portfólio (assets/css/style.css).
   ========================================================= */
:root {
    --brand: #77aadd;
    --brand-50: #f1f6fc;
    --brand-100: #e1ecf8;
    --brand-600: #3f7fc1;
    --brand-700: #2b64a0;
    --ink: #18222e;
    --ink-2: #3c4a59;
    --muted: #627080;
    --line: #e2e8ef;
    --surface: #f6f8fb;
    --bg: #ffffff;
    --dark: #111c28;
    --ok: #1f8a5b;
    --ok-bg: #e6f4ed;
    --warn: #9a5c00;
    --warn-bg: #fff2dc;
    --error: #c0392b;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 10px 30px -12px rgba(17, 28, 40, .18);
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 15px/1.55 var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(1200px 500px at 50% -200px, var(--brand-100), transparent 70%),
        var(--surface);
    min-height: 100vh;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--brand-700); }

/* ---------- Topo ---------- */
.topbar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: 44px; width: auto; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.top-link {
    font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none;
    padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
}
.top-link:hover { color: var(--ink); border-color: var(--ink-2); }
.langs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.langs a {
    font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none;
    padding: 5px 10px; border-radius: 999px;
}
.langs a[aria-current] { background: var(--ink); color: #fff; }
.langs a:not([aria-current]):hover { color: var(--ink); }

/* ---------- Estrutura ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.wrap.narrow { max-width: 760px; }

.hero { text-align: center; padding: 14px 0 28px; }
.eyebrow {
    display: inline-block; margin: 0 0 12px;
    font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--brand-700); background: var(--brand-100); padding: 5px 12px; border-radius: 999px;
}
.hero h1 {
    font: 700 clamp(36px, 6vw, 56px)/1.02 var(--font-display);
    margin: 0 0 10px;
    letter-spacing: -.01em;
}
.hero p { margin: 0 auto; max-width: 600px; color: var(--muted); font-size: 16px; }

.panel {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    min-width: 0;
}
.panel + .panel { margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2 > .panel + .panel { margin-top: 0; }
.sticky { position: sticky; top: 16px; }

.step {
    display: flex; align-items: center; gap: 10px;
    font: 700 13px/1.2 var(--font-body);
    text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2);
    margin: 28px 0 14px;
}
.step:first-child { margin-top: 0; }
.step b {
    display: inline-grid; place-items: center; flex: none;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--brand-100); color: var(--brand-700); font-size: 12px;
}
.panel h2:not(.step), .panel h3 { margin: 0 0 12px; }
.panel h2:not(.step) { font: 700 26px/1.1 var(--font-display); }
.panel h3 { font-size: 16px; }

/* ---------- Campos ---------- */
.field { display: block; margin-bottom: 14px; min-width: 0; }
.field > span:not(.affix):not(.money-field):not(.percent-field), .field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field small, .help { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"],
input[type="search"], textarea, select {
    width: 100%;
    font: inherit; font-size: 15px; color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 12px;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
input:disabled, select:disabled { opacity: .5; }
input[readonly] { background: var(--surface); }

/* Campo com prefixo/sufixo (R$, %, US$) */
.affix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.affix:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
.affix > span { display: grid; place-items: center; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); }
.affix > span:first-child { border-right: 1px solid var(--line); border-radius: 10px 0 0 10px; }
.affix > span:last-child { border-left: 1px solid var(--line); border-radius: 0 10px 10px 0; }
.affix input { border: 0; box-shadow: none !important; background: transparent; min-width: 0; }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin: -2px 0 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand-600); }

/* Segmentado (pílulas) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
    display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.seg span:hover { border-color: var(--brand); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* Cartões de opção (radio grande) */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option > span {
    display: block; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
    cursor: pointer; transition: all .15s;
}
.option strong { display: block; font-size: 14px; margin-bottom: 4px; }
.option small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.option > span:hover { border-color: var(--brand); }
.option input:checked + span { background: var(--brand-50); border-color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-600); }
.option input:focus-visible + span { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 14px/1 var(--font-body);
    padding: 13px 18px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--bg); color: var(--ink);
    cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn.ghost { background: var(--surface); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.actions .btn { flex: 1 1 160px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* ---------- Resultados ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; min-width: 0;
}
.stat > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat strong { display: block; font: 700 28px/1.15 var(--font-display); margin-top: 4px; overflow-wrap: anywhere; }
.stat small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.accent { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.stat.accent > span, .stat.accent small { color: rgba(255, 255, 255, .8); }

.pill { display: inline-block; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.positive { color: var(--ok) !important; }
.negative { color: var(--error) !important; }
.error-msg { color: var(--error); font-weight: 500; }

.hint { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.notice {
    background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--radius);
    padding: 14px 16px; color: var(--ink-2); font-size: 14px;
}

/* ---------- Texto / SEO ---------- */
.prose { max-width: 760px; margin: 40px auto 0; }
.prose h2 { font: 700 30px/1.1 var(--font-display); margin: 32px 0 10px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 20px; }

.faq { max-width: 760px; margin: 40px auto 0; }
.faq h2 { font: 700 32px/1.1 var(--font-display); text-align: center; margin: 0 0 18px; }
.faq details {
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-600); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 0; color: var(--ink-2); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--bg); }
table.data th, table.data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { background: var(--surface); font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- Anúncio ---------- */
.ad { margin: 36px auto 0; max-width: 728px; text-align: center; }
.ad > small {
    display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}

/* ---------- Rodapé ---------- */
.foot {
    max-width: 1100px; margin: 20px auto 0; padding: 28px 16px 40px;
    border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.foot .brand img { height: 36px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot nav a { font-size: 13px; color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--ink); }
.foot nav a[aria-current] { color: var(--ink); font-weight: 600; }
.foot .by {
    font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none;
    padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
}
.foot .by:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50;
    background: var(--dark); color: #fff; font-size: 14px; font-weight: 500;
    padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
    .grid-2 { grid-template-columns: 1fr; }
    .sticky { position: static; }
}
@media (max-width: 560px) {
    .brand img { height: 36px; }
    .top-link { display: none; }
    .panel { padding: 18px; border-radius: var(--radius); }
    .row, .row-3 { grid-template-columns: 1fr; gap: 0; }
    .foot { flex-direction: column; text-align: center; }
    .foot nav { justify-content: center; }
}
