:root {
  color-scheme: light;
  --bg: #eef3f2;
  --surface: #ffffff;
  --ink: #1d2524;
  --muted: #61706d;
  --line: #d7e0dd;
  --accent: #14786e;
  --accent-dark: #0d504a;
  --gold: #b87816;
  --rose: #b95057;
  --shadow: 0 18px 50px rgba(29, 37, 36, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 120, 110, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(185, 80, 87, 0.1), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 54px);
}

.step-panel {
  width: min(920px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.upload-step {
  display: grid;
  gap: clamp(24px, 4vw, 38px);
  padding: clamp(22px, 5vw, 54px);
}

.brand,
.settings-header,
.selected-file,
.settings-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(29, 37, 36, 0.16);
}

.settings-brand {
  justify-content: flex-end;
}

.settings-brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(29, 37, 36, 0.13);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand h1,
.settings-header h1 {
  margin-top: 4px;
  font-size: 1.35rem;
  line-height: 1.1;
}

.headline {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.headline h2 {
  font-size: clamp(2.2rem, 7vw, 5.4rem);
  line-height: 0.95;
}

.headline p,
.dropzone span:not(.drop-icon),
.field span,
.selected-file p,
.format-note,
.status-text {
  color: var(--muted);
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 290px;
  padding: 30px;
  border: 2px dashed rgba(20, 120, 110, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 248, 0.82)),
    repeating-linear-gradient(45deg, rgba(20, 120, 110, 0.05) 0 12px, transparent 12px 24px);
  text-align: center;
  cursor: pointer;
}

.dropzone.is-dragging {
  border-color: var(--accent);
  background-color: white;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 500;
}

.dropzone strong {
  font-size: clamp(1.2rem, 2.6vw, 1.9rem);
}

.settings-step {
  display: grid;
  gap: 24px;
  padding: clamp(20px, 4vw, 42px);
}

.settings-header {
  justify-content: space-between;
}

.settings-header > .settings-brand > div {
  text-align: right;
}

.selected-file {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.preview {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 8px;
  background: #e7edef;
  color: var(--accent-dark);
  font-weight: 900;
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-file h2 {
  overflow: hidden;
  font-size: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file > div:last-child {
  min-width: 0;
}

.settings-grid {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.toggle span {
  font-size: 0.9rem;
  font-weight: 800;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.range-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.range-field input {
  grid-column: 1 / -1;
  accent-color: var(--accent);
}

output {
  color: var(--accent-dark);
  font-weight: 800;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.resize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.format-note {
  min-height: 22px;
  font-size: 0.92rem;
  font-weight: 700;
}

.primary-action,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.primary-action {
  width: 100%;
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ghost-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.status-text {
  min-height: 22px;
  font-size: 0.92rem;
  font-weight: 800;
}

.status-text.error {
  color: #a43434;
}

@media (max-width: 680px) {
  .app-shell {
    align-items: stretch;
    padding: 14px;
  }

  .settings-header {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .settings-brand {
    justify-content: flex-start;
  }

  .settings-header > .settings-brand > div {
    text-align: left;
  }

  .selected-file {
    align-items: flex-start;
  }

  .preview {
    width: 72px;
    height: 72px;
  }

  .resize-grid {
    grid-template-columns: 1fr;
  }
}
