:root {
  --paper: #ffffff;
  --ink: #111111;
  --accent: #e63946;
  --accent-2: #1d3557;
  --accent-3: #2a9d8f;
  --accent-4: #f4a261;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-rounded, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ink);
  background: var(--paper);
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url('./background.jpg');
  background-size: cover; /* fill screen, more spread out */
  background-repeat: no-repeat; /* avoid grid tiling */
  background-position: center; /* center the image */
  background-attachment: fixed; /* subtle parallax, keeps it stable */
  z-index: 0;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.logo-img {
  display: inline-block;
  height: 222px;
  width: auto;
  margin: 0 0 24px;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: -webkit-optimize-contrast;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #000;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 6px 6px 0 #000;
  max-width: 820px;
  margin: 12px auto 20px;
}

.upload {
  position: relative;
  border: 2px dashed #000;
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  min-height: 220px;
}

.upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 2; /* garante que o input capture o clique */
  cursor: pointer;
}

.upload .hint { color: #333; }
.upload .sub { color: #666; font-size: 12px; }

#preview {
  display: none;
  max-width: 100%;
  max-height: 420px;
  border-radius: 12px;
  border: 1px solid #000;
  margin: 12px auto 0;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

button {
  appearance: none;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #000; }
button:active { transform: translate(0, 0); box-shadow: 2px 2px 0 #000; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.result { margin-top: 24px; }

#resultImage {
  display: none;
  max-width: 100%;
  border-radius: 12px;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 #000;
}

.loading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: #222;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error {
  color: #b00020;
  background: #ffd6db;
  border: 2px solid #000;
  border-radius: 8px;
  padding: 10px 12px;
  display: inline-block;
}


