:root {
  color-scheme: light dark;
  --background: #f3eff4;
  --panel: #ffffff;
  --field: #ffffff;
  --ink: #17171c;
  --muted: #666874;
  --line: #d8d9e0;
  --brand: #815477;
  --brand-dark: #4b3048;
  --action: #1479ef;
  --action-hover: #0868d1;
  --danger: #a53737;
  --success: #157f39;
  --focus: rgba(20, 121, 239, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #17161a;
    --panel: #242328;
    --field: #1c1b20;
    --ink: #f4f3f6;
    --muted: #b7b4be;
    --line: #46434d;
    --brand: #68445f;
    --brand-dark: #392336;
    --action: #2789f4;
    --action-hover: #4c9df5;
    --danger: #ff7d86;
    --success: #66d68a;
    --focus: rgba(98, 169, 255, 0.34);
  }
}

* {
  box-sizing: border-box;
}

body {
  background: var(--background);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.brand-bar {
  background: var(--brand-dark);
  border-bottom: 8px solid var(--brand);
  color: #ffffff;
  padding: 20px max(20px, calc((100vw - 720px) / 2));
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: #ffffff;
  border-radius: 50%;
  color: var(--brand-dark);
  display: flex;
  font-size: 22px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand-name,
.brand-product,
h1,
p {
  margin: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 750;
}

.brand-product {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  margin-top: 2px;
}

.upload-shell {
  margin: 0 auto;
  max-width: 720px;
  padding: 34px 20px 60px;
}

.upload-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(30, 18, 34, 0.1);
  padding: clamp(22px, 5vw, 36px);
}

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

.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(27px, 5vw, 36px);
  line-height: 1.14;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.supporting-copy,
.privacy-note {
  color: var(--muted);
  line-height: 1.5;
}

.supporting-copy {
  margin-top: 10px;
}

.sign-in-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.sign-in-form label {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

.sign-in-form input {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

.sign-in-form input:focus,
.file-picker:focus-within,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.primary-button,
.quiet-button {
  border-radius: 7px;
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  align-items: center;
  background: var(--action);
  border: 0;
  color: #ffffff;
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-top: 14px;
  min-height: 50px;
  padding: 12px 18px;
  width: 100%;
}

.primary-button:hover:not(:disabled) {
  background: var(--action-hover);
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.quiet-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  min-height: 38px;
  padding: 8px 12px;
}

.button-spinner,
.spinner {
  animation: spin 700ms linear infinite;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  height: 20px;
  width: 20px;
}

.button-spinner {
  display: none;
  height: 17px;
  width: 17px;
}

.is-working .button-spinner {
  display: inline-block;
}

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

.status-panel {
  align-items: flex-start;
  display: flex;
  gap: 16px;
}

.status-panel p {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}

.upload-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.link-details {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 8px 18px;
  margin-top: 18px;
  padding-bottom: 18px;
}

.file-picker {
  align-items: center;
  border: 2px dashed var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  margin-top: 24px;
  min-height: 112px;
  padding: 20px;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.file-picker:hover {
  border-color: var(--action);
}

.file-picker.is-dragging {
  background: color-mix(in srgb, var(--action) 10%, var(--panel));
  border-color: var(--action);
}

.file-picker.is-disabled {
  cursor: default;
  opacity: 0.56;
}

.file-picker.is-disabled:hover {
  border-color: var(--line);
}

.file-picker-icon {
  align-items: center;
  background: var(--action);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  flex: 0 0 auto;
  font-size: 26px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.file-picker strong,
.file-picker small {
  display: block;
}

.file-picker small {
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
}

#fileInput {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.selected-summary {
  color: var(--muted);
  font-size: 14px;
  margin-top: 16px;
}

.upload-queue {
  margin-top: 8px;
}

.queue-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 14px 0;
}

.queue-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.queue-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.queue-remove {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 23px;
  height: 30px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 2px;
  width: 30px;
}

.queue-remove:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.queue-state {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
}

.queue-state.success {
  color: var(--success);
}

.queue-state.error,
.form-status.error {
  color: var(--danger);
}

.progress-track {
  background: var(--line);
  border-radius: 3px;
  height: 5px;
  overflow: hidden;
}

.progress-value {
  background: var(--action);
  height: 100%;
  transition: width 120ms ease;
  width: 0;
}

.form-status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-top: 12px;
  min-height: 20px;
}

.privacy-note {
  border-top: 1px solid var(--line);
  font-size: 13px;
  margin-top: 22px;
  padding-top: 18px;
}

.error-symbol {
  align-items: center;
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border: 1px solid var(--danger);
  border-radius: 50%;
  color: var(--danger);
  display: flex;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

@media (max-width: 520px) {
  .brand-bar {
    padding: 16px 20px;
  }

  .upload-shell {
    padding: 20px 12px 40px;
  }

  .upload-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .quiet-button {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button-spinner,
  .spinner {
    animation-duration: 1400ms;
  }
}
