:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  color: #f7f7f4;
  background:
    radial-gradient(circle at 18% 8%, rgba(202, 255, 61, .075), transparent 31%),
    radial-gradient(circle at 86% 92%, rgba(111, 148, 47, .06), transparent 34%),
    #101210;
}

.download-box { width: min(720px, calc(100% - 32px)); }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: #f7f7f4;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 58px;
  height: 52px;
  padding: 5px;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #d9ff66, #a9e625);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28), 0 0 0 5px rgba(202, 255, 61, .055);
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { color: #fff; font-size: 18px; letter-spacing: .08em; }
.brand-copy span { color: #aeb5a7; font-size: 10px; font-weight: 750; letter-spacing: .22em; }

h1 {
  margin: 0 0 24px;
  font-size: clamp(40px, 8vw, 72px);
  letter-spacing: -.06em;
}

form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
#access-login-form { grid-template-columns: 1fr 1fr auto; }

input,
button {
  min-height: 60px;
  border: 0;
  font: inherit;
}

input {
  width: 100%;
  padding: 0 18px;
  color: #fff;
  background: #20231f;
  outline: 1px solid #363a34;
}

input:focus { outline: 2px solid #caff3d; }

button {
  padding: 0 28px;
  color: #111;
  background: #caff3d;
  font-weight: 800;
  cursor: pointer;
}

.button-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.button-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message,
.note {
  margin: 14px 0 0;
  color: #9da097;
  font-size: 13px;
}

.message.error { color: #ff8067; }
.message.success { color: #caff3d; }
.hidden { display: none; }

@media (max-width: 580px) {
  form { grid-template-columns: 1fr; }
  #access-login-form { grid-template-columns: 1fr; }
}

textarea {
  width: 100%;
  padding: 16px 18px;
  border: 0;
  color: #fff;
  background: #20231f;
  outline: 1px solid #363a34;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
}

textarea:focus { outline: 2px solid #caff3d; }
#cookie-form { grid-template-columns: 1fr auto auto; }
#cookie-form textarea { grid-column: 1 / -1; }
button.secondary { color: #f7f7f4; background: #363a34; }
button:disabled { cursor: wait; opacity: .65; }
a { color: #caff3d; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-link {
  display: inline-grid;
  min-height: 60px;
  padding: 0 28px;
  place-items: center;
  color: #111;
  background: #caff3d;
  font-weight: 800;
  text-decoration: none;
}
.button-link.secondary { color: #f7f7f4; background: #363a34; }
.button-link.hidden { display: none; }
.text-button {
  min-height: auto;
  padding: 0;
  color: #caff3d;
  background: transparent;
  font-size: inherit;
  text-decoration: underline;
}

@media (max-width: 580px) {
  #cookie-form { grid-template-columns: 1fr; }
  #cookie-form textarea { grid-column: 1; }
  .button-row { display: grid; }
}
.file-progress-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}
.file-progress-list.hidden { display: none; }
.file-progress-item {
  position: relative;
  padding: 14px;
  overflow: hidden;
  background: #171a16;
  border: 1px solid #363a34;
  border-radius: 12px;
  transition: border-color .25s ease, background-color .25s ease;
}
.file-progress-item.is-running { border-color: #66752e; }
.file-progress-item.is-completed {
  border-color: #8eb72b;
  background: linear-gradient(120deg, #182014, #1d2a16);
}
.file-progress-item.is-delivered { animation: completed-card .65s cubic-bezier(.2, .9, .25, 1.15) both; }
.file-progress-item.is-error { border-color: #8c4135; background: #211613; }
.file-progress-header,
.file-progress-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.file-progress-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.file-progress-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}
.file-status-icon,
.download-result-check {
  position: relative;
  display: inline-grid;
  width: 0;
  height: 28px;
  flex: none;
  place-items: center;
  opacity: 0;
  transform: scale(.35) rotate(-18deg);
}
.file-status-icon svg,
.download-result-check svg { width: 100%; height: 100%; overflow: visible; }
.check-ring {
  fill: #caff3d;
  stroke: #caff3d;
  stroke-width: 2;
}
.check-mark {
  fill: none;
  stroke: #111;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.is-completed .file-status-icon,
.download-result-item.is-delivered .download-result-check {
  width: 28px;
  opacity: 1;
  animation: check-pop .52s cubic-bezier(.15, .85, .3, 1.35) both;
}
.is-completed .check-mark,
.download-result-item.is-delivered .check-mark { animation: check-draw .38s .22s ease-out forwards; }
.is-delivered .file-status-icon::after,
.download-result-item.is-delivered .download-result-check::after {
  position: absolute;
  width: 4px;
  height: 4px;
  content: "";
  background: #caff3d;
  border-radius: 50%;
  box-shadow: -17px -9px 0 #caff3d, 17px -8px 0 #93d92f, -13px 15px 0 #93d92f, 15px 13px 0 #caff3d;
  animation: success-sparks .72s .15s ease-out both;
}
.file-progress-percent {
  flex: none;
  color: #caff3d;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.is-error .file-progress-percent,
.is-error .file-progress-label { color: #ff8067; }
.file-progress-track {
  height: 9px;
  margin: 11px 0 9px;
  overflow: hidden;
  background: #292d27;
  border-radius: 999px;
}
.file-progress-bar {
  position: relative;
  width: 0;
  height: 100%;
  overflow: hidden;
  background: #caff3d;
  border-radius: inherit;
  transition: width .65s cubic-bezier(.22, 1, .36, 1);
}
.is-running .file-progress-bar::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-100%);
  animation: progress-sweep 1.15s linear infinite;
}
.is-error .file-progress-bar { background: #ff8067; }
.file-progress-detail {
  color: #9da097;
  font-size: 12px;
}
.file-progress-order { flex: none; font-variant-numeric: tabular-nums; }
@keyframes progress-sweep {
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .file-progress-bar { transition: none; }
  .is-running .file-progress-bar::after { animation: none; }
  .file-progress-item.is-delivered,
  .is-completed .file-status-icon,
  .download-result-item.is-delivered .download-result-check,
  .is-completed .check-mark,
  .download-result-item.is-delivered .check-mark,
  .is-delivered .file-status-icon::after,
  .download-result-item.is-delivered .download-result-check::after { animation: none; }
  .is-completed .check-mark,
  .download-result-item.is-delivered .check-mark { stroke-dashoffset: 0; }
}
.download-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.download-results.hidden { display: none; }
.download-result-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #f7f7f4;
  background: #171a16;
  border: 1px solid #45513a;
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
}
.download-result-item:hover {
  background: #1d2519;
  border-color: #8eb72b;
  transform: translateY(-1px);
}
.download-result-item.is-delivered { border-color: #7ea52c; }
.download-result-content {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.download-result-content strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.download-result-content span { color: #aeb5a7; font-size: 12px; }

@keyframes completed-card {
  0% { transform: scale(.985); box-shadow: 0 0 0 rgba(202, 255, 61, 0); }
  55% { transform: scale(1.012); box-shadow: 0 0 28px rgba(202, 255, 61, .13); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(202, 255, 61, 0); }
}
@keyframes check-pop {
  from { opacity: 0; transform: scale(.35) rotate(-18deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes check-draw { to { stroke-dashoffset: 0; } }
@keyframes success-sparks {
  0% { opacity: 0; transform: scale(.2); }
  45% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.55); }
}

.admin-box { width: min(1120px, calc(100% - 32px)); padding: 40px 0; }
.admin-dashboard { display: grid; gap: 18px; }
.admin-dashboard.hidden { display: none; }
.admin-section {
  padding: 20px;
  background: #171a16;
  border: 1px solid #363a34;
}
.admin-section h2 { margin: 0 0 14px; font-size: 20px; }
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-heading h2 { margin-bottom: 4px; }
.section-heading p { margin: 0; color: #9da097; font-size: 13px; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compact-form { grid-template-columns: 1fr 1fr auto; }
.stack-form { grid-template-columns: 1fr; }
.user-form { grid-template-columns: 1fr 1fr 1.25fr auto; margin-bottom: 16px; }
.small-button { min-height: 38px; padding: 0 14px; font-size: 12px; }
button.danger { color: #fff; background: #7b3328; }
.user-list,
.audit-list { display: grid; gap: 9px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  background: #101210;
  border: 1px solid #30342e;
}
.user-row.is-disabled { opacity: .58; }
.user-row strong,
.user-row span { display: block; }
.user-row span { margin-top: 3px; color: #9da097; font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.audit-item {
  padding: 14px;
  background: #101210;
  border-left: 3px solid #66752e;
}
.audit-item.status-completed { border-color: #caff3d; }
.audit-item.status-failed { border-color: #ff8067; }
.audit-item.status-partial { border-color: #efc45a; }
.audit-header { display: flex; justify-content: space-between; gap: 16px; }
.audit-status { color: #caff3d; font-size: 12px; font-weight: 800; }
.status-failed .audit-status { color: #ff8067; }
.status-partial .audit-status { color: #efc45a; }
.audit-meta { margin-top: 5px; color: #9da097; font-size: 12px; }
.audit-links { margin: 10px 0 0; padding-left: 22px; }
.audit-links li { margin: 5px 0; }
.audit-links a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.audit-error { margin-top: 9px; color: #ff8067; font-size: 12px; }

@media (max-width: 850px) {
  .admin-columns { grid-template-columns: 1fr; }
  .compact-form,
  .user-form { grid-template-columns: 1fr; }
  .user-row,
  .section-heading { align-items: stretch; flex-direction: column; }
  .row-actions { justify-content: flex-start; }
}
