.remove-bg-hero .tool-card {
  overflow: hidden;
}

.remove-bg-hero .upload-area {
  width: 100%;
  min-height: 240px;
  padding: 42px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d6d9e0;
  border-radius: 17px;
  box-sizing: border-box;
}

.remove-bg-hero .upload-content {
  width: 100%;
  position: static;
  text-align: center;
}

html[data-theme="dark"] .remove-bg-hero .upload-area {
  border-color: #303541;
}

#downloadResult {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
}


/* Remove Background demo — CatchPrompt native style */
.remove-bg-demo {
  position: relative;
  overflow: hidden;
}

.remove-bg-background {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  box-sizing: border-box;
  opacity: .34;
}

.remove-bg-animation {
  position: relative;
  width: 210px;
  height: 145px;
}

.remove-bg-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(114,191,120,.3);
  border-radius: 16px;
}

.remove-bg-before,
.remove-bg-after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Simple background before removal */
.remove-bg-before {
  background:
    linear-gradient(135deg,#eeeaff 0,#fafaff 55%,#e9e7ff 100%);
}

.remove-bg-before::before,
.remove-bg-before::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(114,191,120,.18);
}

.remove-bg-before::before {
  width: 62px;
  height: 62px;
  top: 15px;
  right: 18px;
}

.remove-bg-before::after {
  width: 105px;
  height: 34px;
  left: 16px;
  bottom: 14px;
  border-radius: 50%;
}

/* Transparent result layer */
.remove-bg-after {
  background: transparent;
  clip-path: inset(0 100% 0 0);
  animation: remove-bg-reveal 3.4s ease-in-out infinite;
}

/* CSS shoe */
.remove-bg-shoe {
  position: relative;
  z-index: 2;
  display: block;
  width: 105px;
  height: 48px;
  transform: rotate(-12deg);
}

.shoe-upper {
  position: absolute;
  left: 14px;
  bottom: 9px;
  width: 78px;
  height: 42px;
  border: 3px solid var(--primary);
  border-radius: 34px 22px 14px 18px;
  background: var(--surface);
  transform: skewX(10deg);
}

.shoe-upper::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 30px;
  right: -10px;
  top: 8px;
  border: 3px solid var(--primary);
  border-left: 0;
  border-radius: 5px 18px 12px 4px;
  background: var(--surface);
}

.shoe-sole {
  position: absolute;
  z-index: 3;
  left: 4px;
  right: 0;
  bottom: 2px;
  height: 10px;
  border: 3px solid var(--primary);
  border-radius: 5px 5px 14px 18px;
  background: var(--surface);
  transform: skewX(-18deg);
}

.shoe-laces {
  position: absolute;
  z-index: 4;
  left: 35px;
  top: 16px;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow:
    2px 8px 0 var(--primary),
    4px 16px 0 var(--primary);
  transform: rotate(9deg);
}

/* Scan line */
.remove-bg-wipe {
  position: absolute;
  z-index: 5;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: var(--primary);
  animation: remove-bg-scan 3.4s ease-in-out infinite;
}

/* Remove the original background as the scan passes */
.remove-bg-before {
  clip-path: inset(0 0 0 0);
  animation: remove-bg-remove 3.4s ease-in-out infinite;
}

@keyframes remove-bg-remove {
  0%,20% { clip-path: inset(0 0 0 0); }
  72%,86% { clip-path: inset(0 0 0 100%); }
  100% { clip-path: inset(0 0 0 0); }
}

@keyframes remove-bg-reveal {
  0%,20% { clip-path: inset(0 100% 0 0); }
  72%,86% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 100% 0 0); }
}

@keyframes remove-bg-scan {
  0%,15% {
    transform: translateX(0);
    opacity: 0;
  }
  20% {
    transform: translateX(0);
    opacity: 1;
  }
  72% {
    transform: translateX(207px);
    opacity: 1;
  }
  82%,100% {
    transform: translateX(207px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .remove-bg-before,
  .remove-bg-after,
  .remove-bg-wipe {
    animation: none;
  }

  .remove-bg-before {
    clip-path: inset(0 0 0 100%);
  }

  .remove-bg-after {
    clip-path: inset(0);
  }
}
