/* IMPALA 2 Transfer POC — visual family of the Upload Architecture doc. */

/* Palette from the Discovery Hub website (tailwind.config.js): accent blue
   rgb(33,136,198), dominant bg rgb(242,244,246), Ubuntu + Open Sans. */
:root {
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --surface-2: #EFF0F1;
  --ink: #23262B;
  --muted: #484F65;
  --faint: #7A8A93;
  --line: #DDE1E6;
  --line-strong: #C4C4C4;
  --accent: #2188C6;
  --accent-ink: #1A5F89;
  --accent-wash: #EEF8FF;
  --ok: #1B7A43;
  --ok-wash: #E3F1E9;
  --bad: #DE4038;
  --bad-wash: #FBE9E8;
  --warn: #8A5A00;
  --warn-wash: #F6EEDC;
  --code-bg: #EEF0F1;
}
/* Discovery Hub is a light product, so the dashboard stays light to match the
   login screen and the rest of the Discovery UI. The dark palette is retained
   but only applies when explicitly opted in with data-theme="dark" (nothing
   sets it today); system dark mode no longer flips the dashboard. */
:root[data-theme="dark"] {
    --bg: #0E141F; --surface: #161E2C; --surface-2: #1D2738;
    --ink: #E4E9F2; --muted: #9BA8BF; --faint: #6F7C94;
    --line: #253044; --line-strong: #394663;
    --accent: #7FA0F0; --accent-ink: #A2BCF7; --accent-wash: #172442;
    --ok: #7FCB9B; --ok-wash: #15301E;
    --bad: #F2938C; --bad-wash: #391E1C;
    --warn: #E3B663; --warn-wash: #352A13;
    --code-bg: #1D2738;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 1.03rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Ubuntu", "Helvetica Neue", Arial, sans-serif; margin: 0; }
.mono, code { font-family: "JetBrains Mono", "SF Mono", Consolas, monospace; font-size: 0.85em; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  max-width: 72rem; margin: 0 auto; padding: 1.6rem 1.5rem 1.1rem;
}
.eyebrow {
  font-family: "Ubuntu", sans-serif; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink);
  display: block; margin-bottom: 0.2rem;
}
.topbar h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }
.topbar-controls { display: flex; gap: 1.4rem; align-items: flex-end; flex-wrap: wrap; }

.sitebox label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); display: block;
}
.sitebox select {
  font: inherit; font-family: "Ubuntu", sans-serif; font-weight: 600;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 0.35rem 0.6rem; margin-top: 0.2rem;
}

/* ---------- status band: the signature ---------- */
.status-band {
  border-block: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 1.4rem 1.5rem;
}
.status-inner {
  max-width: 72rem; margin: 0 auto;
  display: flex; align-items: center; gap: 1.1rem;
}
.status-icon {
  flex: 0 0 auto; width: 3.4rem; height: 3.4rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.7rem; font-family: "Ubuntu", sans-serif; font-weight: 800;
}
.status-line {
  margin: 0; font-family: "Ubuntu", sans-serif; font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.8rem); letter-spacing: -0.01em; line-height: 1.15;
  text-wrap: balance;
}
.status-sub { margin: 0.3rem 0 0; color: var(--muted); font-size: 1rem; max-width: 52rem; }
.status-sub strong { color: var(--ink); }

