/* Améliorer une photo */

.enhance-shell {
  overflow: hidden;
}

.enhance-work {
  display: grid;
  gap: 18px;
}

.enhance-work[hidden],
.enhance-compare[hidden],
.enhance-result[hidden] {
  display: none !important;
}

.enhance-file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee9e1;
}

.enhance-file-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.enhance-file-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enhance-file-info span {
  color: var(--muted);
  font-size: .82rem;
}

.enhance-change {
  flex: 0 0 auto;
}

.enhance-status {
  display: grid;
  gap: 12px;
  padding: 16px 17px;
  border: 1px solid #e3ebf3;
  border-radius: 17px;
  background: #f8fbff;
}

.enhance-status > div:first-child {
  display: grid;
  gap: 4px;
}

.enhance-status strong {
  color: #173b63;
  font-size: .94rem;
}

.enhance-status span {
  color: #647a91;
  font-size: .84rem;
  line-height: 1.45;
}

.enhance-status.success {
  border-color: rgba(35,122,82,.16);
  background: #f2faf6;
}

.enhance-status.success strong {
  color: #237a52;
}

.enhance-status.error {
  border-color: rgba(167,58,58,.15);
  background: #fff6f6;
}

.enhance-status.error strong {
  color: #a73a3a;
}

.enhance-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.enhance-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .18s ease;
}

.enhance-status.success .enhance-progress span {
  background: var(--good);
}

.enhance-status.error .enhance-progress span {
  background: var(--bad);
}

.enhance-compare {
  --split: 50%;
  position: relative;
  width: 100%;
  height: min(64vh, 620px);
  min-height: 380px;
  overflow: hidden;
  border: 1px solid #e2e7ec;
  border-radius: 20px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  user-select: none;
}

.enhance-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.enhance-after-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 0 0 var(--split));
}

.enhance-divider {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 3px;
  transform: translateX(-1.5px);
  background: rgba(255,255,255,.98);
  box-shadow: 0 0 0 1px rgba(36,50,61,.28), 0 0 10px rgba(0,0,0,.17);
  pointer-events: none;
}

.enhance-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,.18);
  font-size: 20px;
  font-weight: 900;
}

.enhance-label {
  position: absolute;
  z-index: 3;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(36,50,61,.76);
  color: #fff;
  font-size: .75rem;
  font-weight: 850;
  pointer-events: none;
}

.enhance-label-before {
  left: 12px;
}

.enhance-label-after {
  right: 12px;
}

.enhance-range {
  position: absolute;
  z-index: 6;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: none;
}

.enhance-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 17px;
  border: 1px solid #e7e5df;
  border-radius: 17px;
  background: #fffdf9;
}

.enhance-result > div {
  min-width: 0;
}

.enhance-result strong {
  color: var(--ink);
}

.enhance-result p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.5;
}

.enhance-result-size {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1c6fbd;
  font-size: .78rem;
  font-weight: 850;
  white-space: nowrap;
}

.enhance-actions {
  margin-top: 0;
}

.enhance-actions .primary {
  min-width: min(100%, 275px);
}

@media (max-width: 780px) {
  .enhance-compare {
    height: 52vh;
    min-height: 310px;
    border-radius: 16px;
  }

  .enhance-file-head {
    align-items: stretch;
    flex-direction: column;
  }

  .enhance-change {
    width: 100%;
  }

  .enhance-result {
    flex-direction: column;
    gap: 10px;
  }

  .enhance-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .enhance-actions button,
  .enhance-actions .primary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .enhance-compare {
    height: 47vh;
    min-height: 280px;
  }

  .enhance-divider span {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}
