/* === DESIGN SYSTEM — páginas de ferramentas gratuitas === */
:root {
    --bg: hsl(40, 33%, 97%);
    --fg: hsl(160, 20%, 12%);
    --card-bg: #ffffff;
    --primary: hsl(160, 32%, 22%);
    --primary-fg: hsl(40, 33%, 97%);
    --muted: hsl(40, 15%, 92%);
    --muted-fg: hsl(160, 10%, 45%);
    --accent: hsl(18, 76%, 58%);
    --border: hsl(40, 18%, 88%);
    --ok: hsl(150, 45%, 32%);
    --warn: hsl(38, 80%, 40%);
    --bad: hsl(0, 62%, 45%);
    --radius: 0.75rem;
    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; font-weight: 400; }
p { text-wrap: pretty; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* === NAV === */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: 64px;
    background: hsla(40, 33%, 97%, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid hsla(40, 18%, 88%, 0.6);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-brand { font-family: var(--font-display); font-size: 1.25rem; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a { font-size: 0.875rem; color: var(--muted-fg); transition: color 0.2s; }
.nav-links a:hover { color: var(--fg); }
.nav-cta {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    background: var(--primary);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem; font-weight: 500;
    color: var(--primary-fg) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: opacity 0.2s, transform 0.1s;
}
.nav-cta:hover { opacity: 0.9; }
.nav-cta:active { transform: scale(0.97); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--fg); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-mobile {
    display: none; flex-direction: column; gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile a { font-size: 0.875rem; color: var(--muted-fg); }
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
}

/* === HERO === */
.tool-hero { max-width: 760px; margin: 0 auto; padding: 6rem 1.5rem 0; text-align: center; }
.tool-badge {
    display: inline-block;
    background: var(--muted);
    color: var(--primary);
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}
.tool-hero h1 { font-size: 2rem; margin-bottom: 1rem; }
@media (min-width: 769px) { .tool-hero h1 { font-size: 2.6rem; } }
.tool-hero p { color: var(--muted-fg); font-size: 1.05rem; }

/* === CARD DA FERRAMENTA === */
.tool-card {
    max-width: 960px;
    margin: 2.5rem auto 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: 0 8px 30px hsla(160, 32%, 22%, 0.07);
    padding: 1.75rem;
}
@media (min-width: 769px) { .tool-card { padding: 2.25rem; } }

.tool-grid { display: grid; gap: 2rem; }
@media (min-width: 860px) { .tool-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }

.field { margin-bottom: 1.15rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.field .hint { display: block; font-size: 0.78rem; color: var(--muted-fg); font-weight: 400; margin-top: 0.15rem; }
.field input, .field select {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.7rem 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(160, 32%, 22%, 0.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem; font-weight: 600;
    border: 1px solid var(--primary);
    border-radius: 0.6rem;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    background: var(--primary);
    color: var(--primary-fg);
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.985); }
.btn--outline { background: transparent; color: var(--primary); }
.btn--outline:hover { background: var(--muted); opacity: 1; }
.btn-stack { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }

/* === LOGO ESCOLHIDO === */
.field input[type="file"] { padding: 0.55rem 0.6rem; font-size: 0.9rem; cursor: pointer; }
.logo-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.85rem;
    padding: 0.85rem;
    background: var(--muted);
    border-radius: 0.6rem;
}
.logo-row img {
    width: 64px; height: 64px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 4px;
    flex-shrink: 0;
}
.logo-row-actions { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; flex: 1; }
.logo-pos-label { font-size: 0.78rem; font-weight: 600; color: var(--muted-fg); }
.logo-row select { font-size: 0.9rem; padding: 0.45rem 0.6rem; }
.logo-row button {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bad);
    cursor: pointer;
    text-decoration: underline;
}

/* === PREVIEW / RESULTADO === */
.preview-wrap { text-align: center; }
.preview-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--muted-fg); margin-bottom: 0.75rem;
}
.preview-canvas-box {
    background: var(--muted);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex; align-items: center; justify-content: center;
    min-height: 260px;
}
.preview-canvas-box canvas { max-width: 100%; height: auto; border-radius: 0.4rem; }
.preview-empty { color: var(--muted-fg); font-size: 0.9rem; }

.result-main {
    background: var(--primary);
    color: var(--primary-fg);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}
.result-main .result-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.result-main .result-value { font-family: var(--font-display); font-size: 2.5rem; line-height: 1.1; margin: 0.35rem 0; }
.result-main .result-sub { font-size: 0.85rem; opacity: 0.9; }

/* === VEREDITO: lucro ou prejuízo === */
.verdict {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left-width: 5px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.verdict-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.verdict-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1.15;
    margin: 0.3rem 0 0.15rem;
}
.verdict-note { font-size: 0.85rem; line-height: 1.55; }

.verdict--empty { background: var(--muted); border-left-color: var(--border); }
.verdict--empty .verdict-note { color: var(--muted-fg); margin: 0; }

.verdict--ok {
    background: hsl(150, 45%, 95%);
    border-color: hsl(150, 35%, 82%);
    border-left-color: var(--ok);
}
.verdict--ok .verdict-tag, .verdict--ok .verdict-value { color: hsl(150, 48%, 24%); }
.verdict--ok .verdict-note { color: hsl(150, 22%, 30%); }

.verdict--warn {
    background: hsl(40, 88%, 94%);
    border-color: hsl(38, 62%, 82%);
    border-left-color: var(--warn);
}
.verdict--warn .verdict-tag, .verdict--warn .verdict-value { color: hsl(30, 72%, 30%); }
.verdict--warn .verdict-note { color: hsl(30, 35%, 30%); }