/* five states, each carrying icon + words, never colour alone */
.status-band[data-state="verified"]   { background: var(--ok-wash); }
.status-band[data-state="verified"]   .status-icon { background: var(--ok); color: #fff; }
.status-band[data-state="progress"]   { background: var(--accent-wash); }
.status-band[data-state="progress"]   .status-icon { background: var(--accent); color: #fff; }
.status-band[data-state="risk"]       { background: var(--warn-wash); }
.status-band[data-state="risk"]       .status-icon { background: var(--warn); color: #fff; }
.status-band[data-state="attention"]  { background: var(--warn-wash); }
.status-band[data-state="attention"]  .status-icon { background: var(--warn); color: #fff; }
.status-band[data-state="error"]      { background: var(--bad-wash); }
.status-band[data-state="error"]      .status-icon { background: var(--bad); color: #fff; }
.status-band[data-state="idle"]       .status-icon { background: var(--surface-2); color: var(--muted); }

/* the impala: gallops fast (green), trots (yellow), stands still (red) */
.impala-box { width: 3.2rem; height: auto; display: block; overflow: visible; }
.impala { fill: var(--ok); transform-origin: 50% 62%; }
.status-band[data-state="progress"] .status-icon[data-pace] { background: var(--surface-2); }
.status-icon[data-pace="slow"] .impala { fill: var(--warn); }
.status-icon[data-pace="stalled"] .impala { fill: var(--bad); }
.status-icon[data-pace="idle"] .impala { fill: var(--accent); }
.status-band[data-state="idle"] .status-icon[data-pace="idle"] { background: var(--accent-wash); }
@media (prefers-reduced-motion: no-preference) {
  .status-icon[data-pace="fast"] .impala { animation: gallop 0.42s ease-in-out infinite; }
  .status-icon[data-pace="slow"] .impala { animation: gallop 1.2s ease-in-out infinite; }
}
@keyframes gallop {
  0%, 100% { transform: translateY(1px) rotate(2.5deg); }
  35%      { transform: translateY(-4px) rotate(-5deg); }
  65%      { transform: translateY(-0.5px) rotate(0deg); }
}

.hold-banner, .safe-banner {
  max-width: 72rem; margin: 1rem auto 0;
  border-radius: 6px; padding: 0.75rem 1.1rem;
  display: flex; gap: 0.9rem; align-items: baseline; flex-wrap: wrap;
}
.hold-banner { background: var(--ink); color: var(--bg); }
.safe-banner { background: var(--ok); color: #fff; }
:root[data-theme="dark"] .hold-banner { background: var(--surface-2); color: var(--ink); }
.hold-banner strong, .safe-banner strong {
  font-family: "Ubuntu", sans-serif; font-weight: 800; letter-spacing: 0.06em;
  font-size: 1.02rem; white-space: nowrap;
}
.hold-banner span, .safe-banner span { font-size: 0.92rem; opacity: 0.92; }

/* ---------- layout ---------- */
.layout {
  max-width: 72rem; margin: 0 auto; padding: 1.5rem;
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem;
}
.panel {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 1.3rem 1.4rem;
}
.panel.wide { grid-column: 1 / -1; }
.panel h2 {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em;
  border-bottom: 2px solid var(--ink); padding-bottom: 0.45rem; margin-bottom: 1rem;
}
.panel h3 { font-size: 0.95rem; font-weight: 600; margin: 1.3rem 0 0.4rem; }
@media (max-width: 56rem) { .layout { grid-template-columns: 1fr; } }

/* ---------- form ---------- */
.resume-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  background: var(--warn-wash); border: 1px solid var(--warn);
  border-radius: 8px; padding: 0.9rem 1.1rem; margin-bottom: 1.1rem;
}
.resume-words strong { font-family: "Ubuntu", sans-serif; }
.resume-words p { margin: 0.2rem 0 0; font-size: 0.88rem; color: var(--muted); max-width: 28rem; }
.resume-actions { display: flex; gap: 0.6rem; }

.field { margin-bottom: 1rem; }
.field label {
  font-family: "Ubuntu", sans-serif; font-weight: 600; font-size: 0.9rem;
  display: block; margin-bottom: 0.25rem;
}
.req {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--bad); background: var(--bad-wash);
  border-radius: 2px; padding: 0.12rem 0.4rem; vertical-align: 0.12em; margin-left: 0.3rem;
}
.opt {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--faint); background: var(--surface-2);
  border-radius: 2px; padding: 0.12rem 0.4rem; vertical-align: 0.12em; margin-left: 0.3rem;
}
.field input[type="text"], .field input[type="datetime-local"] {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 0.5rem 0.7rem; width: 100%; max-width: 22rem;
}
.hint { font-size: 0.82rem; color: var(--faint); margin: 0.3rem 0 0; }

.dropzone {
  border: 2px dashed var(--line-strong); border-radius: 8px;
  background: var(--bg); padding: 1.4rem 1rem; text-align: center; cursor: pointer;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-wash); }
.dropzone input { display: none; }
.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent-ink); text-decoration: underline;
}
.dropzone p { margin: 0.2rem 0; }

