* { -webkit-font-smoothing: antialiased; }
body { background: #E6EAF1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.15s; }
.reveal-3 { animation-delay: 0.25s; }
.reveal-4 { animation-delay: 0.35s; }
.reveal-5 { animation-delay: 0.45s; }
@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.btn-primary {
  background-color: #0C65F0;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.btn-primary:hover { background-color: #0A54C7; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible {
  outline: 2px solid #0C65F0;
  outline-offset: 3px;
}

.nav-link {
  color: #283A70;
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #0C65F0;
  transition: width 0.2s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link:focus-visible {
  outline: 2px solid #0C65F0;
  outline-offset: 4px;
}
.nav-link-active { color: #0C65F0; }

.article-card {
  transition: border-color 0.2s ease;
}

/* ===== Chat widget ===== */
.pcx-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background-color: #0C65F0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  z-index: 70;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.pcx-chat-launcher:hover { background-color: #0A54C7; }
.pcx-chat-launcher:active { transform: scale(0.96); }
.pcx-chat-launcher:focus-visible {
  outline: 2px solid #0C65F0;
  outline-offset: 3px;
}
.pcx-chat-launcher.hidden { display: none; }

.pcx-chat-welcome {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid #E6EAF1;
  border-radius: 6px;
  padding: 18px;
  z-index: 65;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.pcx-chat-welcome.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.pcx-chat-welcome::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 26px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-right: 1px solid #E6EAF1;
  border-bottom: 1px solid #E6EAF1;
  transform: rotate(45deg);
}
.pcx-chat-welcome-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: #616A77;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.pcx-chat-welcome-close:hover { background-color: #F2F5FA; color: #283A70; }
.pcx-chat-welcome p {
  font-size: 14px;
  line-height: 1.6;
  color: #283A70;
  padding-right: 18px;
}

.pcx-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: min(480px, calc(100vh - 100px));
  background: #ffffff;
  border: 1px solid #E6EAF1;
  border-radius: 6px;
  z-index: 70;
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pcx-chat-panel.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.pcx-chat-header {
  background-color: #283A70;
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.pcx-chat-header p { font-size: 14px; font-weight: 600; }
.pcx-chat-header span { font-size: 12px; color: rgba(255,255,255,0.65); }
.pcx-chat-panel-close {
  border: none;
  background: none;
  color: #ffffff;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0.8;
}
.pcx-chat-panel-close:hover { opacity: 1; background-color: rgba(255,255,255,0.12); }

.pcx-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pcx-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.55;
}
.pcx-msg-bot {
  align-self: flex-start;
  background-color: #F2F5FA;
  color: #283A70;
}
.pcx-msg-user {
  align-self: flex-end;
  background-color: #0C65F0;
  color: #ffffff;
}
.pcx-msg a { color: #0C65F0; font-weight: 600; text-decoration: underline; }
.pcx-msg-bot a { color: #0C65F0; }
.pcx-msg-user a { color: #ffffff; }

.pcx-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #E6EAF1;
  flex-shrink: 0;
}
.pcx-chat-input {
  flex: 1;
  border: 1px solid #E6EAF1;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: #283A70;
  outline: none;
  transition: border-color 0.2s ease;
}
.pcx-chat-input:focus { border-color: #0C65F0; }
.pcx-chat-send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background-color: #0C65F0;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.pcx-chat-send:hover { background-color: #0A54C7; }

@media (max-width: 480px) {
  .pcx-chat-panel { bottom: 16px; right: 16px; left: 16px; width: auto; max-width: none; }
  .pcx-chat-welcome { right: 16px; bottom: 88px; }
  .pcx-chat-launcher { bottom: 16px; right: 16px; }
}
