/* 20261005-chat-ai — landing, login, activate AI support widget */

.live-chat {
  position: fixed;
  z-index: 9000;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  font-family: var(--font-gov-sans, "Public Sans", "Source Sans 3", sans-serif);
}

.live-chat__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.55rem 1rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #003256;
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 36, 64, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}

.live-chat__toggle:hover {
  background: #002440;
}

.live-chat__toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.live-chat__toggle-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
}

.live-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  display: none;
  flex-direction: column;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(420px, 70vh);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 36, 64, 0.18);
  overflow: hidden;
}

.live-chat__panel.is-open {
  display: flex;
}

.live-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #003256;
  color: #fff;
}

.live-chat__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.live-chat__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.live-chat__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.live-chat__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  background: #f0f4f7;
}

.live-chat__messages {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.live-chat__msg {
  max-width: 92%;
  padding: 0.55rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.live-chat__msg--agent {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #d1d5db;
  color: #1b1b1b;
}

.live-chat__msg--agent strong {
  font-weight: 700;
  color: #003256;
}

.live-chat__msg--user {
  align-self: flex-end;
  background: #003256;
  color: #fff;
}

.live-chat__msg--status {
  align-self: center;
  background: transparent;
  border: 0;
  color: #4b5563;
  font-size: 0.75rem;
  font-style: italic;
  padding: 0.25rem;
}

.live-chat__typing {
  padding: 0 0.75rem 0.35rem;
  font-size: 0.75rem;
  color: #4b5563;
  font-style: italic;
}

.live-chat__typing[hidden] {
  display: none !important;
}

.live-chat__composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid #d1d5db;
  background: #fff;
}

.live-chat__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  border: 2px solid #757575;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.875rem;
}

.live-chat__input:focus {
  outline: 2px solid #003256;
  outline-offset: 1px;
}

.live-chat__send {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border: 2px solid #003256;
  border-radius: 2px;
  background: #003256;
  color: #fff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.live-chat__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.live-chat__footer-note {
  margin: 0;
  padding: 0.45rem 0.75rem 0.65rem;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #4b5563;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.live-chat__footer-note a {
  color: #003256;
  font-weight: 600;
}

@media (max-width: 767px) {
  .live-chat {
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  }

  .live-chat__toggle {
    width: 100%;
    justify-content: center;
  }

  .live-chat__panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: min(78vh, 560px);
    border-radius: 12px 12px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .live-chat__messages {
    max-height: none;
    flex: 1 1 auto;
  }
}