.queue { list-style: none; margin: 0 0 1rem; padding: 0; }
.queue li {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0.15rem 0.8rem;
  border-top: 1px solid var(--line); padding: 0.55rem 0.1rem;
}
.queue li:last-child { border-bottom: 1px solid var(--line); }
.queue .fname { font-family: "JetBrains Mono", monospace; font-size: 0.82rem; overflow-wrap: anywhere; }
.queue .fmeta { font-size: 0.8rem; color: var(--muted); text-align: right; white-space: nowrap; }
.queue .fstate { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }
.queue .bar {
  grid-column: 1 / -1; height: 0.45rem; border-radius: 3px;
  background: var(--surface-2); overflow: hidden;
}
.queue .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.queue li[data-state="verified"] .bar i { background: var(--ok); }
.queue li[data-state="failed"]   .bar i { background: var(--bad); }
.queue .remove {
  background: none; border: none; color: var(--bad); cursor: pointer;
  font-size: 0.8rem; padding: 0; text-decoration: underline;
}

.actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
button.primary {
  font-family: "Ubuntu", sans-serif; font-weight: 700; font-size: 1.02rem;
  color: #fff; background: var(--accent); border: none; border-radius: 6px;
  padding: 0.65rem 1.7rem; cursor: pointer;
}
button.primary:hover:not(:disabled) { background: var(--accent-ink); }
button.primary:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost {
  font-family: "Ubuntu", sans-serif; font-weight: 600;
  color: var(--accent-ink); background: none;
  border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 0.6rem 1.1rem; cursor: pointer;
}
.netline { font-size: 0.85rem; color: var(--muted); }

