:root {
  color-scheme: dark;
  --bg: #0e0e0e;
  --panel: #1a1a1a;
  --field: #232323;
  --ink: #f2f2f2;
  --muted: #a3a3a3;
  --accent: #4c7dff;
  --accent-dark: #3966e0;
  --error: #ff7566;
  --success: #4cd08a;
  --line: #3d3d3d;
  --off: #8f2424;
  --off-line: #d9534f;
  --on: #1e7a3c;
  --on-line: #34c768;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.panel {
  width: 100%;
  max-width: 34rem;
  background: var(--panel);
  padding: 2.5rem 2rem 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

h1 {
  margin: 0 0 0.5rem;
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
}

.intro {
  margin: 0 0 2rem;
  color: var(--muted);
  text-align: center;
}

.field { margin-bottom: 1.25rem; }

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.95rem;
}

input,
textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 4px;
}

textarea { display: block; resize: vertical; }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 125, 255, 0.3);
}

fieldset {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  border: none;
}

legend {
  padding: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Multi-select groups: each option is a button, red when off and green when on. */
.toggles { gap: 0.5rem; }

.toggles .option {
  padding: 0.45rem 0.9rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: #fff;
  background: var(--off);
  border: 1.5px solid var(--off-line);
  border-radius: 999px;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.toggles .option:has(input:checked) {
  background: var(--on);
  border-color: var(--on-line);
}

/* The tick means the state isn't carried by color alone. */
.toggles .option:has(input:checked)::before { content: "✓"; }

.toggles .option:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Keep the real checkbox focusable but out of sight. */
.toggles input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

input[aria-invalid="true"] { border-color: var(--error); }

.error {
  margin: 0.3rem 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--error);
}

/* "Logged in as … / Sair" bar above the form. */
.account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.account strong { color: var(--ink); font-weight: 500; }

/* Read-only list of where the organisers placed the volunteer. */
.assignments {
  margin-bottom: 1.75rem;
  padding: 1rem 0.9rem;
  border: 1px solid var(--on-line);
  border-radius: 4px;
}

.assignments h2 {
  margin: 0 0 0.75rem;
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: 1.15rem;
}

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

.assignments li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.assignments .day {
  min-width: 5.5rem;
  font-weight: 500;
}

.assignments .tag {
  padding: 0.15rem 0.6rem;
  font-size: 0.9rem;
  color: #fff;
  background: var(--on);
  border: 1px solid var(--on-line);
  border-radius: 999px;
}

.assignments-empty,
.assignments-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.assignments-note { margin-top: 0.75rem; }

button.link-button {
  width: auto;
  margin: 0;
  padding: 0.3rem 0.8rem;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
}

button.link-button:hover { background: var(--line); }

button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }

button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

button:disabled { opacity: 0.6; cursor: wait; }

.status {
  margin: 1rem 0 0;
  min-height: 1.5em;
  font-size: 0.95rem;
}

.status.success { color: var(--success); }
.status.failure { color: var(--error); }
