/*
 * Removedor de Fundo — Tudo Para Empresas
 * Copyright (C) 2026 Tudo Para Empresas
 * SPDX-License-Identifier: AGPL-3.0-only
 * Modificado em 25 de setembro de 2026.
 * Licença e código-fonte: ./documentacao/
 */

:root {
  --blue: #3348ff;
  --blue-dark: #2437df;
  --black: #080808;
  --white: #ffffff;
  --ink: #151515;
  --muted: #696969;
  --line: #dedede;
  --panel: #f5f5f5;
  --error: #c42b1c;
  --font: Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  min-width: 320px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.page-shell {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.page-shell::before {
  background: var(--blue);
  border-radius: 50%;
  content: "";
  filter: blur(18px);
  height: 30rem;
  left: -22rem;
  opacity: .9;
  position: absolute;
  top: -21rem;
  width: 30rem;
  z-index: -1;
}

.container { margin: 0 auto; width: min(1180px, calc(100% - 40px)); }

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 0;
}

.brand-link { display: block; height: 57px; overflow: hidden; position: relative; width: 191px; }
.brand-logo { display: block; left: 0; max-width: none; position: absolute; top: 0; transform: translate(-82px, -64px); width: 350px; }

.back-link {
  align-items: center;
  color: #ddd;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 7px;
  text-decoration: none;
  transition: color .18s ease;
}
.back-link:hover { color: var(--white); }
.back-link svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 18px; }

