/* ============================================================
   BenefitCorp Chat Widget
   Professional benefits consulting — navy/gold palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:wght@600&display=swap');

/* ── CSS Variables ── */
:root {
  --bc-navy: #05476e;
  --bc-navy-light: #00a0d5;
  --bc-navy-hover: #022031;
  --bc-gold: #00a0d5;
  --bc-gold-light: #e7f5fe;
  --bc-white: #ffffff;
  --bc-gray-50: #e7f5fe;
  --bc-gray-100: #eef1f5;
  --bc-gray-200: #dde2ea;
  --bc-gray-400: #94a3b8;
  --bc-gray-600: #5a6a7e;
  --bc-gray-800: #2d3748;
  --bc-red: #dc3545;
  --bc-shadow: 0 8px 32px rgba(15, 43, 74, 0.18);
  --bc-shadow-lg: 0 16px 48px rgba(15, 43, 74, 0.25);
  --bc-radius: 12px;
  --bc-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --bc-font-display: 'Playfair Display', Georgia, serif;
}

/* ── Floating Button ── */
.bc-chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bc-navy);
  border: none;
  cursor: pointer;
  box-shadow: var(--bc-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  z-index: 99998;
  outline: none;
}

.bc-chat-button:hover {
  transform: scale(1.08);
  box-shadow: var(--bc-shadow-lg);
  background: var(--bc-navy-light);
}

.bc-chat-button:active {
  transform: scale(0.96);
}

.bc-chat-button svg {
  width: 28px;
  height: 28px;
  fill: var(--bc-white);
  transition: transform 0.3s ease;
}

.bc-chat-button.bc-open svg {
  transform: rotate(90deg) scale(0.8);
}

/* Notification dot */
.bc-chat-button::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  background: var(--bc-gold);
  border-radius: 50%;
  border: 2px solid var(--bc-white);
  animation: bc-pulse 2s ease-in-out infinite;
}

.bc-chat-button.bc-open::after {
  display: none;
}

@keyframes bc-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ── Chat Panel ── */
.bc-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--bc-white);
  border-radius: var(--bc-radius);
  box-shadow: var(--bc-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bc-chat-panel.bc-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header ── */
.bc-chat-header {
  background: var(--bc-navy);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.bc-chat-header-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.bc-chat-header-icon {
  width: 51px;
  height: 60px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.bc-chat-header-icon img {
  height: 60px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.bc-chat-header-text h3 {
  margin: 0;
  font-family: var(--bc-font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--bc-white);
  letter-spacing: 0.01em;
  text-align: center;
}

.bc-chat-header-text p {
  margin: 3px 0 0;
  font-family: var(--bc-font);
  font-size: 12px;
  color: var(--bc-white);
  letter-spacing: 0.02em;
  text-align: center;
}

.bc-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.bc-chat-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.bc-chat-close svg {
  width: 18px;
  height: 18px;
  fill: var(--bc-gray-200);
}

/* ── Pre-Chat Form ── */
.bc-prechat {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  gap: 16px;
}

.bc-prechat h4 {
  margin: 0;
  font-family: var(--bc-font-display);
  font-size: 18px;
  color: var(--bc-navy);
  text-align: center;
}

.bc-prechat p {
  margin: 0;
  font-family: var(--bc-font);
  font-size: 13px;
  color: var(--bc-gray-600);
  text-align: center;
  line-height: 1.5;
}

.bc-prechat-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bc-prechat-field label {
  font-family: var(--bc-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--bc-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bc-prechat-field input {
  font-family: var(--bc-font);
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid var(--bc-gray-200);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--bc-gray-800);
}

.bc-prechat-field input:focus {
  border-color: var(--bc-navy-light);
  box-shadow: 0 0 0 3px rgba(26, 61, 107, 0.1);
}

.bc-prechat-field input::placeholder {
  color: var(--bc-gray-400);
}

.bc-prechat-field input.bc-error {
  border-color: var(--bc-red);
}

.bc-prechat-submit {
  font-family: var(--bc-font);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--bc-navy);
  color: var(--bc-white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-top: 4px;
}

.bc-prechat-submit:hover {
  background: var(--bc-navy-light);
}

.bc-prechat-submit:active {
  transform: scale(0.98);
}

/* ── Messages Area ── */
.bc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.bc-messages::-webkit-scrollbar {
  width: 4px;
}

.bc-messages::-webkit-scrollbar-thumb {
  background: var(--bc-gray-200);
  border-radius: 2px;
}

/* Message bubbles */
.bc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--bc-font);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--bc-gray-800);
  animation: bc-fadeIn 0.2s ease;
}

@keyframes bc-fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.bc-msg-user {
  align-self: flex-end;
  background: var(--bc-navy);
  color: var(--bc-white);
  border-bottom-right-radius: 4px;
}

.bc-msg-bot {
  align-self: flex-start;
  background: var(--bc-gray-50);
  border: 1px solid var(--bc-gray-100);
  border-bottom-left-radius: 4px;
  color: #1a2b3c;
}

/* Typing indicator */
.bc-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bc-gray-50);
  border: 1px solid var(--bc-gray-100);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.bc-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--bc-gray-400);
  border-radius: 50%;
  animation: bc-typingBounce 1.4s ease-in-out infinite;
}

