:root {
  color-scheme: light;
  --bg: #edf2f8;
  --bg-accent: #d9e7ff;
  --panel: #ffffff;
  --text: #152033;
  --muted: #5b6b81;
  --border: #d5deea;
  --brand: #273b76;
  --brand-dark: #1b2b59;
  --brand-midnight: #18244d;
  --brand-soft: rgba(39, 59, 118, 0.12);
  --success: #0f7b4a;
  --error: #b42318;
  --shadow: 0 18px 50px rgba(21, 32, 51, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(11, 95, 255, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 123, 74, 0.08), transparent 22%),
    linear-gradient(180deg, #f7faff 0%, var(--bg) 48%, #e8eef6 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(213, 222, 234, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
}

.site-header__inner,
.site-main {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-header__link {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.site-header__link:hover {
  color: var(--brand-dark);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.site-header__logo {
  display: block;
  height: 1.35rem;
  width: auto;
}

.site-header__product,
.chat-intro__eyebrow,
.login-card__eyebrow {
  display: block;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header__title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.site-header__signout {
  appearance: none;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.site-header__signout:hover {
  border-color: #b8c7db;
  background: #f8fbff;
}

.site-main {
  padding: 2rem 0 3.5rem;
}

.chat-intro {
  margin-bottom: 1.25rem;
}

.chat-intro h1,
.login-card__title {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.chat-intro p,
.login-card__copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 42rem;
}

.chat-page {
  display: grid;
  gap: 1rem;
}

.chat-page__panel {
  background: var(--panel);
  border: 1px solid rgba(213, 222, 234, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}

.chat-page__examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.chat-page__chip {
  appearance: none;
  border: 1px solid var(--border);
  background: #f7faff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.chat-page__chip:hover:not(:disabled) {
  border-color: #9db7ef;
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.chat-page__chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-page__form {
  display: grid;
  gap: 0.8rem;
}

.chat-page__label-row,
.chat-page__answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-page__label,
.chat-page__answer-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.chat-page__hint,
.chat-page__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.chat-page__input {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.05rem;
  font: inherit;
  line-height: 1.55;
  background: #fbfcff;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.chat-page__input:focus {
  outline: none;
  border-color: var(--brand);
  background: white;
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.12);
}

.chat-page__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chat-page__button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.chat-page__button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.chat-page__button--primary {
  background: linear-gradient(180deg, #2f7bff, var(--brand));
  color: white;
  box-shadow: 0 10px 24px rgba(11, 95, 255, 0.22);
}

.chat-page__button--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #256fff, var(--brand-dark));
}

.chat-page__button--secondary {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.chat-page__button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.chat-page__status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 1.4rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.chat-page__status--error {
  color: var(--error);
}

.chat-page__status--success {
  color: var(--success);
}

.chat-page__pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(11, 95, 255, 0.45);
  animation: pulse 1.4s infinite;
}

.chat-page__answer-shell {
  position: relative;
  min-height: 14rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.9), rgba(255, 255, 255, 0.96));
  padding: 1rem 1.05rem;
}

.chat-page__answer {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
  font: inherit;
  color: var(--text);
}

.chat-page__answer--placeholder {
  color: var(--muted);
}

.chat-page__empty {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.chat-page__empty strong {
  color: var(--text);
  font-size: 1rem;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-shell {
  width: min(440px, 100%);
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.login-brand__logo {
  display: block;
  height: 1.5rem;
  width: auto;
}

.login-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(213, 222, 234, 0.95);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 1.7rem;
}

.login-card__form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.login-card__label {
  font-weight: 700;
}

.login-card__input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  background: #fbfcff;
}

.login-card__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.12);
  background: white;
}

.login-card__button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  margin-top: 0.35rem;
  font: inherit;
  font-weight: 700;
  color: white;
  cursor: pointer;
  background: linear-gradient(180deg, #2f7bff, var(--brand));
  box-shadow: 0 12px 28px rgba(11, 95, 255, 0.22);
}

.login-card__button:hover {
  background: linear-gradient(180deg, #256fff, var(--brand-dark));
}

.login-card__error,
.login-card__field-error {
  color: var(--error);
  font-size: 0.92rem;
}

.login-card__error {
  margin: 0;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(11, 95, 255, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(11, 95, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(11, 95, 255, 0);
  }
}

@media (max-width: 640px) {
  .site-main {
    padding-top: 1.35rem;
  }

  .chat-page__panel,
  .login-card {
    padding: 1.1rem;
    border-radius: 20px;
  }

  .chat-page__label-row,
  .chat-page__answer-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Assistant chat (ChatGPT/Grok-style) */
.assistant-body {
  min-height: 100vh;
  background: #f5f8fc;
  color: var(--brand-midnight);
}

.assistant-seo {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.assistant-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(11, 31, 58, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.assistant-topbar__inner {
  width: min(920px, calc(100% - 1.5rem));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.assistant-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.assistant-topbar__logo {
  display: block;
  height: 1.35rem;
  width: auto;
}

.assistant-topbar__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-midnight);
}

.assistant-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.assistant-topbar__link,
.assistant-topbar__signout {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.assistant-topbar__link:hover,
.assistant-topbar__signout:hover {
  color: var(--brand-dark);
}

.assistant-shell {
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.assistant-chat {
  width: min(820px, 100%);
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.assistant-chat__transcript {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem 1rem;
  scroll-behavior: smooth;
}

.assistant-chat__empty {
  min-height: 60%;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
}

.assistant-chat__eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-chat__greeting {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  color: var(--brand-midnight);
}

.assistant-chat__subtitle {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.6;
}

.assistant-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.assistant-chat__suggestion {
  appearance: none;
  border: 1px solid rgba(11, 31, 58, 0.12);
  background: white;
  color: var(--brand-midnight);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(11, 31, 58, 0.05);
}

.assistant-chat__suggestion:hover:not(:disabled) {
  border-color: rgba(0, 161, 255, 0.45);
  background: rgba(0, 161, 255, 0.06);
}

.assistant-chat__suggestion:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.assistant-chat__turn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.85rem;
  margin: 0 auto 1.25rem;
  max-width: 760px;
}

.assistant-chat__avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.assistant-chat__turn--user .assistant-chat__avatar {
  background: rgba(0, 161, 255, 0.12);
  color: var(--brand-dark);
}

.assistant-chat__turn--assistant .assistant-chat__avatar {
  background: var(--brand-midnight);
  color: white;
}

.assistant-chat__bubble {
  min-width: 0;
  padding-top: 0.35rem;
}

.assistant-chat__user-text {
  display: inline-block;
  max-width: 100%;
  background: rgba(0, 161, 255, 0.1);
  border: 1px solid rgba(0, 161, 255, 0.14);
  border-radius: 18px 18px 6px 18px;
  padding: 0.85rem 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.assistant-chat__markdown {
  color: var(--brand-midnight);
  line-height: 1.7;
}

.assistant-chat__markdown > :first-child {
  margin-top: 0;
}

.assistant-chat__markdown > :last-child {
  margin-bottom: 0;
}

.assistant-chat__markdown p,
.assistant-chat__markdown ul,
.assistant-chat__markdown ol,
.assistant-chat__markdown pre {
  margin: 0 0 0.9rem;
}

.assistant-chat__markdown ul,
.assistant-chat__markdown ol {
  padding-left: 1.25rem;
}

.assistant-chat__markdown a {
  color: var(--brand-dark);
  text-decoration: underline;
}

.assistant-chat__markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(11, 31, 58, 0.06);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.assistant-chat__markdown pre {
  overflow-x: auto;
  background: #0b1f3a;
  color: #e8f4ff;
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.assistant-chat__markdown pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.assistant-chat__markdown--streaming::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 1em;
  margin-left: 0.15rem;
  border-radius: 2px;
  background: var(--brand);
  vertical-align: text-bottom;
  animation: pulse 1.2s infinite;
}

.assistant-chat__typing {
  margin: 0;
  color: var(--muted);
}

.assistant-chat__error {
  margin: 0.65rem 0 0;
  color: var(--error);
  font-size: 0.92rem;
}

.assistant-chat__composer {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(245, 248, 252, 0), #f5f8fc 28%);
}

.assistant-chat__composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  border: 1px solid rgba(11, 31, 58, 0.1);
  background: white;
  border-radius: 22px;
  padding: 0.75rem 0.8rem;
  box-shadow: 0 16px 40px rgba(11, 31, 58, 0.08);
}

.assistant-chat__composer-input {
  width: 100%;
  border: 0;
  resize: none;
  max-height: 180px;
  min-height: 24px;
  padding: 0.45rem 0.35rem;
  font: inherit;
  line-height: 1.5;
  background: transparent;
  color: var(--brand-midnight);
}

.assistant-chat__composer-input:focus {
  outline: none;
}

.assistant-chat__composer-actions {
  display: flex;
  gap: 0.5rem;
}

.assistant-chat__send,
.assistant-chat__stop {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.assistant-chat__send {
  background: var(--brand);
  color: white;
}

.assistant-chat__send:hover:not(:disabled) {
  background: var(--brand-dark);
}

.assistant-chat__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.assistant-chat__stop {
  background: rgba(11, 31, 58, 0.08);
  color: var(--brand-midnight);
}

.assistant-chat__footnote {
  margin: 0.55rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .assistant-chat__turn {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.65rem;
  }

  .assistant-chat__avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.62rem;
  }

  .assistant-chat__composer-shell {
    grid-template-columns: 1fr;
  }

  .assistant-chat__composer-actions {
    justify-content: flex-end;
  }
}
