:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --ink: #18222e;
  --ink-soft: #41505f;
  --muted: #6a7886;
  --border: #e3e8ee;
  --border-strong: #cfd7e0;
  --navy: #1f3a5f;
  --navy-dark: #16304f;
  --navy-darker: #102541;
  --teal: #1f5e5b;
  --teal-soft: #e8f1f0;
  --navy-soft: #eef2f7;
  --shadow-sm: 0 1px 2px rgba(16, 37, 65, .06), 0 1px 1px rgba(16, 37, 65, .04);
  --shadow-md: 0 4px 14px rgba(16, 37, 65, .07), 0 1px 3px rgba(16, 37, 65, .05);
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

button, input { font: inherit; }

h1, h2 {
  font-family: "Spectral", Georgia, serif;
  color: var(--ink);
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: #fff;
  padding: 38px 24px 34px;
}
.app-header__inner {
  max-width: 920px;
  margin: 0 auto;
}
.app-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}
.app-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-soft);
  display: inline-block;
}
.app-title {
  font-family: "Spectral", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin: 8px 0 6px;
  color: #fff;
}
.app-subtitle {
  font-family: "Public Sans", sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 10px;
}
.app-desc {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  max-width: 640px;
  margin: 0;
}

/* Main + cards */
.app-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-top: 22px;
  box-shadow: var(--shadow-sm);
}
.card--lift {
  margin-top: -28px;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-md);
}
.card--quiet {
  background: var(--navy-soft);
  border-color: transparent;
  box-shadow: none;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.card-num {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--navy-soft);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}
.card-title {
  font-family: "Spectral", Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0;
  color: var(--ink);
}
.card-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 6px 0 14px;
}
.card-fineprint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 12px;
}
.card-fineprint .note-label {
  color: var(--ink);
  font-weight: 700;
}

/* Drop zone */
.drop-zone {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px 24px;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--navy);
  background: var(--navy-soft);
  transform: translateY(-1px);
}
.drop-zone:focus-visible {
  outline: 3px solid rgba(31, 58, 95, 0.20);
  outline-offset: 3px;
}
.drop-zone__title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
}
.drop-zone__hint {
  color: var(--muted);
  font-size: 0.92rem;
}
.drop-zone.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
  transform: none;
}
.drop-zone.is-disabled:hover {
  border-color: var(--border-strong);
  background: #fafbfc;
  transform: none;
}

/* Upload status row */
.upload-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--navy-soft);
  color: var(--ink);
  font-size: 0.95rem;
}
.upload-status__label { font-weight: 600; }
.upload-status__filename {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 0.9rem;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Field grid */
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.field-grid label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
}
.field-grid input {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}
.field-grid input:focus {
  outline: 2px solid rgba(31, 58, 95, 0.20);
  border-color: var(--navy);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 10px 18px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease, border-color 120ms ease;
}
.button:hover { transform: translateY(-1px); }
.button svg { margin-right: 8px; vertical-align: -2px; }
.button--primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.button--primary:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
}
.button--secondary {
  background: #fff;
  color: var(--navy);
  border-color: var(--navy);
}
.button--secondary:hover {
  background: var(--navy-soft);
}
.button--ghost {
  background: #fff;
  color: var(--ink);
}

/* Progress bits */
.progress-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--navy);
  animation: spin 0.8s linear infinite;
}
.progress-label {
  font-weight: 600;
  color: var(--ink);
}
.progress-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.progress-dots {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.progress-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 160ms ease, transform 160ms ease;
}
.progress-dots .dot.is-active {
  background: var(--navy);
  animation: pulse-dot 1s ease-in-out infinite alternate;
}
.progress-dots .dot.is-complete {
  background: var(--teal);
}
.progress-panel.is-done .progress-label { color: var(--teal); }
.progress-panel.is-done .progress-label::before { content: '✓ '; }

/* Error + utility */
.error-panel {
  background: #fff5f0;
  border-color: #f0c8b8;
}
.error-panel .card-title { color: #a13b1a; }
.hidden { display: none; }

/* Feedback region */
.feedback-text {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 14px;
}

/* Footer */
.app-footer {
  max-width: 920px;
  margin: 40px auto 0;
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}
.app-footer__title {
  margin: 0 0 4px;
  color: var(--ink-soft);
}
.app-footer__title strong {
  color: var(--ink);
  font-weight: 700;
}
.app-footer__credit {
  margin: 0;
  font-size: 0.9rem;
}
.app-footer__pilot {
  margin-top: 14px;
  font-size: 0.85rem;
}
.app-footer a {
  color: var(--navy);
  text-decoration: underline;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse-dot {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(1.3); opacity: 1; }
}

/* Responsive */
@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .app-header { padding: 28px 18px 24px; }
  .app-main { padding: 0 18px 48px; }
}