/* ---------- help panel ---------- */
.help .steps { margin: 0; padding-left: 1.3rem; }
.help .steps li { margin-bottom: 0.5rem; }
.help p { font-size: 0.95rem; margin: 0.2rem 0 0.6rem; }
.contacts { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.contacts th { text-align: left; font-weight: 600; padding: 0.35rem 0.6rem 0.35rem 0; white-space: nowrap; vertical-align: top; }
.contacts td { padding: 0.35rem 0; color: var(--muted); }
details { border-top: 1px solid var(--line); padding: 0.5rem 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { font-weight: 600; cursor: pointer; font-size: 0.93rem; }
details p { font-size: 0.9rem; color: var(--muted); margin: 0.4rem 0 0.2rem; }

/* ---------- history ---------- */
.site-tag {
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem; font-weight: 500;
  color: var(--accent-ink); background: var(--accent-wash);
  border-radius: 3px; padding: 0.15rem 0.5rem; margin-left: 0.5rem; vertical-align: 0.15em;
}
.table-scroll { overflow-x: auto; }
.history { border-collapse: collapse; width: 100%; font-size: 0.9rem; min-width: 44rem; }
.history th {
  font-family: "Ubuntu", sans-serif; font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; text-align: left;
  color: var(--faint); padding: 0.45rem 0.9rem 0.45rem 0;
  border-bottom: 1px solid var(--line-strong);
}
.history td { padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.history .empty-row td { color: var(--faint); padding: 1.2rem 0; }
.chip {
  font-family: "Ubuntu", sans-serif; font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  padding: 0.18rem 0.5rem; border-radius: 2px; white-space: nowrap; display: inline-block;
}
.chip.ok   { color: var(--ok); background: var(--ok-wash); }
.chip.busy { color: var(--accent-ink); background: var(--accent-wash); }
.chip.flag { color: var(--warn); background: var(--warn-wash); }
.retry-btn {
  font-family: "Ubuntu", sans-serif; font-size: 0.68rem; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-wash);
  border: 1px solid var(--accent); border-radius: 3px;
  padding: 0.12rem 0.5rem; cursor: pointer; margin-left: 0.35rem;
}
.retry-btn:hover { color: #fff; background: var(--accent); }
.utc { display: block; }
.local { display: block; font-size: 0.8rem; color: var(--faint); }
.caption { font-size: 0.83rem; color: var(--muted); margin: 0.8rem 0 0; }

/* ---------- footer ---------- */
.foot {
  max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem; color: var(--faint);
}

/* ---------- login screen (Discovery Hub website style) ---------- */
/* Fixed overlay so the app renders underneath; hidden on sign-in. Colors are
   hardcoded to the Discovery light palette so the login looks the same
   regardless of the viewer's dark-mode setting. */
#loginScreen.auth {
  position: fixed; inset: 0; z-index: 1000; overflow: auto;
  background-color: #F2F4F6;
  background-image: url('images/auth/curve-auth-bg.svg');
  background-size: cover; background-repeat: no-repeat; background-position: center;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-logo { position: absolute; top: 30px; right: 36px; width: 300px; height: auto; max-width: 45vw; }
.auth-wordmark {
  width: auto; display: flex; align-items: baseline; gap: 0.35rem;
  font-family: "Ubuntu", sans-serif; font-weight: 700; font-size: 2rem;
  letter-spacing: 0.02em; color: #1A5F89;
}
.auth-wordmark span {
  font-size: 1.1rem; font-weight: 500; color: #fff;
  background: #2188C6; border-radius: 6px; padding: 0.05rem 0.5rem;
}
.auth-content {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 48px; padding: 120px 24px 24px; flex-wrap: wrap;
}
.auth-left { flex: 1 1 360px; display: flex; justify-content: flex-end; }
.auth-art {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center;
}
.auth-art::before {
  content: ""; position: absolute;
  width: 380px; height: 380px; max-width: 82%; border-radius: 50%;
  background: radial-gradient(circle, rgba(33,136,198,0.12), rgba(33,136,198,0) 68%);
}
.auth-impala {
  position: relative; width: 430px; max-width: 100%; height: auto;
  fill: #2188C6;
}
.auth-right { flex: 1 1 360px; display: flex; justify-content: flex-start; }
.auth-card {
  width: 100%; max-width: 480px; background: #fff; border-radius: 16px; padding: 2.5rem;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.12);
}
.auth-card h1 { font-family: "Ubuntu", sans-serif; font-weight: 700; font-size: 2rem; color: #000; margin: 0 0 0.4rem; }
.auth-sub { color: #484F65; font-size: 1.05rem; margin: 0 0 2rem; }
.auth-field {
  display: flex; align-items: center; gap: 0.6rem; background: #fff;
  border: 1px solid #C4C4C4; border-radius: 8px; padding: 0.7rem 0.9rem; margin-bottom: 1rem;
}
.auth-field:focus-within { border-color: #2188C6; box-shadow: 0 0 0 3px rgba(33,136,198,0.12); }
.auth-ic { color: #2188C6; display: inline-flex; flex: 0 0 auto; }
.auth-field input {
  border: none; outline: none; flex: 1; font: inherit; font-size: 1rem;
  color: #23262B; background: transparent;
}
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 0.25rem 0 1.5rem; font-size: 0.95rem; }
.auth-remember { color: #484F65; display: flex; align-items: center; gap: 0.5rem; }
.auth-link { color: #2188C6; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-btn {
  width: 100%; border: none; border-radius: 8px; cursor: pointer;
  background: #2188C6; color: #fff;
  font-family: "Ubuntu", sans-serif; font-weight: 600; font-size: 1.05rem; padding: 0.85rem 1rem;
}
.auth-btn:hover { background: #1A5F89; }
.auth-note { margin: 1.25rem 0 0; font-size: 0.82rem; color: #7A8A93; }
.auth-footer { text-align: center; padding: 1.5rem; }
.auth-footer img { display: block; margin: 0 auto 0.4rem; opacity: 0.9; }
.auth-footer p { margin: 0; font-size: 0.82rem; color: #48505E; }
@media (max-width: 820px) {
  .auth-left { display: none; }
  .auth-logo { width: 220px; top: 20px; right: 20px; }
  .auth-content { padding-top: 90px; }
}

/* ---------- auth error + account chip ---------- */
.auth-err { margin: 0 0 1rem; color: #DE4038; font-size: 0.92rem; }
.site-locked {
  display: inline-block; margin-top: 0.2rem; padding: 0.35rem 0.6rem;
  font-family: "Ubuntu", sans-serif; font-weight: 600; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px;
}
.acctbox { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.acct-email { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
