:root {
  --bg: #f6efe3;
  --bg-accent: #ead8b8;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-strong: #fffaf1;
  --text: #1d2a22;
  --muted: #536056;
  --line: rgba(29, 42, 34, 0.12);
  --shadow: 0 24px 60px rgba(72, 50, 18, 0.12);
  --accent: #bf5a2a;
  --accent-dark: #8f3811;
  --success: #226446;
  --success-bg: #e7f6ed;
  --error: #8c2330;
  --error-bg: #fdecef;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Archivo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(191, 90, 42, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(34, 100, 70, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 34%, #f9f5ee 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(24px);
  pointer-events: none;
  opacity: 0.28;
}

body::before {
  top: -8rem;
  right: -5rem;
  background: #efb86a;
}

body::after {
  left: -6rem;
  bottom: -9rem;
  background: #86b89f;
}

.page {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero,
.panel,
.results,
.feedback {
  animation: rise 500ms ease both;
}

.hero {
  padding: 1.5rem 0 2rem;
}

.hero-logo {
  width: 132px;
  height: auto;
  display: block;
  margin-bottom: 1rem;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(10, 43, 87, 0.22);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

h1,
h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  letter-spacing: -0.06em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
}

.intro,
.panel-header p,
.result-date,
.upload-help,
.feedback,
th,
td {
  color: var(--muted);
}

.intro {
  max-width: 62ch;
  margin: 1.15rem 0 0;
  font-size: 1.04rem;
  line-height: 1.7;
}

.panel,
.results,
.feedback {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.panel,
.results {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.panel-header p {
  margin: 0;
  max-width: 28ch;
  line-height: 1.6;
}

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

.upload-card {
  display: grid;
  gap: 0.5rem;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(248, 240, 227, 0.88));
  border: 1px solid var(--line);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.upload-card:hover {
  transform: translateY(-2px);
  border-color: rgba(191, 90, 42, 0.35);
  box-shadow: 0 16px 30px rgba(72, 50, 18, 0.09);
}

.upload-label {
  font-weight: 700;
}

.upload-help {
  font-size: 0.92rem;
  line-height: 1.45;
}

input[type="file"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(29, 42, 34, 0.24);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
}

.actions {
  grid-column: 1 / -1;
  padding-top: 0.5rem;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 1rem 1.4rem;
  font: inherit;
  font-weight: 700;
  color: #fff6eb;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(143, 56, 17, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(143, 56, 17, 0.34);
}

button:disabled {
  opacity: 0.62;
  cursor: progress;
}

.feedback {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  line-height: 1.6;
}

.feedback:empty {
  display: none;
}

.feedback.success {
  color: var(--success);
  background: var(--success-bg);
  border-color: rgba(34, 100, 70, 0.18);
}

.feedback.error {
  color: var(--error);
  background: var(--error-bg);
  border-color: rgba(140, 35, 48, 0.18);
}

.results {
  margin-top: 1rem;
}

.hidden {
  display: none;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.result-date {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  margin-top: 0.4rem;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
  color: var(--text);
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(191, 90, 42, 0.08);
}

th,
td {
  text-align: left;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.35);
}

.empty-row td {
  text-align: center;
  font-style: italic;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 1rem, 1120px);
    padding-top: 1.25rem;
  }

  .panel,
  .results {
    padding: 1rem;
  }

  .panel-header,
  .results-header,
  .upload-grid,
  .stats {
    grid-template-columns: 1fr;
    display: grid;
  }

  .panel-header,
  .results-header {
    align-items: start;
  }

  .actions {
    padding-top: 0;
  }

  button {
    width: 100%;
  }
}
