:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1016;
  color: #edf2f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 10%, rgba(168, 85, 247, 0.16), transparent 30rem),
    radial-gradient(circle at 88% 4%, rgba(20, 184, 166, 0.16), transparent 28rem),
    linear-gradient(135deg, #101720 0%, #151923 54%, #090d13 100%);
  color: #edf2f7;
  overflow-x: hidden;
}

.app-shell {
  width: min(100%, 1240px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
  display: grid;
  align-content: start;
  gap: 18px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow,
.subtitle,
h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.eyebrow {
  color: #c4b5fd;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin-top: 6px;
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.subtitle {
  max-width: 720px;
  margin-top: 12px;
  color: #aab7c8;
  font-size: clamp(0.98rem, 2vw, 1.12rem);
  line-height: 1.55;
}

.status-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(196, 181, 253, 0.34);
  border-radius: 8px;
  background: rgba(91, 33, 182, 0.24);
  color: #ede9fe;
  font-weight: 800;
  white-space: nowrap;
}

.workspace {
  display: grid;
  gap: 18px;
}

.upload-card,
.image-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(10, 15, 22, 0.74);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.upload-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(180px, 260px);
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.drop-container {
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 22px;
  border: 1px dashed rgba(196, 181, 253, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #dce5f5;
  cursor: pointer;
  text-align: center;
  transition: border 180ms ease, background 180ms ease, transform 180ms ease;
}

.drop-container:hover {
  border-color: rgba(45, 212, 191, 0.72);
  background: rgba(45, 212, 191, 0.08);
  transform: translateY(-1px);
}

.drop-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
}

.drop-copy {
  color: #aab7c8;
  font-weight: 700;
}

input[type=file] {
  width: min(100%, 360px);
  color: #d8e1ef;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

input[type=file]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #0f766e);
  color: #ffffff;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
}

#btnResize {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #0f766e);
  color: #ffffff;
  cursor: pointer;
  display: none;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

#btnResize:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

#btnResize:disabled {
  cursor: wait;
  opacity: 0.7;
}

.info {
  min-height: 46px;
  display: flex;
  align-items: center;
  color: #cbd5e1;
  font-weight: 800;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.image-card {
  min-height: 520px;
  overflow: hidden;
}

.card-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
  color: #f8fafc;
  font-size: 1rem;
}

.card-header span {
  color: #8794a7;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.image-stage {
  min-height: 466px;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.12);
}

.image-stage:empty::before,
#previewImage:not(.show)::before {
  content: "";
}

#previewImage,
#result {
  display: none;
}

#previewImage,
#result img {
  max-width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

#result {
  width: 100%;
}

#result img {
  display: block;
  margin: 0 auto;
}

.show {
  display: block !important;
}

@media (max-width: 920px) {
  .app-shell {
    padding: 16px;
  }

  .hero {
    align-items: start;
    flex-direction: column;
  }

  .upload-card,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .image-card {
    min-height: 380px;
  }

  .image-stage {
    min-height: 330px;
  }

  #previewImage,
  #result img {
    max-height: 300px;
  }
}