.verdict--bad {
    background: hsl(0, 72%, 96%);
    border-color: hsl(0, 50%, 87%);
    border-left-color: var(--bad);
}
.verdict--bad .verdict-tag, .verdict--bad .verdict-value { color: hsl(0, 62%, 38%); }
.verdict--bad .verdict-note { color: hsl(0, 25%, 33%); }

.result-list { display: flex; flex-direction: column; gap: 0.1rem; }
.result-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.result-row:last-child { border-bottom: none; }
.result-row span:first-child { color: var(--muted-fg); }
.result-row span:last-child { font-weight: 700; text-align: right; }

.alert {
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    margin-top: 1rem;
    border-left: 3px solid var(--muted-fg);
    background: var(--muted);
}
.alert--ok { border-left-color: var(--ok); }
.alert--warn { border-left-color: var(--warn); }
.alert--bad { border-left-color: var(--bad); }
.alert strong { font-weight: 700; }
.is-hidden { display: none !important; }

/* === CONTEÚDO === */
.tool-content { max-width: 760px; margin: 0 auto; padding: 3.5rem 1.5rem 0; }
.tool-content h2 { font-size: 1.5rem; margin: 2.5rem 0 0.85rem; }
.tool-content h3 { font-family: var(--font-sans); font-weight: 700; font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
.tool-content p { margin-bottom: 1rem; line-height: 1.75; }
.tool-content ul { margin: 0 0 1rem 1.25rem; }
.tool-content li { margin-bottom: 0.5rem; line-height: 1.7; }
.tool-content strong { font-weight: 600; }
.tool-content a:not(.btn) { color: var(--primary); font-weight: 600; text-decoration: underline; }

.tool-table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tool-table thead tr { background: var(--primary); color: var(--primary-fg); }
.tool-table th { padding: 10px 14px; text-align: left; }
.tool-table td { padding: 10px 14px; }
.tool-table tbody tr:nth-child(odd) { background: var(--card-bg); }
.tool-table tbody tr:nth-child(even) { background: var(--muted); }
.tool-table td:first-child { font-weight: 700; }

/* === FAQ === */
.faq-item { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.faq-item h3 { margin: 0 0 0.35rem; }
.faq-item p { margin: 0; color: var(--muted-fg); font-size: 0.95rem; }

/* === CTA === */
.cta-box {
    background: var(--primary);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 3rem auto 0;
    max-width: 760px;
}
.cta-box p { color: var(--primary-fg); margin-bottom: 1rem; }
.cta-box .cta-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.4rem; font-family: var(--font-display); }
.cta-box .cta-sub { opacity: 0.9; font-size: 0.9rem; }
.cta-box a {
    display: inline-block;
    background: var(--primary-fg);
    color: var(--primary);
    font-weight: 700;
    padding: 0.85rem 1.85rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    transition: opacity 0.2s;
}
.cta-box a:hover { opacity: 0.9; }

/* === HUB DE FERRAMENTAS === */
.hub-grid {
    max-width: 960px;
    margin: 2.5rem auto 0;
    display: grid;
    gap: 1.25rem;
    padding: 0 1.5rem;
}
@media (min-width: 800px) { .hub-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
.hub-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 8px 30px hsla(160, 32%, 22%, 0.06);
    transition: box-shadow 0.25s, transform 0.25s;
}
.hub-card:hover { box-shadow: 0 12px 34px hsla(160, 32%, 22%, 0.12); transform: translateY(-3px); }
.hub-card h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.hub-card h2 a { color: var(--fg); }
.hub-card h2 a::after { content: ""; position: absolute; inset: 0; }
.hub-card:hover h2 a { color: var(--primary); }
.hub-card p { color: var(--muted-fg); font-size: 0.95rem; margin-bottom: 1rem; }
.hub-card ul { list-style: none; margin-bottom: 1.25rem; }
.hub-card li { font-size: 0.9rem; margin-bottom: 0.4rem; }
.hub-card li::before { content: "→ "; color: var(--primary); font-weight: 600; }
.hub-card .hub-link { color: var(--primary); font-weight: 700; font-size: 0.9rem; }

/* === OUTRA FERRAMENTA === */
.tool-cross {
    max-width: 760px; margin: 2rem auto 0;
    padding: 1.25rem 1.5rem;
    background: var(--muted);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
}
.tool-cross p:first-child {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--muted-fg); margin-bottom: 0.4rem;
}
.tool-cross a { color: var(--fg); font-weight: 600; }
.tool-cross a:hover { color: var(--primary); text-decoration: underline; }
.tool-cross .cross-desc { font-size: 0.9rem; color: var(--muted-fg); margin-top: 0.2rem; }

/* === FOOTER === */
.site-footer { border-top: 1px solid var(--border); padding: 3rem 0; margin-top: 4rem; }
.footer-inner { display: flex; flex-direction: column; gap: 2rem; }
@media (min-width: 769px) { .footer-inner { flex-direction: row; flex-wrap: wrap; } }
.footer-brand { font-family: var(--font-display); font-size: 1.125rem; display: flex; align-items: center; gap: 0.75rem; }
.footer-brand img { width: 40px; height: 40px; border-radius: 50%; }
.footer-col { min-width: 150px; }
.footer-col-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; }
.footer-col li { font-size: 0.85rem; color: var(--muted-fg); margin-bottom: 0.5rem; }
.footer-col li a { color: var(--muted-fg); transition: color 0.2s; }
.footer-col li a:hover { color: var(--fg); }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.footer-bottom p { font-size: 0.75rem; color: var(--muted-fg); }
.footer-bottom a { color: var(--muted-fg); margin: 0 0.5rem; }
.footer-bottom a:hover { color: var(--fg); }
