/* MyBPO Chat - widget styles (brand: gold #be8c5c on dark #0f0f0f) */

#mybpo-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
#mybpo-chat-root *, #mybpo-chat-root *::before, #mybpo-chat-root *::after { box-sizing: border-box; }
#mybpo-chat-root [hidden] { display: none !important; }

/* ------- collapsed pill ------- */
.mybpo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid rgba(190, 140, 92, 0.55);
  border-radius: 999px;
  background: #0f0f0f;
  color: #F7F6F0;
  cursor: pointer;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
  font: inherit;
  position: relative;
}
.mybpo-pill:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(190, 140, 92, 0.35); }
.mybpo-pill svg { color: #be8c5c; flex: 0 0 auto; }
.mybpo-pill-hidden { display: none; }
.mybpo-badge {
  position: absolute;
  top: -6px; right: -4px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #be8c5c;
  color: #0f0f0f;
  font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ------- panel ------- */
.mybpo-panel {
  width: 350px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: #161616;
  border: 1px solid rgba(190, 140, 92, 0.35);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.55);
}

.mybpo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0f0f0f;
  border-bottom: 1px solid rgba(190, 140, 92, 0.3);
}
.mybpo-head-txt { display: flex; flex-direction: column; gap: 1px; }
.mybpo-head-txt strong {
  color: #be8c5c;
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px; letter-spacing: .04em;
}
.mybpo-status { color: #9aa3af; font-size: 12px; }
.mybpo-min {
  border: 0; background: none; color: #9aa3af;
  font-size: 16px; cursor: pointer; padding: 4px 8px; line-height: 1;
}
.mybpo-min:hover { color: #F7F6F0; }

/* ------- messages ------- */
.mybpo-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}
.mybpo-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; }
.mybpo-who { display: block; font-size: 11px; opacity: .65; margin-bottom: 2px; }
.mybpo-body { white-space: pre-wrap; word-wrap: break-word; }

.mybpo-msg-bot, .mybpo-msg-agent {
  align-self: flex-start;
  background: #232323;
  color: #F7F6F0;
  border-bottom-left-radius: 4px;
}
.mybpo-msg-agent { border-left: 2px solid #be8c5c; }
.mybpo-msg-lead {
  align-self: flex-end;
  background: #be8c5c;
  color: #0f0f0f;
  border-bottom-right-radius: 4px;
}
.mybpo-msg-lead .mybpo-who { color: rgba(15,15,15,.7); }
.mybpo-msg-system {
  align-self: center;
  background: none;
  color: #9aa3af;
  font-size: 12px;
  text-align: center;
  padding: 2px 8px;
}

.mybpo-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.mybpo-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #be8c5c; opacity: .5;
  animation: mybpo-blink 1.2s infinite;
}
.mybpo-typing span:nth-child(2) { animation-delay: .2s; }
.mybpo-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes mybpo-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ------- contact fallback form ------- */
.mybpo-contact {
  padding: 12px 14px;
  border-top: 1px solid rgba(190, 140, 92, 0.3);
  background: #1b1712;
  display: flex; flex-direction: column; gap: 8px;
}
.mybpo-contact-note { margin: 0; color: #e0bfa0; font-size: 12.5px; }
.mybpo-contact input {
  width: 100%; padding: 9px 12px;
  border-radius: 8px; border: 1px solid #3a3a3a;
  background: #0f0f0f; color: #F7F6F0; font: inherit;
}
.mybpo-contact input:focus { outline: none; border-color: #be8c5c; }

.mybpo-btn-gold {
  border: 0; border-radius: 8px;
  background: #be8c5c; color: #0f0f0f;
  padding: 9px 14px; font: inherit; font-weight: 600;
  cursor: pointer;
}
.mybpo-btn-gold:hover { background: #e0bfa0; }
.mybpo-restart { align-self: center; margin-top: 6px; }

/* ------- footer / input ------- */
.mybpo-foot {
  border-top: 1px solid rgba(190, 140, 92, 0.3);
  background: #0f0f0f;
  padding: 10px 12px 8px;
}
.mybpo-inputrow { display: flex; gap: 8px; }
.mybpo-input {
  flex: 1; padding: 10px 14px;
  border-radius: 999px; border: 1px solid #3a3a3a;
  background: #161616; color: #F7F6F0; font: inherit;
}
.mybpo-input::placeholder { color: #6b7280; }
.mybpo-input:focus { outline: none; border-color: #be8c5c; }
.mybpo-send {
  width: 40px; height: 40px; flex: 0 0 auto;
  border: 0; border-radius: 50%;
  background: #be8c5c; color: #0f0f0f;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mybpo-send:hover { background: #e0bfa0; }
.mybpo-human {
  display: block; margin: 8px auto 0;
  border: 0; background: none;
  color: #9aa3af; font-size: 12px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.mybpo-human:hover { color: #be8c5c; }

/* The chat pill owns the bottom-right corner, so shift Google's reCAPTCHA
   badge to the left edge where nothing else lives. Its built-in collapse
   animates the `right` property, so we recreate the same tuck on the left:
   mostly hidden, slides out on hover. */
.grecaptcha-badge {
  right: auto !important;
  left: -186px !important;
  transition: left 0.3s ease !important;
}
.grecaptcha-badge:hover { left: 0 !important; }

/* Pages with a fixed bottom bar (e.g. the cost calculator's mobile total bar)
   get the pill lifted above it - widget.js adds this class when it finds one. */
@media (max-width: 900px) {
  #mybpo-chat-root.mybpo-above-bar { bottom: 92px; }
}

/* ------- mobile ------- */
@media (max-width: 480px) {
  #mybpo-chat-root { right: 12px; bottom: 12px; }
  .mybpo-panel {
    position: fixed;
    right: 0; left: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: 65vh; max-height: 65vh;
    border-radius: 16px 16px 0 0;
  }
}
