:root {
  --background: hsl(40, 30%, 96%);
  --foreground: hsl(222, 35%, 13%);
  --surface: hsl(40, 24%, 92%);
  --card: hsl(40, 40%, 99%);
  --primary: hsl(164, 78%, 22%);
  --primary-foreground: hsl(40, 40%, 98%);
  --accent: hsl(36, 92%, 50%);
  --muted: hsl(40, 18%, 86%);
  --muted-foreground: hsl(222, 12%, 38%);
  --success: hsl(152, 62%, 30%);
  --error: hsl(5, 68%, 46%);
  --warning: hsl(38, 92%, 45%);
  --border: hsl(38, 18%, 85%);
  --ink: hsl(222, 35%, 14%);
  --ink-foreground: hsl(40, 25%, 94%);
  --font-base: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", SFMono-Regular, Consolas, Menlo, monospace;
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --shadow: 0 1px 2px hsla(222, 30%, 10%, 0.05), 0 2px 4px hsla(222, 30%, 10%, 0.04);
  --shadow-md: 0 1px 2px hsla(222, 30%, 10%, 0.05), 0 8px 16px -6px hsla(222, 30%, 10%, 0.08);
  --shadow-lg: 0 2px 4px hsla(222, 30%, 10%, 0.05), 0 18px 32px -10px hsla(222, 30%, 10%, 0.14);
  --focus: 0 0 0 3px hsla(164, 78%, 22%, 0.22);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: hsl(222, 28%, 9%);
    --foreground: hsl(40, 20%, 92%);
    --surface: hsl(222, 24%, 12%);
    --card: hsl(222, 24%, 14%);
    --primary: hsl(160, 58%, 46%);
    --primary-foreground: hsl(222, 30%, 8%);
    --accent: hsl(36, 90%, 56%);
    --muted: hsl(222, 18%, 22%);
    --muted-foreground: hsl(222, 10%, 68%);
    --success: hsl(152, 55%, 48%);
    --error: hsl(5, 72%, 60%);
    --warning: hsl(38, 90%, 56%);
    --border: hsl(222, 18%, 22%);
    --ink: hsl(222, 30%, 7%);
    --ink-foreground: hsl(40, 20%, 92%);
    --shadow-md: 0 1px 2px hsla(222, 40%, 2%, 0.3), 0 8px 16px -6px hsla(222, 40%, 2%, 0.4);
    --shadow-lg: 0 2px 4px hsla(222, 40%, 2%, 0.3), 0 18px 32px -10px hsla(222, 40%, 2%, 0.5);
    --focus: 0 0 0 3px hsla(160, 58%, 46%, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-base);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 300;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.bar { max-width: 1120px; margin: 0 auto; padding: 0.75rem 1rem; display: flex; align-items: center; gap: 1.5rem; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; flex: none; }
.logo em { font-style: normal; color: var(--primary); }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground); font-size: 18px; }
.nav { display: flex; gap: 0.25rem; flex: 1; min-width: 0; }
.nav a { padding: 0.4rem 0.75rem; border-radius: var(--radius); color: var(--muted-foreground); font-size: 0.9rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: var(--surface); color: var(--foreground); }
.nav a.active { background: var(--surface); color: var(--primary); }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.1rem; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-foreground);
  font: 600 0.95rem var(--font-base); text-decoration: none; cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.lg { padding: 0.85rem 1.4rem; font-size: 1rem; }
