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

:root {
  --bg: #080b12;
  --panel: #101625;
  --panel-2: #151d30;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f7fb;
  --muted: #a7b0c4;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --danger: #ff6b6b;
  --success: #5eead4;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.22), transparent 36rem),
    radial-gradient(circle at bottom right, rgba(34, 211, 238, 0.16), transparent 34rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 480px);
}

.login-card,
.sidebar,
.chat-panel {
  border: 1px solid var(--line);
  background: rgba(16, 22, 37, 0.78);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.login-card {
  padding: 34px;
  border-radius: var(--radius);
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.95;
  margin: 0 0 16px;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  margin: 0 0 16px;
}

.login-description,
.sidebar-description,
.chat-header p,
.start-card p {
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

input {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}

input:focus {
  border-color: rgba(124, 92, 255, 0.7);
}

.login-form button,
.start-card button,
.message-composer button,
.logout-btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #5236d9);
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 800;
}

.feedback {
  min-height: 22px;
  color: var(--success);
  margin: 0;
}

.feedback.error,
.message.error {
  color: var(--danger);
}

.demo-access {
  display: grid;
  gap: 4px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.demo-access strong {
  color: var(--text);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  padding: 22px;
  overflow: hidden;
}

.sidebar {
  min-height: 0;
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.metrics {
  display: grid;
  gap: 12px;
}

.metrics article {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.metrics span {
  font-size: 1.45rem;
  font-weight: 800;
}

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

.logout-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.chat-panel {
  height: calc(100vh - 44px);
  min-height: 0;
  border-radius: var(--radius);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.chat-header {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.chat-header strong {
  font-size: 1.15rem;
}

.chat-header p {
  margin: 5px 0 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 18px var(--success);
  margin-right: 8px;
}

.start-screen {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow-y: auto;
}

.start-card {
  width: min(100%, 620px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.08)),
    rgba(255, 255, 255, 0.045);
}

.start-card button {
  margin-top: 14px;
}

.chat-window {
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.message {
  width: fit-content;
  max-width: min(780px, 90%);
  padding: 15px 16px;
  border-radius: 18px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(34, 211, 238, 0.65));
  border-bottom-right-radius: 6px;
  font-weight: 700;
}

.message.system {
  align-self: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  text-align: center;
}

.message pre,
.menu-list {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Inter", system-ui, sans-serif;
}

.menu-list strong {
  color: var(--accent-2);
}

.message-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(8, 11, 18, 0.72);
}

.message-composer input {
  border-radius: 999px;
  padding: 15px 18px;
}

.message-composer button {
  min-width: 98px;
  border-radius: 999px;
}

.product-grid {
  display: grid;
  gap: 12px;
  width: min(760px, 100%);
}

.product-card,
.summary-card {
  padding: 15px;
  border-radius: 16px;
  background: rgba(8, 11, 18, 0.5);
  border: 1px solid var(--line);
}

.product-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.product-card strong,
.summary-card strong {
  font-size: 1rem;
}

.product-card span {
  color: var(--accent-2);
  font-weight: 800;
}

.product-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.product-card b {
  color: var(--text);
}

.summary-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    min-height: auto;
  }

  .chat-panel {
    height: 72vh;
    min-height: 620px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  .login-card,
  .sidebar,
  .chat-header,
  .chat-window,
  .start-card {
    padding: 18px;
  }

  .message {
    max-width: 100%;
  }

  .message-composer {
    grid-template-columns: 1fr;
  }

  .message-composer button {
    width: 100%;
  }
}
