:root {
  --ink: #17324a;
  --ink-soft: #4a6076;
  --steel: #3f7ba6;
  --steel-dark: #2d5f84;
  --lime: #6fae3a;
  --paper: #f4f1ea;
  --card: #ffffff;
  --line: #d9dee4;
  --danger: #b4412f;
  --serif: "Iowan Old Style", Charter, "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.55;
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(63, 123, 166, 0.14), transparent 60%),
    radial-gradient(800px 480px at 100% 110%, rgba(111, 174, 58, 0.12), transparent 60%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Faint facets echoing the logo mark */
.facets {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.facets::before,
.facets::after {
  content: "";
  position: absolute;
}
.facets::before {
  width: 46vmax; height: 46vmax;
  right: -14vmax; top: -16vmax;
  background: linear-gradient(135deg, rgba(63, 123, 166, 0.10), rgba(63, 123, 166, 0.02));
  clip-path: polygon(0 0, 100% 18%, 62% 100%);
}
.facets::after {
  width: 36vmax; height: 36vmax;
  left: -12vmax; bottom: -14vmax;
  background: linear-gradient(45deg, rgba(111, 174, 58, 0.12), rgba(111, 174, 58, 0.02));
  clip-path: polygon(8% 0, 100% 62%, 0 100%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 36px 20px 48px;
}

.brand { margin-bottom: 22px; }
.brand img { display: block; height: 58px; width: auto; max-width: 100%; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 34px 32px;
  box-shadow: 0 1px 0 rgba(23, 50, 74, 0.04), 0 18px 48px -18px rgba(23, 50, 74, 0.22);
  overflow: hidden;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--steel), var(--lime));
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel-dark);
  font-weight: 600;
}

h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.sub { margin: 0 0 24px; color: var(--ink-soft); }
.sub:empty { margin: 0 0 14px; }

.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

/* Drop zone */
.dropzone {
  border: 2px dashed rgba(63, 123, 166, 0.55);
  border-radius: 16px;
  padding: 40px 24px 34px;
  text-align: center;
  background: rgba(63, 123, 166, 0.04);
  color: var(--steel-dark);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--steel);
  background: rgba(63, 123, 166, 0.08);
  outline: none;
}
.dropzone:focus-visible { box-shadow: 0 0 0 4px rgba(63, 123, 166, 0.25); }
.dropzone.is-dragover {
  border-style: solid;
  border-color: var(--lime);
  background: rgba(111, 174, 58, 0.10);
  color: #3f7a1c;
  transform: translateY(-2px);
}
.dz-icon { display: block; margin: 0 auto 10px; transition: transform 0.25s; }
.dropzone:hover .dz-icon, .dropzone.is-dragover .dz-icon { transform: translateY(-3px); }
.dz-main { margin: 0; font-size: 20px; font-family: var(--serif); color: var(--ink); }
.dz-alt { margin: 4px 0 0; color: var(--ink-soft); }
.dz-link { color: var(--steel-dark); text-decoration: underline; text-underline-offset: 3px; }
.dz-note { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }

.inline-error,
.error-text {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--danger);
  background: rgba(180, 65, 47, 0.07);
  color: #7d2a1d;
  border-radius: 6px;
}

.help { margin-top: 20px; font-size: 15px; }
.help summary { cursor: pointer; color: var(--steel-dark); font-weight: 600; }
.help-body { padding: 8px 2px 0; color: var(--ink-soft); }
.help-body p { margin: 6px 0; }

/* Progress */
.file-line { margin: 4px 0 14px; font-weight: 600; word-break: break-word; }
.bar {
  height: 12px;
  border-radius: 999px;
  background: #e6ebf0;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--steel), var(--lime));
  background-size: 200% 100%;
  transition: width 0.25s ease-out;
  animation: sheen 2.4s linear infinite;
}
.progress-line { margin: 10px 0 6px; font-size: 18px; font-weight: 600; }
.progress-line .muted { font-size: 15px; font-weight: 400; margin-left: 8px; }

.text-btn {
  background: none; border: 0; padding: 6px 0; margin-top: 8px;
  color: var(--steel-dark); text-decoration: underline; text-underline-offset: 3px;
  font: inherit; cursor: pointer;
}

/* Done */
.check { margin: 4px 0 8px; }
.check-ring {
  stroke: var(--lime); stroke-width: 3.2;
  stroke-dasharray: 176; stroke-dashoffset: 176;
  animation: draw 0.7s 0.1s ease-out forwards;
}
.check-mark {
  stroke: var(--lime); stroke-width: 4.2;
  stroke-dasharray: 52; stroke-dashoffset: 52;
  animation: draw 0.45s 0.7s ease-out forwards;
}
.done-file { margin: 6px 0 0; font-weight: 600; word-break: break-word; }

/* Buttons */
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  font: inherit; font-weight: 600;
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--steel-dark);
  background: var(--steel-dark); color: #fff; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--steel); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--steel-dark); }
.btn.ghost:hover { background: rgba(63, 123, 166, 0.08); }
.btn:focus-visible, .text-btn:focus-visible { outline: 3px solid rgba(63, 123, 166, 0.4); outline-offset: 2px; }

.foot { margin-top: 22px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.foot p { margin: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 520px) {
  .card { padding: 30px 20px 26px; }
  .dropzone { padding: 32px 14px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .check-ring, .check-mark { stroke-dashoffset: 0; }
}
