/* Lanitum chat — design system aligned with lanitum.ai */

:root {
  --bg: #080808;
  --surface: rgb(255 255 255 / 0.025);
  --surface-strong: #0d0d0d;
  --text: #ffffff;
  --text-soft: rgb(255 255 255 / 0.55);
  --text-muted: rgb(255 255 255 / 0.45);
  --text-dim: rgb(255 255 255 / 0.30);
  --border: rgb(255 255 255 / 0.07);
  --border-strong: rgb(255 255 255 / 0.12);
  --border-focus: rgb(255 255 255 / 0.30);
  --user-bg: rgb(255 255 255 / 0.06);
  --user-border: rgb(255 255 255 / 0.12);
  --assistant-bg: transparent;
  --error: #ff8a8a;
  --ok: #ffffff;
  --radius: 4px;
  --radius-lg: 8px;
  --gap: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
}
button { cursor: pointer; }

input, textarea {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  background: rgb(255 255 255 / 0.04);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
input:focus, textarea:focus {
  border-color: var(--border-focus);
}
input::placeholder, textarea::placeholder {
  color: rgb(255 255 255 / 0.20);
}

select {
  font: inherit;
  padding: 8px 10px;
  background: transparent;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Buttons - Lanitum style: primary = white solid, secondary = outline ghost */
.btn,
button[type="submit"],
#send {
  padding: 13px 30px;
  background: #ffffff;
  color: #080808;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-family: inherit;
  transition: opacity 0.2s;
}
.btn:hover,
button[type="submit"]:hover,
#send:hover {
  opacity: 0.85;
}
.btn:disabled,
button:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-ghost,
#wake, #logout, #stop {
  padding: 9px 18px;
  background: transparent;
  border: 0.5px solid rgb(255 255 255 / 0.25);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.btn-ghost:hover,
#wake:hover, #logout:hover, #stop:hover {
  background: #ffffff;
  color: #080808;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 0.5px solid var(--border);
  background: rgb(8 8 8 / 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-shrink: 0;
}

.status {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.status::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status.up { color: var(--text); }
.status.up::before { background: #ffffff; }
.status.down { color: var(--text-dim); }
.status.down::before { background: rgb(255 100 100 / 0.6); }

/* Login */
.login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login form {
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: min(420px, 100%);
}
.login-mark {
  width: 56px;
  height: 56px;
  align-self: center;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.login h1 {
  margin: 0 0 1rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--text-dim);
  text-transform: uppercase;
}
.error {
  font-size: 12px;
  color: var(--error);
  letter-spacing: 0.04em;
}

/* Chat */
main#chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.msg {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.75;
  font-size: 14px;
  max-width: 86%;
}
.msg.user {
  align-self: flex-end;
  background: var(--user-bg);
  border: 0.5px solid var(--user-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
}
.msg.assistant {
  align-self: stretch;
  color: var(--text-soft);
  border-left: 0.5px solid var(--border-strong);
  padding: 4px 0 4px 1.25rem;
  max-width: none;
}
.msg.error {
  color: var(--error);
  border-left-color: var(--error);
  align-self: stretch;
}

.composer {
  display: flex;
  gap: 10px;
  padding: 1rem 2rem 1.5rem;
  border-top: 0.5px solid var(--border);
  background: rgb(8 8 8 / 0.9);
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}
.composer textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 220px;
  font-size: 14px;
  line-height: 1.5;
}
.composer #send {
  align-self: stretch;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 700px) {
  header { padding: 0.85rem 1rem; }
  .header-controls { gap: 8px; }
  .header-controls select { display: none; }
  .header-controls .status { display: none; }
  #wake, #logout, #stop { padding: 7px 14px; font-size: 10px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-name { font-size: 12px; letter-spacing: 0.14em; }
  .messages { padding: 1.25rem 1rem 0.5rem; gap: 1rem; }
  .composer { padding: 0.75rem 1rem 1rem; }
  .composer textarea { font-size: 16px; } /* prevents iOS zoom */
  .login form { padding: 2rem 1.5rem; }
}
