/* Identity — shared styles across all pages */

:root {
  color-scheme: light dark;
  --text: #2a2a2a;
  --text-light: #6b6b6b;
  --bg: #fafaf8;
  --accent: #2d5f2d;
  --accent-hover: #1a4a1a;
  --border: #e0ddd8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e0ddd8;
    --text-light: #9a9590;
    --bg: #1a1917;
    --accent: #5fa65f;
    --accent-hover: #7bc47b;
    --border: #3a3835;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: Georgia, "Noto Serif", serif;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 2rem 1rem;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 28rem;
  width: 100%;
}

main.compact {
  max-width: 24rem;
  text-align: center;
}

h1 {
  font-family: system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
}

h2 {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
}

p { margin: 0 0 1.5rem; }

/* --- Forms --- */

label {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin: 0 0 0.25rem;
  text-align: left;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  display: block;
  width: 100%;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  margin: 0 0 0.75rem;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Feedback --- */

.error { color: #b44; margin: 1rem 0; font-size: 0.9rem; }
.success { color: var(--accent); font-weight: 600; }
.subtle { color: var(--text-light); font-size: 0.9rem; }

.field-hint {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
  margin: -0.5rem 0 0.75rem;
}

.field-error {
  color: #b44;
  font-size: 0.8rem;
  margin: -0.5rem 0 0.75rem;
}

/* --- Login --- */

.or-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-light);
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

#password-form { text-align: left; }

/* --- Enrollment --- */

.step { display: none; }
.step.active { display: block; }

.password-link {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 1.5rem;
}

.password-link a {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.password-link a:hover { color: var(--text); }

.back-link,
.back {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: none;
  display: inline-block;
  margin-top: 1.5rem;
}

.back-link:hover,
.back:hover { color: var(--text); }

/* --- Home --- */

.greeting {
  color: var(--text-light);
  margin: 0 0 2rem;
}

.services {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.services a {
  display: block;
  padding: 0.75rem 0;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-family: system-ui, sans-serif;
  font-size: 1rem;
}

.services li:first-child a {
  border-top: 1px solid var(--border);
}

.services a:hover { color: var(--accent-hover); }

.services .service-url {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.sign-out {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--text-light);
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.sign-out:hover {
  color: var(--text);
  border-color: var(--text-light);
}

/* --- Rhizome --- */

.brand {
  font-family: system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
}

.qr {
  margin: 0 auto 1.5rem;
  max-width: 16rem;
}

.qr svg { width: 100%; height: auto; }

@media (prefers-color-scheme: dark) {
  .qr svg rect[fill="#ffffff"] { fill: #1a1917; }
  .qr svg rect[fill="#000000"] { fill: #e0ddd8; }
}

.subtitle {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin: 0 0 2rem;
}

.url {
  font-size: 0.8rem;
  color: var(--text-light);
  word-break: break-all;
  margin: 0 0 0.5rem;
}

.url a {
  color: var(--accent);
  text-decoration: none;
}

.note {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 1.5rem 0 0;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

.copy-btn {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--text-light);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}

.copy-btn:hover {
  border-color: var(--text-light);
  color: var(--text);
}