.intro {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding: 52px 0 42px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

h1 { font-size: clamp(42px, 6vw, 70px); letter-spacing: -.065em; line-height: .95; }
h1 span { color: var(--blue); }
.intro-copy { color: #d6d6d6; font-size: 18px; line-height: 1.48; margin-top: 20px; max-width: 680px; }

.privacy-note {
  align-items: center;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  padding: 14px 16px;
}
.privacy-note svg { fill: none; height: 25px; stroke: #7f8cff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 25px; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { font-size: 14px; margin-bottom: 3px; }
.privacy-note span { color: #aaa; font-size: 12px; }

.tool-shell { background: var(--white); border-radius: 20px; color: var(--ink); min-height: 550px; overflow: hidden; position: relative; }
.upload-view { min-height: 550px; padding: 28px; }

.drop-zone {
  align-items: center;
  border: 2px dashed #c7c7c7;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 494px;
  padding: 40px 24px;
  text-align: center;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragover { background: #f5f6ff; border-color: var(--blue); outline: none; }
.drop-zone.dragover { transform: scale(.995); }
.upload-icon { align-items: center; background: var(--blue); border-radius: 18px; color: var(--white); display: flex; height: 74px; justify-content: center; margin-bottom: 26px; width: 74px; }
.upload-icon svg { fill: none; height: 36px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 36px; }
.drop-zone h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.05em; }
.drop-zone p { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 10px 0 24px; }
.drop-zone small { color: #777; font-size: 13px; margin-top: 17px; }

.primary-button, .download-button, .secondary-button {
  align-items: center;
  border: 0;
  border-radius: 9px;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
}
.primary-button { background: var(--blue); color: var(--white); padding: 14px 22px; transition: background .18s ease, transform .18s ease; }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button.wide { gap: 9px; padding: 15px 18px; width: 100%; }
.primary-button svg, .download-button svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 20px; }
.primary-button:disabled { cursor: wait; opacity: .6; transform: none; }

.editor-view { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 640px; }
.workspace { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; padding: 22px; }
.canvas-toolbar { align-items: center; display: flex; font-size: 14px; justify-content: space-between; gap: 20px; margin-bottom: 16px; min-height: 30px; }
.canvas-toolbar > div { align-items: center; display: flex; min-width: 0; }
.status-dot { background: var(--blue); border-radius: 50%; flex: 0 0 auto; height: 8px; margin-right: 9px; width: 8px; }
#fileName { font-weight: 700; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: #858585; margin-left: 9px; white-space: nowrap; }
.text-button { background: none; border: 0; color: var(--blue); font-size: 14px; font-weight: 700; padding: 6px; }
.text-button:hover { text-decoration: underline; }

.checkerboard {
  background-color: #fff;
  background-image: linear-gradient(45deg, #e8e8e8 25%, transparent 25%), linear-gradient(-45deg, #e8e8e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e8e8e8 75%), linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.image-stage { align-items: center; border-radius: 12px; display: flex; flex: 1; justify-content: center; min-height: 470px; overflow: hidden; padding: 24px; position: relative; }
.preview-frame { line-height: 0; max-height: 500px; max-width: 100%; position: relative; }
.preview-frame > img, .result-layer img { display: block; max-height: 500px; max-width: 100%; object-fit: contain; }
.result-layer { inset: 0; overflow: hidden; position: absolute; }
.result-layer img { height: 100%; object-fit: contain; position: relative; width: 100%; z-index: 1; }
.result-background { inset: 0; position: absolute; z-index: 0; }
.comparison-line { background: var(--white); bottom: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.15); cursor: ew-resize; position: absolute; top: 0; touch-action: none; width: 2px; z-index: 4; }
.comparison-line::before { content: ""; inset: 0 -16px; position: absolute; }
.comparison-handle { background: var(--blue); border: 3px solid var(--white); border-radius: 50%; box-shadow: 0 3px 10px rgba(0,0,0,.25); cursor: ew-resize; height: 32px; left: 50%; padding: 0; position: absolute; top: 50%; touch-action: none; transform: translate(-50%, -50%); transition: box-shadow .18s ease, transform .18s ease; width: 32px; }
.comparison-handle::before, .comparison-handle::after { background: var(--white); border-radius: 2px; content: ""; height: 8px; opacity: .9; position: absolute; top: 9px; width: 2px; }
.comparison-handle::before { left: 9px; }
.comparison-handle::after { right: 9px; }
.comparison-handle:hover, .comparison-handle:focus-visible, .comparison-line.dragging .comparison-handle { box-shadow: 0 4px 14px rgba(51,72,255,.45); outline: none; transform: translate(-50%, -50%) scale(1.1); }

.processing { align-items: center; background: rgba(255,255,255,.94); display: flex; flex-direction: column; inset: 0; justify-content: center; padding: 30px; position: absolute; text-align: center; z-index: 8; }
.spinner { animation: spin .8s linear infinite; border: 3px solid #d7d9ff; border-radius: 50%; border-top-color: var(--blue); height: 46px; margin-bottom: 20px; width: 46px; }
.processing strong { font-size: 20px; letter-spacing: -.02em; }
.processing span { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 8px; max-width: 420px; }
.progress-track { background: #e2e2e2; border-radius: 20px; height: 7px; margin-top: 22px; overflow: hidden; width: min(320px, 85%); }
.progress-track span { background: var(--blue); display: block; height: 100%; margin: 0; max-width: none; transition: width .2s ease; width: 0; }
.processing small { color: #666; font-size: 12px; margin-top: 7px; }
@keyframes spin { to { transform: rotate(360deg); } }

.compare-control { align-items: center; display: grid; font-size: 12px; font-weight: 700; gap: 12px; grid-template-columns: auto 1fr auto; margin-top: 15px; }
.compare-control input { accent-color: var(--blue); cursor: ew-resize; width: 100%; }

.control-panel { background: #fafafa; display: flex; flex-direction: column; }
.panel-section { padding: 30px 26px; }
.panel-section + .panel-section { border-top: 1px solid var(--line); }
.step-label { color: var(--blue); display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; margin-bottom: 9px; text-transform: uppercase; }
.panel-section h2 { font-size: 25px; letter-spacing: -.04em; }
.panel-section p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 9px 0 22px; }
.action-section { margin-top: auto; margin-bottom: auto; }
.result-controls { border-top: 0 !important; }

.background-options { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }
.background-choice { align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 9px; color: #555; display: flex; flex-direction: column; font-size: 11px; gap: 7px; justify-content: center; min-height: 72px; padding: 8px 4px; position: relative; }
.background-choice:hover, .background-choice.active { border-color: var(--blue); color: var(--blue); }
.background-choice.active { box-shadow: 0 0 0 1px var(--blue); font-weight: 700; }
.swatch { border: 1px solid #ccc; border-radius: 50%; display: block; height: 27px; overflow: hidden; width: 27px; }
.custom-choice { cursor: pointer; }
.custom-choice input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.custom-swatch { background: conic-gradient(#ff3b30, #ffcc00, #34c759, #00c7be, #007aff, #5856d6, #af52de, #ff2d55, #ff3b30); border: 2px solid var(--white); box-shadow: 0 0 0 1px #bdbdbd; overflow: visible; position: relative; }
.custom-swatch::before { background: var(--white); border-radius: 50%; content: ""; inset: 7px; position: absolute; }
.custom-swatch::after { background: var(--chosen-color, #ffd400); border: 2px solid var(--white); border-radius: 50%; bottom: -3px; box-shadow: 0 1px 3px rgba(0,0,0,.28); content: ""; height: 10px; position: absolute; right: -3px; width: 10px; }

.cleanup-control { border-top: 1px solid var(--line); margin: 2px 0 18px; padding-top: 17px; }
.refinement-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.cleanup-button, .edit-cutout-button { align-items: center; border: 1px solid #cbd0ff; border-radius: 9px; display: flex; font-size: 12px; font-weight: 800; gap: 7px; justify-content: center; min-height: 43px; padding: 9px 8px; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.cleanup-button { background: #eef0ff; color: #263ce8; }
.edit-cutout-button { background: var(--white); color: #263ce8; }
.cleanup-button:hover, .edit-cutout-button:hover { background: #e2e5ff; border-color: var(--blue); }
.cleanup-button.active { background: #171717; border-color: #171717; color: var(--white); }
.cleanup-button:disabled { cursor: wait; opacity: .6; }
.cleanup-button svg, .edit-cutout-button svg { fill: none; flex: 0 0 auto; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 18px; }
.cleanup-control small { color: #777; display: block; font-size: 11px; line-height: 1.4; margin-top: 7px; text-align: center; }

body.editor-open { overflow: hidden; }
.mask-editor { align-items: center; background: rgba(0,0,0,.82); display: flex; inset: 0; justify-content: center; padding: 22px; position: fixed; z-index: 100; }
.mask-editor-dialog { background: var(--white); border-radius: 18px; box-shadow: 0 28px 90px rgba(0,0,0,.46); color: var(--ink); display: grid; grid-template-rows: auto auto minmax(260px, 1fr) auto; max-height: calc(100vh - 44px); max-width: 1240px; overflow: hidden; width: 100%; }
.mask-editor-header { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; gap: 28px; justify-content: space-between; padding: 20px 24px 17px; }
.mask-editor-header .step-label { margin-bottom: 4px; }
.mask-editor-header h2 { font-size: 26px; letter-spacing: -.04em; margin: 0; }
.mask-editor-header p { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 5px 0 0; }
.editor-close { align-items: center; background: #f0f0f0; border: 0; border-radius: 50%; color: #333; display: flex; flex: 0 0 auto; font-size: 26px; height: 36px; justify-content: center; line-height: 1; padding: 0 0 3px; width: 36px; }
.editor-close:hover { background: #e1e1e1; }

.mask-editor-toolbar { align-items: center; background: #fafafa; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 24px; }
.editor-tool-group { display: flex; gap: 6px; }
.editor-tool, .icon-tool, .reset-edit-button { align-items: center; background: var(--white); border: 1px solid #d4d4d4; border-radius: 8px; color: #444; display: inline-flex; font-size: 12px; font-weight: 800; gap: 7px; justify-content: center; min-height: 38px; padding: 8px 11px; }
.editor-tool:hover, .icon-tool:hover, .reset-edit-button:hover { border-color: #999; }
.editor-tool.active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.editor-tool svg, .icon-tool svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 18px; }
.icon-tool { padding: 8px; width: 38px; }
.icon-tool:disabled, .reset-edit-button:disabled { cursor: default; opacity: .4; }
.reset-edit-button { white-space: nowrap; }
.editor-slider { display: grid; flex: 1 1 150px; gap: 5px; max-width: 210px; min-width: 145px; }
.editor-slider span { color: #555; display: flex; font-size: 11px; font-weight: 800; justify-content: space-between; }
.editor-slider output { color: var(--blue); }
.editor-slider input { accent-color: var(--blue); cursor: pointer; width: 100%; }
.history-tools { margin-left: auto; }

.editor-canvas-viewport { align-items: flex-start; display: flex; justify-content: flex-start; min-height: 320px; overflow: auto; padding: 24px; position: relative; }
.editor-canvas-wrapper { box-shadow: 0 8px 28px rgba(0,0,0,.18); flex: 0 0 auto; line-height: 0; margin: auto; position: relative; }
#maskEditorCanvas { cursor: none; display: block; touch-action: none; }
.brush-cursor { border: 2px solid var(--white); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.75), 0 1px 4px rgba(0,0,0,.35); display: none; left: 0; pointer-events: none; position: absolute; top: 0; transform: translate(-50%, -50%); z-index: 3; }
.brush-cursor.erase { border-color: #ff5a52; }
.editor-loading { align-items: center; background: rgba(255,255,255,.92); display: flex; flex-direction: column; inset: 0; justify-content: center; position: absolute; z-index: 5; }
.editor-loading strong { font-size: 15px; }
.editor-loading .spinner { height: 38px; margin-bottom: 14px; width: 38px; }

.mask-editor-footer { align-items: center; border-top: 1px solid var(--line); display: grid; gap: 18px; grid-template-columns: auto minmax(160px, 1fr) auto; padding: 14px 24px; }
.zoom-controls { align-items: center; display: flex; gap: 7px; }
.zoom-controls button { background: #f0f0f0; border: 0; border-radius: 7px; color: #222; font-size: 20px; font-weight: 700; height: 34px; width: 34px; }
.zoom-controls output { color: #555; font-size: 12px; font-weight: 800; min-width: 42px; text-align: center; }
.mask-editor-footer > p { color: #707070; font-size: 12px; line-height: 1.4; margin: 0; text-align: center; }
.editor-actions { display: flex; gap: 8px; }
.editor-cancel, .editor-apply { border-radius: 8px; font-size: 13px; font-weight: 800; padding: 11px 15px; }
.editor-cancel { background: var(--white); border: 1px solid #cfcfcf; color: #333; }
.editor-apply { background: var(--blue); border: 1px solid var(--blue); color: var(--white); }
.editor-apply:disabled { cursor: wait; opacity: .6; }

.download-button { background: var(--ink); color: var(--white); gap: 9px; padding: 15px 14px; transition: background .18s ease; width: 100%; }
.download-button:hover { background: var(--blue); }
.secondary-button { background: transparent; border: 1px solid #cfcfcf; color: #333; margin-top: 9px; padding: 13px 12px; width: 100%; }
.secondary-button:hover { border-color: #888; }

.message { background: #fff1ef; border: 1px solid #ffc7c0; border-radius: 10px; bottom: 18px; color: var(--error); font-size: 14px; font-weight: 700; left: 50%; max-width: calc(100% - 36px); padding: 13px 17px; position: absolute; transform: translateX(-50%); z-index: 20; }

.benefits { display: grid; gap: 1px; grid-template-columns: repeat(3, 1fr); margin-top: 52px; }
.benefits article { border-top: 1px solid #333; display: flex; gap: 22px; padding: 23px 8px 0 0; }
.benefits article > span { color: #737373; font-size: 12px; font-weight: 700; padding-top: 4px; }
.benefits h2 { font-size: 18px; letter-spacing: -.025em; margin-bottom: 8px; }
.benefits p { color: #aaa; font-size: 14px; line-height: 1.5; max-width: 290px; }

.faq { margin: 100px 0 70px; max-width: 820px; }
.faq > h2 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -.05em; margin-bottom: 28px; }
.faq details { border-top: 1px solid #333; }
.faq details:last-child { border-bottom: 1px solid #333; }
.faq summary { cursor: pointer; font-size: 17px; font-weight: 700; list-style: none; padding: 21px 42px 21px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { color: var(--blue); content: "+"; font-size: 24px; font-weight: 400; position: absolute; right: 8px; top: 15px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: #b7b7b7; font-size: 15px; line-height: 1.6; max-width: 700px; padding: 0 42px 22px 0; }

.site-footer { align-items: center; border-top: 1px solid #242424; color: #888; display: flex; flex-wrap: wrap; font-size: 13px; gap: 7px; justify-content: center; line-height: 1.5; padding: 27px 0 32px; text-align: center; }
.site-footer a { color: var(--white); font-weight: 700; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .intro { align-items: flex-start; flex-direction: column; gap: 24px; }
  .editor-view { grid-template-columns: 1fr; }
  .workspace { border-bottom: 1px solid var(--line); border-right: 0; }
  .image-stage { min-height: 430px; }
  .action-section { margin: 0; }
  .background-options { grid-template-columns: repeat(6, 1fr); }
  .benefits { gap: 24px; }
  .mask-editor { padding: 12px; }
  .mask-editor-dialog { max-height: calc(100vh - 24px); }
  .mask-editor-toolbar { gap: 12px; padding: 11px 16px; }
  .history-tools { margin-left: 0; }
  .mask-editor-footer { grid-template-columns: auto 1fr; padding: 12px 16px; }
  .mask-editor-footer > p { display: none; }
}

@media (max-width: 680px) {
  .container { width: min(100% - 28px, 1180px); }
  .site-header { padding: 20px 0; }
  .brand-link { height: 46px; width: 155px; }
  .brand-logo { transform: translate(-66px, -52px); width: 283px; }
  .back-link { font-size: 0; }
  .back-link svg { height: 23px; width: 23px; }
  .intro { padding: 38px 0 30px; }
  .intro-copy { font-size: 16px; }
  .privacy-note { width: 100%; }
  .tool-shell, .upload-view { min-height: 470px; }
  .upload-view { padding: 14px; }
  .drop-zone { min-height: 440px; }
  .workspace { padding: 14px; }
  .canvas-toolbar { align-items: flex-start; }
  .canvas-toolbar > div { align-items: flex-start; flex-direction: column; }
  .status-dot { display: none; }
  .file-meta { margin: 4px 0 0; }
  .image-stage { min-height: 380px; padding: 12px; }
  .preview-frame > img, .result-layer img { max-height: 430px; }
  .panel-section { padding: 26px 20px; }
  .background-options { grid-template-columns: repeat(3, 1fr); }
  .benefits { grid-template-columns: 1fr; margin-top: 42px; }
  .benefits article { padding-top: 20px; }
  .faq { margin-top: 70px; }
  .mask-editor { align-items: stretch; padding: 0; }
  .mask-editor-dialog { border-radius: 0; max-height: 100vh; }
  .mask-editor-header { padding: 15px 14px 12px; }
  .mask-editor-header h2 { font-size: 22px; }
  .mask-editor-header p { display: none; }
  .mask-editor-toolbar { align-items: stretch; gap: 10px; }
  .tool-modes { width: 100%; }
  .editor-tool { flex: 1; }
  .editor-slider { max-width: none; min-width: calc(50% - 5px); }
  .history-tools { width: 100%; }
  .reset-edit-button { flex: 1; }
  .editor-canvas-viewport { min-height: 230px; padding: 14px; }
  .mask-editor-footer { grid-template-columns: 1fr; gap: 10px; }
  .zoom-controls { justify-content: center; }
  .editor-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .editor-cancel, .editor-apply { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
