:root {
  --bg: #f2efe7;
  --card: #fff7e6;
  --ink: #1f1a17;
  --accent: #e45c3d;
  --accent-dark: #b3422a;
  --muted: #6b5f55;
  --stroke: #d8c8b4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, #fffaf0 0%, transparent 45%),
    radial-gradient(circle at 80% 0%, #fbe7d1 0%, transparent 42%),
    radial-gradient(circle at 80% 80%, #f6dcc6 0%, transparent 40%),
    var(--bg);
  min-height: 100vh;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-nav {
  display: flex;
  align-items: center;
}

.back-btn {
  text-decoration: none;
  color: var(--ink);
  background: #fffaf0;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.back-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(63, 46, 36, 0.18);
  background: #fff0df;
}

.hero {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f28b6d, #e45c3d);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 1px;
  box-shadow: 0 12px 24px rgba(228, 92, 61, 0.35);
}

.hero-text h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.hero-text p {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(63, 46, 36, 0.08);
}

.dropzone {
  border: 2px dashed var(--stroke);
  border-radius: 18px;
  padding: 32px 20px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: #fffaf0;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #fff0df;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dz-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.dz-sub {
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field select {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}

button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(228, 92, 61, 0.28);
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(228, 92, 61, 0.32);
}

.secondary {
  background: #2f2722;
  color: #fff;
}

.status {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.results .result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.result-card {
  background: #fffaf0;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px;
}

.result-card .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.result-card .value {
  font-size: 20px;
  font-weight: 600;
}

.preview {
  background: #fffaf0;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: center;
  min-height: 180px;
}

.preview img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    justify-content: center;
  }
}
