:root {
  --bg-1: #07111f;
  --bg-2: #0f1f3a;
  --bg-3: #1d2f59;
  --glass: rgba(255,255,255,0.1);
  --glass-2: rgba(255,255,255,0.16);
  --line: rgba(255,255,255,0.12);
  --text: #e9f0ff;
  --muted: #a9b7d6;
  --dark: #0f172a;
  --light-panel: rgba(255,255,255,0.88);
  --primary: #6d5efc;
  --primary-2: #3ea8ff;
  --success: #39d98a;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(62,168,255,0.20), transparent 0 28%),
    radial-gradient(circle at 85% 15%, rgba(109,94,252,0.28), transparent 0 22%),
    radial-gradient(circle at 50% 85%, rgba(57,217,138,0.12), transparent 0 20%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  color: var(--text);
}

body {
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 700;
}

.login-layout {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: center;
}

.login-hero {
  padding: 20px 10px 20px 10px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: #dce7ff;
  border-radius: 999px;
  padding: 10px 14px;
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
}

.login-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.login-hero p {
  font-size: 1.12rem;
  max-width: 680px;
  color: #d3def7;
  line-height: 1.7;
  margin-bottom: 26px;
}

.hero-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-card {
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  color: #eff5ff;
  font-weight: 600;
}

.login-panel {
  display: flex;
  justify-content: center;
}

.glass-card {
  width: 100%;
  max-width: 480px;
  border-radius: 28px;
  padding: 30px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 80px rgba(0,0,0,0.28);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup h2 {
  margin: 0;
  font-size: 1.7rem;
  color: white;
}

.brand-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 14px 30px rgba(62,168,255,0.25);
}

.form-label {
  color: #edf3ff;
  font-weight: 600;
}

.form-control {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.10);
  color: white;
  padding: 15px 18px;
  box-shadow: none !important;
}

.form-control::placeholder {
  color: #c8d4ef;
}

.form-control:focus {
  background: rgba(255,255,255,0.14);
  border-color: rgba(62,168,255,0.8);
  color: white;
}

.btn-agent {
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-weight: 700;
  box-shadow: 0 16px 35px rgba(87,113,255,0.28);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn-agent:hover {
  transform: translateY(-1px);
  color: white;
  box-shadow: 0 20px 40px rgba(87,113,255,0.36);
}

.login-hint {
  margin-top: 16px;
  color: #dce5fb;
  text-align: center;
}

.app-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  min-height: calc(100vh - 48px);
}

.sidebar-panel,
.chat-panel {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}

.sidebar-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.agent-avatar {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(109,94,252,0.85), rgba(62,168,255,0.85));
  font-size: 1.45rem;
  box-shadow: 0 14px 30px rgba(62,168,255,0.2);
}

.sidebar-title {
  margin: 2px 0 0;
  font-size: 1.2rem;
  color: white;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-label {
  color: #dce7ff;
  font-size: .92rem;
  font-weight: 700;
}

.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.capability-chip,
.suggestion-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: #eef4ff;
  border-radius: 16px;
  padding: 11px 14px;
  font-size: .95rem;
  transition: all .15s ease;
}

.suggestion-btn {
  text-align: left;
  width: 100%;
  cursor: pointer;
  font-weight: 600;
}

.suggestion-btn:hover,
.capability-chip:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.suggestion-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 6px 6px 18px;
}

.chat-title {
  margin: 2px 0 0;
  font-size: 1.6rem;
  color: white;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  font-weight: 700;
  color: #e8f7ef;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(57,217,138,0.15);
}

.chat-suggestions-mobile {
  display: none;
  gap: 10px;
  overflow-x: auto;
  padding: 0 2px 14px;
}

.chat-suggestions-mobile .suggestion-btn {
  width: auto;
  white-space: nowrap;
  flex: 0 0 auto;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(244,247,255,0.88));
  color: var(--dark);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  min-height: 420px;
}

.message-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  align-items: flex-end;
}

.assistant-row {
  justify-content: flex-start;
}

.user-row {
  justify-content: flex-end;
}

.bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  flex: 0 0 36px;
  box-shadow: 0 12px 24px rgba(87,113,255,0.22);
}

.message-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(78%, 760px);
}

.user-wrap {
  align-items: flex-end;
}

.assistant-wrap {
  align-items: flex-start;
}

.message-meta {
  font-size: .78rem;
  color: #64748b;
  font-weight: 700;
  padding: 0 6px;
}

.message-bubble {
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.6;
  box-shadow: 0 14px 28px rgba(15,23,42,0.08);
  word-break: break-word;
  white-space: normal;
}

.assistant-bubble {
  background: white;
  color: #0f172a;
  border: 1px solid #e8edf8;
  border-bottom-left-radius: 8px;
}

.user-bubble {
  background: linear-gradient(135deg, #5b5efc, #329dff);
  color: white;
  border-bottom-right-radius: 8px;
}

.typing-bubble {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 70px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: .15s;
}

.typing-dot:nth-child(3) {
  animation-delay: .3s;
}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .55; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.composer {
  padding-top: 16px;
}

.composer-shell {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
}

.composer-input {
  flex: 1;
  resize: none;
  max-height: 180px;
  min-height: 54px;
  border: none;
  outline: none;
  background: transparent;
  color: white;
  font: inherit;
  padding: 12px 10px 10px 12px;
  line-height: 1.5;
}

.composer-input::placeholder {
  color: #c6d4f1;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.composer-icon-btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: white;
  cursor: pointer;
  transition: all .15s ease;
}

.composer-icon-btn:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.composer-send {
  padding: 13px 18px;
  border-radius: 16px;
}

.composer-hint {
  color: #c6d4f1;
  font-size: .84rem;
  margin-top: 10px;
  padding-left: 4px;
}

.btn-outline-light,
.btn-light {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
}

.alert-danger {
  border-radius: 16px;
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    display: none;
  }

  .chat-suggestions-mobile {
    display: flex;
  }
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .login-hero {
    padding: 10px 0;
  }

  .glass-card {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px;
  }

  .chat-panel {
    padding: 12px;
    border-radius: 22px;
  }

  .chat-window {
    padding: 14px;
    min-height: 360px;
  }

  .message-wrap {
    max-width: 88%;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .composer-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-actions {
    justify-content: space-between;
  }

  .composer-icon-btn,
  .composer-send {
    width: 100%;
  }
}
