:root {
  --bg-1: #081224;
  --bg-2: #0a2238;
  --accent: #12d6c8;
  --accent-strong: #00f5d4;
  --warm: #ff8a3d;
  --text: #ecf7ff;
  --muted: #9bc0d8;
  --card: rgba(10, 28, 49, 0.72);
  --stroke: rgba(255, 255, 255, 0.16);
  --danger: #ff5f6d;
  --ok: #5cff9d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(18, 214, 200, 0.2), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(255, 138, 61, 0.16), transparent 35%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
  opacity: 0.35;
  pointer-events: none;
  animation: drift 18s linear infinite;
}

@keyframes drift {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(28px);
  }
}

.layout-center {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  padding: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: fade-up 0.6s ease;
}

.brand-logo {
  display: block;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.brand-logo-login {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}

h1 {
  margin: 10px 0 8px;
  line-height: 1.2;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
}

form {
  display: grid;
  gap: 10px;
}

label {
  font-size: 0.92rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(4, 13, 24, 0.68);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.18);
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-primary {
  margin-top: 6px;
  background: linear-gradient(120deg, var(--accent), #02b9d5);
  color: #04121c;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.error {
  min-height: 1.1em;
  margin: 2px 0 0;
  font-size: 0.92rem;
  color: var(--danger);
}

.hint-box {
  margin-top: 20px;
  display: grid;
  gap: 4px;
  background: rgba(18, 214, 200, 0.1);
  border: 1px solid rgba(18, 214, 200, 0.35);
  border-radius: 12px;
  padding: 12px;
  color: #d9fff8;
  font-size: 0.92rem;
}

.assistant-page {
  position: relative;
  min-height: 100dvh;
  padding: 20px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px auto 16px;
  max-width: 1280px;
  padding: 18px;
  background: rgba(5, 16, 30, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  animation: fade-up 0.55s ease;
}

.topbar h1 {
  margin: 8px 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-topbar {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.assistant-shell {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: calc(100dvh - 148px);
}

.info-panel,
.chat-panel {
  background: rgba(7, 22, 40, 0.75);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  backdrop-filter: blur(8px);
}

.info-panel {
  padding: 18px;
  animation: fade-up 0.65s ease;
}

.info-panel p,
.info-panel li {
  color: var(--muted);
}

.info-panel ul {
  padding-left: 18px;
  margin: 10px 0 16px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d6ffee;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(92, 255, 157, 0.16);
  border: 1px solid rgba(92, 255, 157, 0.45);
}

.chat-panel {
  overflow: hidden;
  min-height: 72dvh;
  animation: fade-up 0.75s ease;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.chat-header p {
  margin: 0;
  color: #d7f2ff;
  font-weight: 500;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.chat-embed-wrap {
  height: calc(72dvh - 52px);
  min-height: 480px;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #071321;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .assistant-page {
    padding: 12px;
  }

  .topbar {
    margin-bottom: 10px;
    padding: 14px;
  }

  .assistant-shell {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: calc(100dvh - 170px);
  }

  .info-panel {
    order: 2;
  }

  .chat-panel {
    min-height: 0;
    height: 100%;
  }

  .chat-embed-wrap {
    min-height: 0;
    height: clamp(420px, calc(100dvh - 240px), 78dvh);
  }
}

@media (max-width: 620px) {
  .assistant-page {
    padding: 10px;
  }

  .login-card {
    padding: 20px;
    border-radius: 18px;
  }

  .brand-logo-login {
    width: 66px;
    height: 66px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .topbar-brand {
    align-items: flex-start;
  }

  .brand-logo-topbar {
    width: 50px;
    height: 50px;
  }

  .btn-secondary {
    width: 100%;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .chat-embed-wrap {
    height: clamp(460px, calc(100dvh - 205px), 82dvh);
  }
}