.bc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bc-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bc-typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ── Input Area ── */
.bc-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--bc-gray-100);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.bc-input-area textarea {
  flex: 1;
  font-family: var(--bc-font);
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid var(--bc-gray-200);
  border-radius: 10px;
  outline: none;
  resize: none;
  min-height: 20px;
  max-height: 80px;
  line-height: 1.4;
  transition: border-color 0.15s ease;
  color: var(--bc-gray-800);
}

.bc-input-area textarea:focus {
  border-color: var(--bc-navy-light);
}

.bc-input-area textarea::placeholder {
  color: var(--bc-gray-400);
}

.bc-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bc-navy);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.bc-send-btn:hover {
  background: var(--bc-navy-light);
}

.bc-send-btn:active {
  transform: scale(0.94);
}

.bc-send-btn:disabled {
  background: var(--bc-gray-200);
  cursor: not-allowed;
}

.bc-send-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--bc-white);
}

/* ── Footer ── */
.bc-footer {
  padding: 8px 16px;
  text-align: center;
  font-family: var(--bc-font);
  font-size: 10px;
  color: var(--bc-gray-400);
  border-top: 1px solid var(--bc-gray-100);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Mobile Responsive ── */
@media (max-width: 500px) {
  .bc-chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .bc-chat-button {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}

/* ── Homepage Featured Services — Mobile Fix ── */
@media (max-width: 768px) {
  #brxe-fhyvkl {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: unset !important;
  }
  #brxe-hwnwtd { grid-column: 1 / -1 !important; grid-row: 1 !important; }
  #brxe-jrlfwd { grid-column: 1 !important; grid-row: 2 !important; }
  #brxe-iniyyr { grid-column: 2 !important; grid-row: 2 !important; }
  #brxe-imsdrc { grid-column: 1 !important; grid-row: 3 !important; }
  #brxe-mpiicn { grid-column: 2 !important; grid-row: 3 !important; }
}

/* ── Mobile Image Float Fix (all content pages) ── */
@media (max-width: 768px) {
  .alignright, .alignleft, .aligncenter,
  .wp-block-image img,
  .entry-content img,
  .post-content img,
  article img,
  .page-content img {
    float: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 0 16px 0 !important;
  }
}
/* ── Bricks mobile nav above chat widget ── */
#brxe-orypes,
#brxe-lvrhht,
#brxe-dsurzg,
#brxe-jtwzor,
#brxe-elimmg,
#brxe-wrvwrb,
.bricks-nav-menu-wrapper,
.brx-submenu,
.bricks-mobile-menu-toggle,
.bricks-nav-menu {
  z-index: 999999 !important;
}