/* ==========================================================================
   RemoveBG — estilos
   Paleta e tipografia inspiradas no remove.bg (azul #0f70e6, Poppins)
   ========================================================================== */

:root {
  --blue: #0f70e6;
  --blue-dark: #0d5fc2;
  --blue-soft: #e8f1fe;
  --ink: #1f2733;
  --muted: #5b6472;
  --line: #e3e8ef;
  --bg: #f7f9fa;
  --white: #ffffff;
  --danger: #d93025;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.1);
  --font-head: 'Poppins', 'Open Sans', sans-serif;
  --font-body: 'Open Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --container: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.container { width: min(var(--container), 100% - 40px); margin-inline: auto; }
.container-narrow { width: min(760px, 100% - 40px); }

/* --------------------------------- Botões -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 13px 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .05s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(15, 112, 230, .35); outline-offset: 2px; }

.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }

.btn-outline { background: #fff; border-color: #c9d1dd; color: #3b4151; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

.btn-lg { padding: 16px 34px; font-size: 16px; border-radius: 8px; }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* --------------------------------- Cabeçalho ------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand-accent { color: var(--blue); }

.main-nav { display: flex; gap: 26px; margin-left: auto; }
.main-nav a { color: var(--muted); font-weight: 600; font-size: 15px; }
.main-nav a:hover { color: var(--blue); text-decoration: none; }
.header-cta { margin-left: 4px; }

/* ----------------------------------- Hero -------------------------------- */

.hero {
  padding: 56px 0 72px;
  background:
    radial-gradient(1000px 420px at 50% -12%, rgba(15, 112, 230, .10), transparent 70%),
    var(--white);
}

/* Com o editor aberto, o texto do topo dá lugar à ferramenta. */
body.editing .hero { padding-top: 26px; }
body.editing .hero-copy { display: none; }

.hero-copy { text-align: center; max-width: 780px; margin: 0 auto 34px; }

.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}

.subtitle { font-size: 18px; color: var(--muted); margin: 0 0 18px; }

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 13.5px;
  font-weight: 600;
}
.privacy-badge svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* --------------------------------- Dropzone ------------------------------- */

.upload-view { max-width: 760px; margin: 0 auto; }

