:root {
  --bg: #0f1419;
  --bg-card: #1a222d;
  --bg-elevated: #232d3b;
  --border: #2d3a4d;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --accent: #44b78b;
  --accent-dim: #2d8f6a;
  --accent-glow: rgba(68, 183, 139, 0.25);
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, var(--accent-glow), transparent),
    linear-gradient(180deg, var(--bg) 0%, #0c1015 100%);
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.centered-card,
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
}

.centered-card {
  max-width: 580px;
  margin: 3rem auto;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

p {
  margin-top: 0;
  color: var(--text-muted);
}

.inline-form {
  display: flex;
  gap: 0.6rem;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.auth-form button {
  margin-top: 0.45rem;
  width: fit-content;
}

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

.muted-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.muted-link a:hover {
  text-decoration: underline;
}

input,
button {
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  font: inherit;
}

input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

button {
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  color: #eafcf5;
  cursor: pointer;
  font-weight: 600;
}

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

#status {
  margin-top: 0.85rem;
  color: #7df0be;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
}

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

.chat-list {
  margin-top: 1rem;
}

.chat-row {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}

.chat-row:hover {
  border-color: var(--accent-dim);
}

.chat-row strong {
  color: var(--text);
}

.chat-row span {
  display: block;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.messages {
  min-height: 360px;
  max-height: 60vh;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.message {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  max-width: 85%;
}

.message.me {
  background: rgba(68, 183, 139, 0.18);
  border-color: var(--accent-dim);
  margin-left: auto;
}

.message p {
  margin: 0;
  color: var(--text);
}

.message small {
  color: var(--text-muted);
}
