/* High Aims Live Chat — Safebot widget styles
   Brand: navy #002147, yellow #fdc800 (site palette) */

.halc-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
.halc-root, .halc-root * { box-sizing: border-box; }
.halc-hidden { display: none !important; }

/* online dot */
.halc-online-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 2px rgba(46, 204, 113, .3);
}

/* ── bubble + teaser ─────────────────────────── */
.halc-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  background: #002147;
  color: #fff;
  padding: 14px 20px;
  border-radius: 30px;
  box-shadow: 0 6px 24px rgba(0, 33, 71, .35);
  transition: transform .15s ease;
  position: relative;
}
.halc-bubble:hover { transform: scale(1.05); }
.halc-bubble-label { font-weight: 600; font-size: 15px; }
.halc-bubble-dot {
  position: absolute;
  top: 8px; left: 12px;
  width: 8px; height: 8px;
}

.halc-teaser {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: #fff;
  color: #002147;
  padding: 12px 34px 12px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  white-space: nowrap;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.halc-teaser-close {
  position: absolute;
  top: 4px; right: 6px;
  border: none;
  background: none;
  color: #999;
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

/* ── panel ───────────────────────────────────── */
.halc-panel {
  display: none;
  flex-direction: column;
  width: 360px;
  height: 540px;
  max-height: calc(100vh - 40px);
  background: #f5f6f8;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .28);
}
.halc-panel.halc-open { display: flex; }

.halc-header {
  background: #002147;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.halc-header-info { display: flex; align-items: center; gap: 10px; }
.halc-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fdc800;
  color: #002147;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.halc-title { font-weight: 700; font-size: 15px; }
.halc-status { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.halc-header-btns { display: flex; gap: 6px; }
.halc-min,
.halc-close {
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.halc-min:hover { background: rgba(255, 255, 255, .25); }
.halc-close:hover { background: #e74c3c; }

.halc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── pre-chat form ───────────────────────────── */
.halc-form {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.halc-form-intro { margin: 0 0 4px; color: #333; }
.halc-form input,
.halc-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d4d9e0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #222;
}
.halc-form input:focus,
.halc-form select:focus {
  outline: none;
  border-color: #002147;
  box-shadow: 0 0 0 2px rgba(0, 33, 71, .12);
}
.halc-start {
  margin-top: 6px;
  background: #fdc800;
  color: #002147;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: filter .15s;
}
.halc-start:hover { filter: brightness(1.06); }

/* ── messages ────────────────────────────────── */
.halc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.halc-msg { max-width: 82%; display: flex; flex-direction: column; }
.halc-msg-user { align-self: flex-end; align-items: flex-end; }
.halc-msg-bot { align-self: flex-start; align-items: flex-start; }
.halc-msg-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  word-wrap: break-word;
  white-space: pre-line;
}
.halc-msg-user .halc-msg-bubble {
  background: #002147;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.halc-msg-bot .halc-msg-bubble {
  background: #fff;
  color: #222;
  border: 1px solid #e4e7ec;
  border-bottom-left-radius: 4px;
}
.halc-msg-bubble a {
  color: #004bff;
  text-decoration: underline;
  word-break: break-all;
}
.halc-msg-user .halc-msg-bubble a { color: #fdc800; }
.halc-msg-time {
  font-size: 10.5px;
  color: #98a1ad;
  margin-top: 3px;
  padding: 0 4px;
}

/* typing indicator */
.halc-typing .halc-msg-bubble {
  display: flex;
  gap: 4px;
  padding: 13px 15px;
}
.halc-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #b9c1cc;
  animation: halc-blink 1.2s infinite both;
}
.halc-typing span:nth-child(2) { animation-delay: .2s; }
.halc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes halc-blink {
  0%, 80%, 100% { opacity: .25; }
  40% { opacity: 1; }
}

/* ── input bar ───────────────────────────────── */
.halc-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e4e7ec;
  flex-shrink: 0;
}
.halc-input {
  flex: 1;
  border: 1px solid #d4d9e0;
  border-radius: 22px;
  padding: 10px 15px;
  font-size: 14px;
  color: #222;
}
.halc-input:focus {
  outline: none;
  border-color: #002147;
}
.halc-send {
  border: none;
  background: #002147;
  color: #fdc800;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.halc-send:hover { filter: brightness(1.2); }

.halc-footer {
  text-align: center;
  font-size: 10.5px;
  color: #9aa3ae;
  padding: 6px;
  background: #f5f6f8;
  flex-shrink: 0;
}

/* ── mobile ──────────────────────────────────── */
@media (max-width: 480px) {
  .halc-root { right: 10px; bottom: 10px; }
  .halc-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 80px);
    border-radius: 14px;
  }
  .halc-teaser { display: none; }
}
