* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 24px;
}

.auth-bar {
  border-radius: 16px;
  padding: 16px 24px;
  max-width: 640px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Логотип: тёмно-синяя папка на светлой плашке, иначе сливается с тёмным фоном */
.brand {
  margin-right: auto;
  display: inline-flex;
  border-radius: 10px;
}

.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
}

.brand:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.upload-card,
.links-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  max-width: 640px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.upload-card h1 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 28px;
}

.links-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 20px;
}

button#add-files-btn {
  display: block;
  margin: 16px auto 0;
  padding: 12px 28px;
  font-size: 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  color: #f9fafb;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

button#add-files-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(79, 70, 229, 0.6);
  filter: brightness(1.05);
}

button#add-files-btn:active {
  transform: translateY(1px);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.5);
}

.status {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: #a5b4fc;
}

.upload-item {
  margin-top: 16px;
}

.upload-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 4px;
}

.progress-bar-wrapper {
  width: 100%;
  background: rgba(30, 64, 175, 0.4);
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  transition: width 0.15s ease-out;
}

.links-card .admin-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 10px;
}

#links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.link-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.link-row-main {
  display: flex;
  flex-direction: column;
}

.alias {
  font-weight: 500;
  color: #e5e7eb;
}

.url {
  color: #a5b4fc;
  word-break: break-all;
}

.file-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
}

.file-date,
.file-size {
  display: inline-flex;
  align-items: center;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drop-zone {
  padding: 20px 12px;
  text-align: center;
  border: 2px dashed #475569;
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone.drag-over {
  border-color: #a5b4fc;
  background: rgba(79, 70, 229, 0.2);
}

.drop-zone[aria-busy="true"] {
  opacity: 0.65;
}

.upload-hint {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 0;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.alias, .upload-item-header {
  overflow-wrap: anywhere;
}

.link-row-main {
  min-width: 0;
  max-width: 100%;
}

.small-btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  cursor: pointer;
}

.small-btn:hover {
  background: rgba(30, 64, 175, 0.7);
}

.small-btn.delete-btn {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.small-btn.delete-btn:hover {
  background: rgba(220, 38, 38, 0.3);
  border-color: rgba(239, 68, 68, 0.7);
}

@media (max-width: 640px) {
  .upload-card,
  .links-card {
    padding: 20px;
  }

  .link-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Модальное окно авторизации */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 24px;
  text-align: center;
  font-size: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #e5e7eb;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.auth-btn,
.logout-btn,
.auth-submit-btn,
.auth-cancel-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  font-weight: 500;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.auth-btn:active {
  transform: translateY(0);
}

.logout-btn {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-weight: 400;
}

.logout-btn:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

.logout-btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 16px;
  line-height: 1;
}

.auth-submit-btn {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #f9fafb;
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.auth-cancel-btn {
  background: rgba(148, 163, 184, 0.2);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.auth-cancel-btn:hover {
  background: rgba(148, 163, 184, 0.3);
}



