:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #667085;
  --line: #e5e7eb;
  --hover: #f8fafc;
  --accent: #111827;
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { image-rendering: pixelated; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  background: #fff;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
}
.logo-icon { width: 26px; height: 26px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  margin: 0 auto;
}

.site-nav { display: flex; align-items: center; gap: 10px; }
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.nav-icon { width: 18px; height: 18px; }
.nav-form { margin: 0; }

main {
  flex: 1;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.site-footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }

.hero { text-align: center; padding: 72px 12px; }
.hero-icon { width: 56px; height: 56px; margin-bottom: 12px; }
.hero h1 { margin: 0 0 8px; font-size: 2.2rem; font-weight: 700; }
.hero p { color: var(--muted); margin: 0 0 24px; }
.hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn--small { padding: 7px 12px; font-size: 0.9rem; }
.btn-icon { width: 18px; height: 18px; }

.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.flash--ok { color: #067647; }
.flash--error { color: #b42318; }
.flash-icon { width: 20px; height: 20px; }

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

body.login-page main {
  width: 100%;
  padding: 24px 16px;
}
.panel {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-icon { width: 36px; height: 36px; }
.auth-head h1 { margin: 8px 0 0; }
.auth-switch { text-align: center; margin: 16px 0 0; color: var(--muted); }
.auth-switch a { color: var(--text); font-weight: 600; text-decoration: underline; }

.stack { display: flex; flex-direction: column; gap: 12px; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}
input[type="text"], input[type="password"], input[type="email"], .server-input {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
}
input:focus, .server-input:focus { border-color: #98a2b3; }

.list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 1.4rem;
}
.title-icon { width: 24px; height: 24px; }

.server-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.server-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.server-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.server-row:last-child { border-bottom: none; }
.server-row:hover { background: var(--hover); }
.server-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #f2f4f7;
}
.server-main { flex: 1; min-width: 0; }
.server-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.server-name { font-weight: 700; }
.server-count { color: var(--muted); font-size: 0.9rem; }
.server-motd {
  margin: 4px 0 0;
  font-family: var(--font);
  font-size: 0.92rem;
  color: #475467;
  white-space: pre-wrap;
  line-height: 1.35;
}
.server-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}
.server-join { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.server-side { display: flex; gap: 6px; flex-shrink: 0; }
.server-side form { margin: 0; }

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn img { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--hover); }
.icon-btn.copied { background: #d1fadf; }

.server-add { background: #fafafa; }
.server-add .server-input { flex: 1; }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .site-nav.open { display: flex; }
  .hero h1 { font-size: 1.8rem; }
  .server-row { flex-wrap: wrap; }
}
