.download-main {
  min-height: 70vh;
  background: #f4f7fb;
}

.download-hero {
  padding: 70px 0 64px;
  color: #fff;
  background: linear-gradient(125deg, #031a35 0%, #062b54 70%, #0877f9 160%);
}

.download-hero h1 {
  margin: 8px 0 14px;
  color: #fff;
  font-size: clamp(2.25rem, 5vw, 4rem);
}

.download-hero p:last-child {
  max-width: 680px;
  margin: 0;
  color: #dce9f8;
  font-size: 1.1rem;
}

.download-content {
  padding: 64px 0 90px;
}

.download-card {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(3, 26, 53, .09);
}

.login-card {
  max-width: 560px;
}

.card-heading,
.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.card-heading {
  justify-content: flex-start;
}

.card-heading h2,
.files-toolbar h2 {
  margin: 4px 0;
}

.lock-mark {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.download-field {
  margin-bottom: 20px;
}

.download-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

.download-field input {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid #b9c7d6;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.download-field input:focus {
  outline: 3px solid rgba(8, 119, 249, .18);
  border-color: var(--blue);
}

.download-button {
  width: 100%;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.download-button:disabled,
.files-toolbar button:disabled {
  cursor: wait;
  opacity: .65;
}

.security-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.status-message {
  max-width: 880px;
  margin: 0 auto 18px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #7a1d1d;
  background: #fff0f0;
  border: 1px solid #f2c5c5;
}

.status-message.success {
  color: #145b35;
  background: #eefaf3;
  border-color: #bce5cc;
}

.button-outline-dark {
  border: 1px solid var(--blue);
  color: var(--blue);
  background: #fff;
  cursor: pointer;
}

.file-list {
  border-top: 1px solid var(--line);
}

.admin-panel-link {
  display: inline-block;
  margin-top: 5px;
  color: var(--blue);
  font-size: .9rem;
  font-weight: 700;
}

.admin-panel-link[hidden] {
  display: none;
}

.file-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 110px auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}

.file-row:hover {
  background: #f7faff;
}

.file-select {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--blue);
}

.file-name {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 750;
}

.file-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: .8rem;
}

.file-download {
  white-space: nowrap;
  padding: 8px 13px;
  font-size: .86rem;
}

.selection-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 50px;
  padding: 8px 4px;
  border-top: 1px solid var(--line);
}

.sort-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
  padding: 4px 0;
  color: var(--muted);
  font-size: .86rem;
}

.sort-toolbar[hidden],
.selection-toolbar[hidden] {
  display: none;
}

.sort-toolbar select {
  min-height: 34px;
  padding: 4px 28px 4px 9px;
  border: 1px solid #b9c7d6;
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clear-selection-button {
  padding: 4px 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.clear-selection-button:hover,
.clear-selection-button:focus {
  color: var(--navy2);
}

#selection-count {
  margin-right: auto;
  color: var(--muted);
  font-size: .88rem;
}

.compact-button {
  padding: 9px 14px;
  border: 0;
  cursor: pointer;
  font-size: .86rem;
}

.compact-button:disabled {
  cursor: default;
  opacity: .5;
}

.empty-state {
  padding: 38px 20px;
  border: 1px dashed #b9c7d6;
  border-radius: 10px;
  text-align: center;
}

.empty-state h3 {
  margin-top: 0;
}

@media (max-width: 640px) {
  .download-hero {
    padding: 50px 0;
  }

  .download-content {
    padding: 34px 0 60px;
  }

  .files-toolbar,
  .file-row {
    align-items: flex-start;
  }

  .files-toolbar {
    flex-direction: column;
  }

  .file-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .file-row > .file-meta {
    display: none;
  }

  .selection-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sort-toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #selection-count {
    margin-right: 0;
  }

  .selection-toolbar .compact-button {
    width: 100%;
    justify-content: center;
  }
}
