@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
  --ink: #120e18;
  --paper: #f8f0e4;
  --accent: #d57a1b;
  --accent-2: #1f6f8b;
  --muted: #6d6575;
  --panel: #fff9f2;
  --shadow: rgba(16, 12, 22, 0.16);
  --glow: rgba(213, 122, 27, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffe6cc 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, #d1ecf2 0%, transparent 45%),
    linear-gradient(135deg, #f8f0e4 0%, #f2e8db 60%, #efe2d1 100%);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  position: relative;
}

.page::before,
.page::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213, 122, 27, 0.35) 0%, transparent 70%);
  filter: blur(1px);
  opacity: 0.6;
  z-index: -1;
  animation: drift 18s ease-in-out infinite;
}

.page::after {
  right: -60px;
  top: 40px;
  background: radial-gradient(circle, rgba(31, 111, 139, 0.35) 0%, transparent 70%);
  animation-delay: 4s;
}

.page::before {
  left: -80px;
  bottom: 80px;
}

.hero {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

.title-block {
  display: grid;
  gap: 1rem;
  animation: fadeUp 0.6s ease-out both;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 3.2vw, 3.6rem);
  margin: 0;
}

.subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 38ch;
}

.card {
  background: var(--panel);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 18px 40px var(--shadow);
  border: 1px solid rgba(18, 14, 24, 0.08);
  animation: fadeUp 0.8s ease-out both;
}

.form {
  display: grid;
  gap: 1.5rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.file-field {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(18, 14, 24, 0.2);
  background: #fff;
  position: relative;
  min-height: 120px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.file-field:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 22px var(--glow);
  transform: translateY(-2px);
}

.file-label {
  font-weight: 600;
  color: var(--ink);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-name {
  font-size: 0.9rem;
  color: var(--muted);
  word-break: break-word;
}

.cta {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.8rem;
  background: linear-gradient(120deg, var(--accent), #e69a2f);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(213, 122, 27, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.cta:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(213, 122, 27, 0.35);
}

.hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.results {
  margin-top: 3rem;
  display: grid;
  gap: 1.5rem;
}

.results-empty {
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(18, 14, 24, 0.2);
  border-radius: 18px;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.6);
}

.results-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.result-card {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(18, 14, 24, 0.12);
  border: 1px solid rgba(18, 14, 24, 0.08);
  animation: fadeUp 0.4s ease-out both;
}

.preview-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.preview {
  border: 1px solid rgba(18, 14, 24, 0.08);
  border-radius: 14px;
  padding: 0.75rem;
  background: #faf8f6;
}

.preview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.preview-img {
  width: 100%;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(18, 14, 24, 0.08);
  object-fit: contain;
}

.step-loader {
  display: grid;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.step {
  display: grid;
  grid-template-columns: 18px 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.2rem;
  align-items: center;
}

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), #e69a2f);
  grid-row: span 2;
  animation: pulse 1.4s ease-in-out infinite;
}

.step-text {
  font-weight: 600;
  color: var(--ink);
}

.step-bar {
  position: relative;
  height: 6px;
  background: rgba(18, 14, 24, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--accent), #e69a2f);
  transform: translateX(-100%);
  animation: loading-bar 1.8s ease-in-out infinite;
}

.bar-fill.delay-1 {
  animation-delay: 0.2s;
}
.bar-fill.delay-2 {
  animation-delay: 0.4s;
}

@keyframes loading-bar {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

.result-title {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.5rem 0;
}

.result-value {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0;
}

.result-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(18, 14, 24, 0.08);
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
}

.alert {
  padding: 1rem 1.2rem;
  background: #fff1e5;
  border-radius: 14px;
  border: 1px solid rgba(213, 122, 27, 0.35);
  color: #6a3d11;
  font-size: 0.95rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@media (max-width: 700px) {
  .page {
    padding: 3rem 1.2rem 4rem;
  }

  .card {
    padding: 1.5rem;
  }
}
