:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --card-bg: #1a1d24;
  --text: #eef0f3;
  --muted: #9aa1ac;
  --accent: #6a5cff;
  /* Darker, not lighter, than --accent -- the original lighter shade
     (#8577ff) dropped white button-text contrast to 3.45:1 on hover,
     below WCAG AA's 4.5:1 (caught by the e2e suite's axe-core scan). */
  --accent-hover: #5546d9;
}

* {
  box-sizing: border-box;
}

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

.page {
  max-width: 34rem;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.5rem 0;
}

.hero {
  text-align: center;
}

.card {
  width: 100%;
  background: var(--card-bg);
  border-radius: 0.75rem;
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.footnote {
  padding-top: 1.5rem;
  border-top: 1px solid #262a33;
  text-align: center;
}

.footnote p {
  font-size: 0.75rem;
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

.text-link {
  display: inline-block;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.text-link:hover {
  color: var(--text);
  text-decoration: underline;
}

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

h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease;
}

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

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fine-print {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  min-height: 1.1em;
}

.button-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  background: #fff;
  color: #1f1f1f;
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.75rem;
  border-radius: 0.5rem;
  border: 1px solid #dadce0;
  cursor: pointer;
  font-size: 1rem;
  box-sizing: border-box;
}

.button-google:hover {
  background: #f7f7f7;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #333844;
}

form {
  text-align: left;
}

.field {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.field[hidden] {
  display: none;
}

.field input[type="email"],
.field input[type="text"],
.field input[type="password"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #333844;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}

/* Unlike text inputs, a bare <select> falls back to the OS's native
   (light) control chrome even with color-scheme: dark set on :root --
   caught by an e2e screenshot review, not axe-core (contrast was fine;
   it just visibly broke the dark theme). */
.field select {
  color-scheme: dark;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.instruments {
  border: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1rem;
}

.instruments legend {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0;
  margin: 0 0 0.75rem;
  grid-column: 1 / -1;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: normal;
  cursor: pointer;
}

.checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  /* accent-color only themes the checked state -- unchecked boxes still
     fell back to the OS's native (light) chrome, same root cause as the
     <select> fix above. */
  color-scheme: dark;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid #333844;
}

.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.thread-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid #262a33;
}

.thread-item:last-child {
  border-bottom: none;
}

.thread-item a.text-link {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.post-body {
  white-space: pre-wrap;
  color: var(--text);
}

@media (max-width: 30rem) {
  .instruments {
    grid-template-columns: 1fr;
  }
}
