/* Área de upload: layout "fluxo de dados" (tema escuro). */

:root {
  color-scheme: dark;
  --bg: #080e1c;
  --panel: #111b30;
  --border: #27334c;
  --ink: #f3f7ff;
  --muted: #99aac8;
  --aqua: #5ee4db;
  --blue: #719eff;
  --violet: #b6a3fd;
  --warn: #f5c271;
  --err: #ff8a8a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -30%, #19345a 0%, transparent 58%), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: grid;
  place-items: center;
  padding: 24px;
}

.hidden { display: none !important; }

.shell { width: min(850px, 100%); }

.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand { display: block; flex-shrink: 0; line-height: 0; }
.brand img { width: 200px; height: auto; }
.pill {
  border: 1px solid #2d4056; padding: 7px 12px; border-radius: 25px; color: #b6c8e5; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.panel {
  background: linear-gradient(145deg, rgba(19, 31, 54, .94), rgba(11, 19, 36, .97));
  border: 1px solid var(--border);
  box-shadow: 0 28px 80px #0005;
  border-radius: 24px;
  overflow: hidden;
}

.intro { text-align: center; padding: 32px 25px 4px; }
.eyebrow { font-size: 11px; letter-spacing: .2em; font-weight: 750; color: var(--aqua); text-transform: uppercase; }
.intro p { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 14px 0 0; }

/* ---------- animação ---------- */

.stage { position: relative; height: 285px; margin: 7px 28px 0; overflow: hidden; }
.stage:before {
  content: ""; position: absolute; inset: 16px 0;
  background: radial-gradient(ellipse at center, #4c70b014, transparent 70%); pointer-events: none;
}
.stage svg { width: 100%; height: 100%; overflow: visible; }
.track { fill: none; stroke: #6683bd; stroke-opacity: .16; stroke-width: 1.25; stroke-dasharray: 4 10; }
.node { fill: #152943; stroke: #5a80a9; stroke-width: 1.25; }
.packet { fill: #61e4db; filter: drop-shadow(0 0 5px #55d6dba0); }
.packet.alt { fill: #8faeff; }
.source-file { fill: none; stroke: #bfd7fb; stroke-width: 1.8; stroke-linejoin: round; }
.dest-grid { fill: #6fe0dc; opacity: .26; transition: opacity .3s; }
.dest-grid.on { opacity: 1; filter: drop-shadow(0 0 4px #54dcd9); }

/* ---------- progresso ---------- */

.hero-progress { padding: 0 42px 30px; }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.meta strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.meta span { font-size: 29px; font-weight: 650; letter-spacing: -.04em; color: var(--aqua); font-variant-numeric: tabular-nums; }
.progress { height: 7px; background: #24334b; border-radius: 20px; margin: 14px 0 17px; overflow: hidden; }
.fill { background: linear-gradient(90deg, #659dfc, #68e8d8); height: 100%; width: 0%; border-radius: 20px; transition: width .2s linear; }
.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.detail { background: #ffffff06; border: 1px solid #ffffff0b; padding: 13px 14px; border-radius: 11px; }
.detail small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.detail strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.status-dot {
  display: inline-block; background: #58e1d6; width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 12px #58e1d6; margin-right: 6px; vertical-align: middle;
}
.status-dot.paused { background: var(--warn); box-shadow: 0 0 12px var(--warn); }
.status-dot.failed { background: var(--err); box-shadow: 0 0 12px var(--err); }

.alert { color: var(--warn); font-size: 13px; margin: 12px 0 0; min-height: 1em; }
.alert:empty { display: none; }
.alert.info { color: var(--muted); }

.controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 0; }

button {
  cursor: pointer; border: 1px solid #37506c; background: #172942; color: #edf5ff;
  padding: 11px 18px; border-radius: 10px; font: inherit; font-weight: 600;
}
button:hover { filter: brightness(1.12); }
button.primary { color: #061f28; background: var(--aqua); border-color: var(--aqua); }
button.danger { color: var(--err); }
button.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
button:focus-visible, input:focus-visible, .drop:focus-visible { outline: 2px solid #b9fff9; outline-offset: 3px; }
button:disabled { opacity: .5; cursor: default; }

/* ---------- código de acesso ---------- */

.token-form { display: flex; gap: 10px; padding: 22px 42px 34px; flex-wrap: wrap; }
.token-form input {
  flex: 1 1 260px; background: #0b1426; border: 1px solid #37506c; color: var(--ink);
  border-radius: 10px; padding: 12px 14px; font: 15px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em;
}
.token-form input::placeholder { color: #5d6f8f; letter-spacing: 0; font-family: inherit; }

.msg { margin: 0 42px 24px; padding: 11px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.msg.error { color: var(--err); border-color: #ff8a8a55; background: #ff8a8a12; }
.msg.ok { color: var(--aqua); border-color: #5ee4db55; background: #5ee4db12; }

/* ---------- seleção de arquivos ---------- */

.drop {
  margin: 0 42px 34px; border: 1.5px dashed #37506c; border-radius: 14px; padding: 26px 16px;
  text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--aqua); background: #5ee4db0d; }
.drop strong { color: var(--ink); display: block; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.drop.compact { padding: 14px 16px; }
.drop.compact strong { display: inline; font-size: 14px; margin: 0 6px 0 0; }

.limits { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.limits b { color: var(--ink); font-weight: 600; }

/* ---------- fila e envios interrompidos ---------- */

.list { margin-top: 16px; padding: 6px 22px; }
.list h2 { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 14px 0 4px; }
.item { padding: 12px 0; border-top: 1px solid #ffffff0d; }
.item:first-of-type { border-top: 0; }
.item .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.item .name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.item .name.current { color: var(--aqua); }
.item .stats { font-size: 12px; color: var(--muted); margin: 3px 0 7px; font-variant-numeric: tabular-nums; }
.item .actions { display: flex; gap: 6px; flex-shrink: 0; }
.item .bar { height: 4px; background: #24334b; border-radius: 4px; overflow: hidden; }
.item .bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #659dfc, #68e8d8); transition: width .3s; }
.item.done .bar > i { background: var(--aqua); }
.item.failed .bar > i { background: var(--err); }
.item .err { color: var(--warn); font-size: 12px; margin-top: 5px; }
.item .err:empty { display: none; }

.footnote { text-align: center; color: #8598b6; font-size: 12px; line-height: 1.5; margin: 18px 0 0; }

@media (max-width: 550px) {
  body { padding: 15px; }
  .topline { margin-bottom: 12px; }
  .panel { border-radius: 17px; }
  .stage { height: auto; aspect-ratio: 760 / 285; margin: 8px 12px 16px; }
  .hero-progress { padding: 0 20px 25px; }
  .details { gap: 6px; }
  .detail { padding: 10px 8px; }
  .detail strong { font-size: 12px; }
  .brand img { width: 150px; }
  .pill { font-size: 10px; }
  .intro { padding-top: 27px; }
  .token-form, .drop { margin-left: 20px; margin-right: 20px; }
  .token-form { padding: 18px 20px 26px; margin: 0; }
  .msg { margin: 0 20px 20px; }
  .list { padding: 4px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .fill, .dest-grid, .item .bar > i { transition: none; }
}
