@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #080b16;
  --panel: #121827;
  --panel2: #181f33;
  --primary: #6c5dd3;
  --secondary: #9d6cff;
  --accent: #ffb86b;
  --sun: #ffd884;
  --text: #f5f6fa;
  --muted: #8e92b3;
  --border: rgba(255, 255, 255, 0.06);
  --gradient: linear-gradient(90deg, #6c5dd3, #8d67f6, #ff6b9d, #ffb86b);
  --scene-gradient: radial-gradient(circle at top right, #34276f 0%, transparent 35%),
    linear-gradient(#080b16, #0d1020);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: var(--scene-gradient);
  color: var(--text);
}

.background {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(8, 11, 22, 0.45), rgba(8, 11, 22, 0.8)),
    url('/static/login-background.jpg') center / cover no-repeat;
  z-index: -1;
}

.hero-copy {
  position: fixed;
  left: 60px;
  bottom: 60px;
  max-width: 400px;
}

.hero-copy h1 {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero-copy p {
  font-size: 1.05rem;
  opacity: 0.75;
  line-height: 1.7;
}

.login {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  padding: 42px;
  border-radius: 24px;
  background: rgba(18, 24, 39, 0.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 8px;
}

.logo svg {
  width: 44px;
  height: 44px;
}

.logo .name {
  font-size: 1.7rem;
  font-weight: 600;
}

.tagline {
  text-align: center;
  margin-bottom: 26px;
  color: var(--muted);
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.field {
  position: relative;
  margin-bottom: 18px;
}

.field input {
  padding-left: 18px;
  padding-right: 44px;
  margin-bottom: 0;
}

.field .toggle-visibility {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  width: auto;
  height: auto;
  cursor: pointer;
  color: var(--muted);
}

.field .toggle-visibility svg {
  width: 18px;
  height: 18px;
  display: block;
}

input {
  width: 100%;
  height: 56px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0f1423;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: 0.2s;
}

input::placeholder {
  color: var(--muted);
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 93, 211, 0.18);
}

button {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  background: var(--gradient);
  transition: 0.25s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(108, 93, 211, 0.35);
}

.error {
  color: #ff6b9d;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-top: 12px;
  text-align: center;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.footer-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.footer-row input[type='checkbox'] {
  width: auto;
  height: auto;
}

.footer-row a {
  color: var(--secondary);
  text-decoration: none;
}

.footer-row a:hover {
  text-decoration: underline;
}

/* Chat page */

.chat-shell {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 640px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  background: rgba(18, 24, 39, 0.75);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

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

.chat-shell header .logo {
  margin-bottom: 0;
}

.chat-shell header .logo svg {
  width: 32px;
  height: 32px;
}

.chat-shell header .logo .name {
  font-size: 1.1rem;
}

.chat-shell header button {
  width: auto;
  height: auto;
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.chat-shell header button:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--primary);
  color: var(--text);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  max-width: 75%;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.95rem;
}

.msg.user {
  align-self: flex-end;
  background: var(--gradient);
}

.msg.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

#chat-form {
  display: flex;
  padding: 1rem;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  margin: 0;
}

#chat-form input {
  height: 48px;
  margin: 0;
}

#chat-form button {
  width: auto;
  height: 48px;
  padding: 0 1.4rem;
  margin: 0;
}

#chat-form button:hover {
  transform: none;
}