.dropzone {
  border: 2px dashed #b9c4d4;
  border-radius: var(--radius-lg);
  background: #fbfcfe;
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.dropzone:hover { border-color: var(--blue); background: #f6faff; }
.dropzone:focus-visible { outline: 3px solid rgba(15, 112, 230, .35); outline-offset: 3px; }
.dropzone.is-dragover {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 6px rgba(15, 112, 230, .12);
}

.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.dropzone-icon { width: 52px; height: 52px; fill: var(--blue); }
.dropzone-hint { color: var(--muted); font-size: 14.5px; }
.dropzone-hint kbd {
  font-family: var(--font-body);
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
}

.upload-note { text-align: center; color: var(--muted); font-size: 13.5px; margin: 14px 0 0; }

/* --------------------------------- Progresso ------------------------------ */

.progress-panel {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.progress-thumb {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e6e9ee 25%, transparent 25%),
    linear-gradient(-45deg, #e6e9ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e9ee 75%),
    linear-gradient(-45deg, transparent 75%, #e6e9ee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  display: grid;
  place-items: center;
}
.progress-thumb img { width: 100%; height: 100%; object-fit: contain; }

.progress-body { flex: 1; min-width: 0; }

.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.progress-label { font-weight: 700; font-size: 15px; }
.progress-percent { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4a97f5);
  transition: width .25s ease;
}
.progress-fill.is-indeterminate {
  width: 35% !important;
  animation: slide 1.15s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

.progress-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

.error-box {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #f3c2be;
  background: #fdf0ef;
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 14.5px;
}
.error-box strong { display: block; }

/* --------------------------------- Editor -------------------------------- */

.editor-view { margin-top: 8px; }

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.preview-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: #f1f4f8;
  border-radius: 999px;
  margin-bottom: 16px;
}
.seg-btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: #fff; color: var(--blue-dark); box-shadow: var(--shadow-sm); }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f2f4f7;
}

/* Xadrez que indica transparência */
.checker {
  position: absolute;
  inset: 0;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e6e9ee 25%, transparent 25%),
    linear-gradient(-45deg, #e6e9ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e9ee 75%),
    linear-gradient(-45deg, transparent 75%, #e6e9ee 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.stage[data-mode="original"] .checker { background-image: none; background-color: #f2f4f7; }

/* Fundos escolhidos pelo usuário (cor sólida ou desfoque) */
.stage[data-bg="color"] .checker,
.stage[data-bg="blur"] .checker { display: none; }
.stage[data-bg="color"] { background: var(--stage-color, #fff); }

.blur-bg {
  position: absolute;
  inset: -30px;
  z-index: 0;
  display: none;
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.06);
}
.stage[data-bg="blur"] .blur-bg { display: block; }
.stage[data-mode="original"] .blur-bg { display: none; }

/* Na visualização neutra e na comparação, o cenário padrão volta ao cinza. */
.stage[data-mode="original"] { background: #f2f4f7; }
/* Na comparação o resultado fica por baixo e o original aparece à esquerda. */
.stage[data-mode="comparar"] .layer-result { display: block; }

.layer {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: none;
}
.stage[data-mode="resultado"] .layer-result,
.stage[data-mode="original"] .layer-original { display: block; }

/* ------------------------------- Comparação ------------------------------- */

.compare { position: absolute; inset: 0; z-index: 2; }
.compare[hidden] { display: none; }

.compare-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.compare-clip img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  transform: translateX(-1px);
  cursor: ew-resize;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 6px rgba(0, 0, 0, .25);
}
.compare-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}
.compare-arrows {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: 18px;
  color: var(--blue-dark);
}
.compare-handle:focus-visible::before { outline: 3px solid var(--blue); }

.compare-tag {
  position: absolute;
  top: 12px;
  z-index: 3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: rgba(31, 39, 51, .78);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
}
.compare-tag-left { left: 12px; }
.compare-tag-right { right: 12px; }

.stage-caption { margin: 12px 2px 2px; font-size: 13.5px; color: var(--muted); }

/* ------------------------------- Ferramentas ------------------------------ */

.tools-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 84px;
}

.tools-title { font-size: 17px; margin-bottom: 16px; }

.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 7px;
}
.field-control {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  padding: 10px 12px;
  border: 1px solid #cfd6e0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.field-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15, 112, 230, .18); }
.field-hint { font-size: 12.5px; color: var(--muted); margin: 7px 0 0; }

.bg-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bg-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 9px 6px;
  border: 1px solid #d7dde6;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.bg-opt:hover { border-color: var(--blue); color: var(--ink); }
.bg-opt.is-active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }

.bg-swatch {
  width: 100%;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .08);
}
.swatch-transparent {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #d9dee6 25%, transparent 25%),
    linear-gradient(-45deg, #d9dee6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dee6 75%),
    linear-gradient(-45deg, transparent 75%, #d9dee6 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
.swatch-color { background: #ffffff; }
.swatch-blur { background: linear-gradient(135deg, #9ec7f7, #d7e6fb 45%, #f4b9a0); filter: blur(2px); }

.color-row { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .18);
  background: var(--dot);
  cursor: pointer;
  padding: 0;
}
.color-dot.is-active { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--blue); }

.color-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}
.color-custom input[type="color"] {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.tools-col .btn-block + .btn-block { margin-top: 10px; }

.meta-list { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.meta-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 3px 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.advanced summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '▸ '; }
.advanced[open] summary::before { content: '▾ '; }
.advanced .field { margin-top: 12px; margin-bottom: 0; }

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* --------------------------------- Seções -------------------------------- */

.section { padding: 72px 0; }
.section-alt { background: var(--bg); border-block: 1px solid var(--line); }

.section-title {
  text-align: center;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -.01em;
}
.section-lead { text-align: center; color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 auto 40px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--icon-bg, var(--blue-soft));
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.card h3 { font-size: 17px; margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  counter-reset: step;
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  text-align: center;
}
.step-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
}
.step h3 { font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ----------------------------------- FAQ --------------------------------- */

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 20px;
  margin-bottom: 12px;
  background: #fff;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  padding: 17px 0;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue);
  font-size: 22px;
  font-weight: 400;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }

/* --------------------------------- Rodapé -------------------------------- */

.site-footer {
  background: #101722;
  color: #aeb8c6;
  padding: 44px 0;
  font-size: 14.5px;
}
.footer-inner { display: grid; gap: 20px; }
.footer-brand .brand-name { color: #fff; font-size: 19px; }
.footer-brand p { margin: 6px 0 0; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a, .footer-note a { color: #7db3ff; }
.footer-note { margin: 0; font-size: 13px; color: #7d8794; }

/* ------------------------------ Responsivo ------------------------------- */

@media (max-width: 960px) {
  .editor { grid-template-columns: 1fr; }
  .tools-col { position: static; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .header-cta { margin-left: auto; }
  .hero { padding: 36px 0 56px; }
  .dropzone { padding: 34px 16px; }
  .progress-panel { flex-direction: column; align-items: stretch; text-align: center; }
  .progress-thumb { margin: 0 auto; }
  .section { padding: 52px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
