/* Agora MVP — M0.6b app shell + auth screen.
   Calm and minimal on purpose: the real design pass comes before M1.
   Theme-aware via prefers-color-scheme, matching the M0.1 scaffold palette. */

:root {
  color-scheme: light dark;
  --bg: #faf9f7;
  --surface: #ffffff;
  --border: #e6e3dd;
  --text: #222222;
  --muted: #666666;
  --accent: #2f2a25;
  --accent-text: #faf9f7;
  --error: #a03020;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17161a;
    --surface: #201f24;
    --border: #34323a;
    --text: #ededed;
    --muted: #a0a0a0;
    --accent: #ecebe8;
    --accent-text: #201f24;
    --error: #e08b7a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.muted { color: var(--muted); }

/* --- View switching: exactly one .view is shown at a time --- */
.view { display: none; }
.view.is-active { display: block; }

/* Loading + login center their content; the app view fills the page. */
#loading-view.is-active,
#login-view.is-active {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

/* --- Login card --- */
.card {
  width: 100%;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.card h1 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.card > .muted {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

form { display: flex; flex-direction: column; }

label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

input {
  font: inherit;
  padding: 0.6rem 0.7rem;
  margin-bottom: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

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

button {
  font: inherit;
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  transition: opacity 0.12s ease;
}

button:disabled { opacity: 0.55; cursor: default; }

#login-submit {
  margin-top: 0.25rem;
  font-weight: 500;
  color: var(--accent-text);
  background: var(--accent);
}

#login-submit:not(:disabled):hover { opacity: 0.88; }

/* --- App frame --- */
.app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand { font-weight: 600; letter-spacing: -0.01em; }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 0.9rem; }

.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
}

.ghost:hover { border-color: var(--muted); }

.app-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.placeholder h2 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1.25rem;
}

.placeholder .muted { margin: 0; }

/* --- Error text (login + app) --- */
.error {
  margin: 1rem 0 0;
  color: var(--error);
  font-size: 0.9rem;
}