.btn.sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn.outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn.outline:hover { background: var(--surface); filter: none; }
.btn.outline.on { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.btn.secondary { background: var(--surface); color: var(--foreground); border-color: var(--border); }
.btn.ghost { background: transparent; color: var(--foreground); }
.btn.ghost:hover { background: var(--surface); filter: none; }
.btn.icon { padding: 0.35rem; width: 30px; height: 30px; }
.input, .select {
  padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--foreground); font: 0.95rem var(--font-base);
}
.input.mono { font-family: var(--font-mono); width: 9rem; }
.select { min-width: 14rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.label { font-size: 0.84rem; font-weight: 500; color: var(--muted-foreground); }
.label em { margin-left: 0.5rem; font-style: normal; font-family: var(--font-mono); color: var(--foreground); }
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ---------- Página de ferramenta ---------- */
.tool-page { max-width: 920px; margin: 0 auto; padding: 3rem 1rem 0; }
.eyebrow { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.tool-page h1 { margin: 0.75rem 0 0.5rem; font-family: var(--font-heading); font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
.lead { margin: 0 0 1.5rem; max-width: 62ch; font-size: 1.08rem; line-height: 1.6; color: var(--muted-foreground); }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 1.5rem; }
.trust { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.trust li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 1rem; border-left: 2px solid var(--primary); font-size: 0.88rem; color: var(--muted-foreground); line-height: 1.45; }
.trust svg { margin-top: 3px; color: var(--primary); font-size: 18px; }
.trust strong { display: block; color: var(--foreground); font-weight: 600; }
.others { margin-top: 4rem; }
.others h2, .h2 { margin: 0 0 1rem; font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 500; letter-spacing: -0.015em; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.mini { position: relative; display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.mini:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mini svg.ic { color: var(--primary); font-size: 20px; margin-bottom: 0.5rem; }
.mini b { font-weight: 600; }
.mini span { font-size: 0.86rem; line-height: 1.45; color: var(--muted-foreground); }

/* ---------- Controles das ferramentas ---------- */
.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 2.5rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius-md); text-align: center; cursor: pointer; background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.dropzone svg { font-size: 36px; color: var(--primary); margin-bottom: 0.5rem; }
.dropzone strong { font-weight: 600; }
.dropzone span { font-size: 0.86rem; color: var(--muted-foreground); }
.dropzone.disabled { opacity: 0.5; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1rem; justify-content: space-between; }
.actions .field { margin: 0; }
.hint { font-size: 0.86rem; color: var(--muted-foreground); }
.error { margin: 0.75rem 0 0; color: var(--error); font-size: 0.9rem; }
.notice { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 1rem; padding: 0.75rem 1rem; background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: var(--radius); font-size: 0.9rem; line-height: 1.5; }
.notice svg { margin-top: 3px; color: var(--warning); font-size: 18px; }
.notice p { margin: 0; }
.progress { margin-top: 1rem; height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress .bar2 { height: 100%; width: 0; background: var(--primary); transition: width 0.2s; }
.progress-text { display: block; margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-foreground); }

/* ---------- Listas ---------- */
.files, .results { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.item .idx { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font: 0.72rem var(--font-mono); color: var(--muted-foreground); }
.item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; font-weight: 500; }
.item .sz { flex: none; font: 0.8rem var(--font-mono); color: var(--muted-foreground); }
.item .acts { flex: none; display: flex; }
.results .item { padding: 0.75rem; }
.results .state { flex: none; display: grid; place-items: center; width: 24px; font-size: 20px; }
.results .ok { color: var(--success); }
.results .warn { color: var(--warning); }
.results .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.results .meta { font: 0.78rem var(--font-mono); color: var(--muted-foreground); }
.results .meta strong { color: var(--foreground); font-weight: 500; }
.results .meta .arrow { margin: 0 0.4em; }
.results .meta .msg { font-family: var(--font-base); color: var(--foreground); }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); font: 600 0.78rem var(--font-mono); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--muted); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Foto 3x4 ---------- */
.editor { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; margin-top: 1rem; }
.preview { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.preview canvas { width: 100%; max-width: 260px; height: auto; aspect-ratio: 3 / 4; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.preview .cap { font: 0.76rem var(--font-mono); color: var(--muted-foreground); }
.ctrls { display: flex; flex-direction: column; gap: 1.5rem; }
.swatches { display: flex; gap: 0.5rem; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); cursor: pointer; }
.swatch.on { outline: 2px solid var(--primary); outline-offset: 2px; }

.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.checker { background-image: conic-gradient(#cfcfcf 25%, #fff 0 50%, #cfcfcf 0 75%, #fff 0); background-size: 16px 16px; }
.editor.wide { grid-template-columns: minmax(0, 1fr) 280px; }
.preview.big { align-items: stretch; }
.preview.big canvas { max-width: 100%; aspect-ratio: auto; cursor: crosshair; }
.swatches input[type="color"] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: none; cursor: pointer; }
@media (max-width: 720px) { .editor.wide { grid-template-columns: 1fr; } }

/* ---------- Home ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.hero { padding: 5rem 0 3rem; max-width: 780px; }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 0.8rem; font-weight: 500; color: var(--muted-foreground); }
.pill svg { color: var(--primary); }
.hero h1 { margin: 1.5rem 0 1rem; font-family: var(--font-heading); font-size: clamp(2.5rem, 7vw, 4.6rem); font-weight: 500; line-height: 1.02; letter-spacing: -0.03em; }
.hero h1 em { font-style: italic; color: var(--primary); }
.hero .sub { margin: 0 0 2rem; max-width: 58ch; font-size: 1.15rem; line-height: 1.65; color: var(--muted-foreground); }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.section { padding: 3rem 0 0; scroll-margin-top: 5rem; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.tool-card { position: relative; display: flex; flex-direction: column; padding: 1.5rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tool-card .num { position: absolute; top: 1rem; right: 1rem; font: 0.8rem var(--font-mono); color: var(--muted-foreground); }
.tool-card svg.ic { color: var(--primary); font-size: 26px; margin-bottom: 1rem; }
.tool-card h3 { margin: 0 0 0.5rem; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 500; }
.tool-card p { margin: 0 0 1rem; flex: 1; font-size: 0.94rem; line-height: 1.55; color: var(--muted-foreground); }
.tool-card .go { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.9rem; font-weight: 600; color: var(--primary); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.step { padding-top: 1rem; border-top: 2px solid var(--primary); }
.step .si { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-size: 20px; }
.step h3 { margin: 0.75rem 0 0.5rem; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 500; }
.step h3 span { font: 0.9rem var(--font-mono); color: var(--muted-foreground); }
.step p { margin: 0; font-size: 0.94rem; line-height: 1.55; color: var(--muted-foreground); }
.privacy { margin-top: 4rem; display: flex; gap: 1.5rem; align-items: flex-start; padding: 2rem; border-radius: var(--radius-lg); background: var(--ink); color: var(--ink-foreground); }
.privacy > svg { flex: none; margin-top: 4px; color: var(--accent); font-size: 28px; }
.privacy h2 { margin: 0 0 0.5rem; font-family: var(--font-heading); font-size: 1.6rem; font-weight: 500; }
.privacy p { margin: 0; max-width: 62ch; line-height: 1.65; opacity: 0.85; }
.faq { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); overflow: hidden; }
.faq details { border-top: 1px solid var(--border); }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 1.2rem var(--font-mono); color: var(--muted-foreground); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 1.25rem 1.25rem; color: var(--muted-foreground); line-height: 1.65; }

/* ---------- Rodapé ---------- */
.site-footer { margin-top: 4rem; background: var(--surface); border-top: 1px solid var(--border); }
.footer-in { max-width: 1120px; margin: 0 auto; padding: 3rem 1rem 2rem; display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.footer-in p { margin: 0.5rem 0 0; max-width: 44ch; color: var(--muted-foreground); font-size: 0.92rem; line-height: 1.6; }
.footer-in .flogo { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 600; }
.footer-in .flogo em { font-style: normal; color: var(--primary); }
.footer-in .priv { display: flex; align-items: flex-start; gap: 0.5rem; color: var(--foreground); }
.footer-in .priv svg { margin-top: 3px; color: var(--primary); }
.footer-in h2 { margin: 0 0 0.75rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.footer-in ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-in ul a { text-decoration: none; font-size: 0.92rem; }
.footer-in ul a:hover { color: var(--primary); text-decoration: underline; }
.legal { max-width: 1120px; margin: 0 auto; padding: 1rem; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 0.82rem; }

@media (max-width: 880px) {
  .bar { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .nav { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .footer-in { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .trust { grid-template-columns: 1fr; }
  .panel { padding: 1rem; }
  .editor { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero { padding-top: 3rem; }
  .tools { grid-template-columns: 1fr; }
  .privacy { flex-direction: column; padding: 1.5rem; }
}
@media (max-width: 520px) { .item .sz { display: none; } }
