/* The Flock sign-in site. Tokens are the Flock app's own (flock-app/frontend/src/app/globals.css),
   so this page reads as part of Flock: same canvas, card, accent, type scale and dark theme. */
:root {
  --surface-0: #f3ede5;
  --surface-1: #faf8f5;
  --surface-2: #ebe4da;
  --text-primary: #1a1c1d;
  --text-secondary: #464652;
  --text-muted: #5e5d6a;
  --text-ghost: #777683;
  --accent: #b83c20;
  --accent-strong: #f06040;
  --accent-hover: #d04828;
  --accent-muted: rgba(240, 96, 64, 0.08);
  --accent-border: rgba(240, 96, 64, 0.18);
  --border-default: #d7d3ce;
  --border-subtle: rgba(26, 28, 29, 0.08);
  --error: #dc2626;
  --shadow: 0 1px 2px rgba(26, 28, 29, 0.04), 0 12px 32px -16px rgba(26, 28, 29, 0.18);
  --grid-line: rgba(26, 28, 29, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.70);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-0: #0a0a09;
    --surface-1: #111110;
    --surface-2: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --text-ghost: #6b7280;
    --accent: #f06040;
    --accent-hover: #d85438;
    --accent-muted: rgba(240, 96, 64, 0.12);
    --accent-border: rgba(240, 96, 64, 0.25);
    --border-default: rgba(255, 255, 255, 0.10);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --error: #f06565;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
    --grid-line: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(17, 17, 17, 0.50);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* The Flock app's canvas: ruled into 40px squares, with the card as glass on it (OnboardingShell). */
body {
  margin: 0;
  background-color: var(--surface-0);
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-attachment: fixed;
  color: var(--text-primary);
  font: 400 14px/20px var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}
.card {
  width: 100%;
  max-width: 384px;
  background: var(--glass-bg);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 32px;
  animation: scale-in 200ms ease-out both;
}
@media (max-width: 480px) { .card { padding: 24px 20px; } }

.brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 28px; }
.mark { flex: none; }
.mark path { stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; fill: none; }
.mark.busy path { animation: pulse 1.2s ease-in-out infinite; }
.mark.busy path:nth-child(2) { animation-delay: 0.1s; }
.mark.busy path:nth-child(3) { animation-delay: 0.2s; }
.mark.busy path:nth-child(4) { animation-delay: 0.3s; }
.mark.busy path:nth-child(5) { animation-delay: 0.4s; }
.wordmark { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }

section { animation: fade-in 200ms ease-out both; }
.center { text-align: center; }
.title { margin: 0 0 8px; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; text-align: center; text-wrap: balance; }
.section { margin: 0 0 8px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-muted); }
.body { margin: 0 0 20px; font-size: 13px; line-height: 20px; color: var(--text-secondary); text-wrap: pretty; }
.body b { color: var(--text-primary); font-weight: 600; }
.hint { margin: -4px 0 16px; font-size: 12px; line-height: 18px; color: var(--text-muted); }
.status { margin: 0; font-size: 13px; color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

.address {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-0);
  border: 1px solid var(--border-default);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--text-primary);
  word-break: break-all;
}
.notice {
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 10px;
  font: 500 14px/20px var(--font-sans);
  cursor: pointer;
  transition: background 120ms ease-out, opacity 120ms ease-out;
}
.btn-primary { background: var(--accent-strong); color: #fff; text-decoration: none; }
.btn-primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible, .link:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.google-btn { display: flex; justify-content: center; min-height: 44px; }

.label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.optional { font-weight: 400; color: var(--text-muted); }
textarea {
  display: block; width: 100%; margin: 0 0 16px; padding: 10px 12px;
  border: 1px solid var(--border-default); border-radius: 10px;
  background: var(--surface-0); color: var(--text-primary);
  font: 400 13px/20px var(--font-sans); resize: vertical;
}
textarea::placeholder { color: var(--text-ghost); }

.account {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; line-height: 18px; color: var(--text-muted);
}
#who { color: var(--text-secondary); word-break: break-all; }
.account .actions, .switch-row { display: flex; gap: 6px; justify-content: center; }
.link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--accent);
}
.link:hover { text-decoration: underline; }

.switch-row { margin: 12px 0 0; font-size: 12px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-card {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: var(--surface-0); border: 1px solid var(--border-default);
  color: var(--text-primary); text-decoration: none; font-size: 12px;
  transition: border-color 120ms ease-out;
}
.row-card:hover { border-color: var(--accent-border); }
.row-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row-card .addr { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .role { color: var(--text-muted); white-space: nowrap; }
.row-card .chev { color: var(--text-ghost); font-size: 16px; line-height: 1; }
.row-card.offline .addr { color: var(--text-muted); }
.group + .group { margin-top: 16px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.dot.on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15); }
.dot.off { background: var(--text-ghost); opacity: 0.6; }
.dot.unknown { background: transparent; border: 1px solid var(--text-ghost); }

.footer { margin: 16px 0 0; font-size: 11px; color: var(--text-ghost); display: flex; gap: 6px; }
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 10px;
  background: var(--text-primary); color: var(--surface-1);
  font-size: 13px; box-shadow: var(--shadow);
}

@keyframes scale-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
