:root {
  color-scheme: light;
  --text: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --surface: #f6f8fa;
  --accent: #0b57d0;
  --accent-text: #ffffff;
  --error: #b3261e;
  --success: #1a7f37;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
}

body {
  margin: 0;
  background: #ffffff;
}

/* Keeps the hidden attribute working on elements that set their own display. */
[hidden] {
  display: none !important;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}

h2:focus {
  outline: none;
}

h3 {
  font-size: 1.1rem;
  margin: 2rem 0 0.5rem;
}

a {
  color: var(--accent);
}

.status,
.hint {
  color: var(--muted);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
}

legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

.choice {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.4rem 0;
}

.choice input {
  margin-top: 0.3rem;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
}

label {
  display: block;
}

input[type="text"] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
}

#prolific-id {
  max-width: 24rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 0.75rem;
}

button,
.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.secondary {
  color: var(--accent);
  background: #ffffff;
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
.drop-zone input:focus-visible + label {
  outline: 3px solid #99c2ff;
  outline-offset: 2px;
}

.error {
  color: var(--error);
  font-weight: 600;
}

.confirmed {
  color: var(--success);
  font-weight: 600;
}

.drop-zone {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
  padding: 1.25rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.drop-zone.dragging {
  border-color: var(--accent);
}

.drop-zone.locked {
  opacity: 0.5;
}

.drop-zone.locked label {
  cursor: not-allowed;
}

/* Hidden visually but kept focusable, so the "Choose files" label works from the keyboard. */
.drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file-size {
  color: var(--muted);
  text-align: right;
}

.file-status {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.95rem;
}

.file .remove {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  padding: 0.1rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  background: #ffffff;
}

.file.done .file-status,
.file.submitted .file-status {
  color: var(--success);
}

.file.rejected .file-status,
.file.stopped .file-status {
  color: var(--error);
}

.file progress,
.overall progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 0.6rem;
}

.overall {
  margin: 1rem 0;
}

.overall p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}
