* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1a1a1a;
  color: #e0e0e0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.brand {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card {
  width: 100%;
  max-width: 480px;
  padding: 48px 32px;
  text-align: center;
}

/* States */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hidden {
  display: none !important;
}

.status {
  font-size: 18px;
  font-weight: 500;
  color: #e0e0e0;
}

.detail {
  font-size: 14px;
  color: #888;
  line-height: 1.5;
  max-width: 340px;
}

/* Spinner */

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top-color: #e0e0e0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Downloading */

.file-name {
  font-size: 16px;
  font-weight: 500;
  color: #e0e0e0;
  word-break: break-all;
}

.file-size {
  font-size: 13px;
  color: #888;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #4a9eff;
  border-radius: 4px;
  transition: width 0.15s ease;
}

.progress-info {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* Complete */

#state-complete .status {
  color: #4caf50;
}

/* Preview */

#preview-container {
  width: 100%;
  margin-bottom: 8px;
}

#preview-container img,
#preview-container video {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
}

.file-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  color: #888;
}

.file-placeholder svg {
  width: 48px;
  height: 48px;
  color: #555;
}

.file-placeholder .file-type-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Download button */

.download-btn {
  margin-top: 8px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: #4a9eff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.download-btn:hover {
  background: #3a8eef;
}

.download-btn:active {
  background: #2a7edf;
}

/* Password form */

.password-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  max-width: 320px;
}

.password-form input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  color: #e0e0e0;
  outline: none;
}

.password-form input:focus {
  border-color: #4a9eff;
}

.password-error {
  color: #ef5350 !important;
  font-size: 13px;
}

/* Error */

#state-error .status {
  color: #ef5350;
}
