/* Eagle Load Desk — public web chat widget (no secrets) */

:root {
  --eagle-navy: #12335c;
  --eagle-gold: #c9a227;
  --eagle-panel: #ffffff;
  --eagle-text: #1a1a1a;
  --eagle-muted: #5c6b7a;
  --eagle-border: #d7dee6;
  --eagle-bot-bg: #eef3f8;
  --eagle-user-bg: #12335c;
}

.eagle-load-chat,
.eagle-load-chat * {
  box-sizing: border-box;
}

.eagle-load-chat {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--eagle-text);
  z-index: 2147483000;
}

.eagle-load-chat-bubble {
  position: fixed;
  right: 16px;
  bottom: 16px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  font-weight: 700;
  background: var(--eagle-navy);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(18, 51, 92, 0.35);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.eagle-load-chat-bubble:hover {
  background: #0e2747;
}

.eagle-load-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 120px));
  background: var(--eagle-panel);
  border: 1px solid var(--eagle-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(18, 51, 92, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.eagle-load-chat-panel[hidden] {
  display: none !important;
}

.eagle-load-chat-header {
  background: var(--eagle-navy);
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eagle-load-chat-header button {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.eagle-load-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f7f9fb;
}

.eagle-load-chat-msg {
  max-width: 90%;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.4;
}

.eagle-load-chat-msg.is-bot {
  background: var(--eagle-bot-bg);
  color: var(--eagle-text);
}

.eagle-load-chat-msg.is-user {
  background: var(--eagle-user-bg);
  color: #fff;
  margin-left: auto;
}

.eagle-load-chat-msg.is-error {
  background: #fdecea;
  color: #8a1f11;
}

.eagle-load-chat-actions {
  padding: 8px 10px 4px;
  background: #fff;
  border-top: 1px solid var(--eagle-border);
}

.eagle-load-chat-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #1f7a3a;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.eagle-load-chat-call:hover,
.eagle-load-chat-call:focus-visible {
  background: #17612e;
  color: #ffffff;
  outline: 2px solid var(--eagle-navy);
  outline-offset: 2px;
}

.eagle-load-chat-call-number {
  font-size: 13px;
  font-weight: 600;
}

.eagle-load-chat-call-row {
  margin: 0 0 10px;
}

.eagle-load-chat-call-prominent {
  width: 100%;
  box-shadow: 0 2px 8px rgba(31, 122, 58, 0.28);
}

.eagle-load-chat-footer {
  border-top: 1px solid var(--eagle-border);
  padding: 8px 12px 6px;
  font-size: 12px;
  color: var(--eagle-muted);
  text-align: center;
}

.eagle-load-chat-footer a.eagle-load-chat-footer-phone {
  color: var(--eagle-navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eagle-load-chat-composer {
  display: flex;
  gap: 8px;
  padding: 8px 10px 12px;
  border-top: 1px solid var(--eagle-border);
  background: #fff;
}

.eagle-load-chat-composer input {
  flex: 1;
  border: 1px solid var(--eagle-border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.eagle-load-chat-composer button {
  background: var(--eagle-gold);
  color: var(--eagle-navy);
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.eagle-load-chat-composer button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .eagle-load-chat-bubble {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    font-size: 22px;
    gap: 0;
  }

  .eagle-load-chat-bubble-text {
    display: none;
  }

  .eagle-load-chat-panel {
    right: 8px;
    left: 8px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(72vh, 560px);
  }

  .eagle-load-chat-call {
    min-height: 48px;
    font-size: 17px;
  }
}
