/* Instant Money Mortgage — "Chat with Natalie" website widget (v1).
   Placement rules: bottom-LEFT (UserWay owns bottom-right), above the mobile
   .mbar, below the cookie banner (z 200) and mobile nav. Hidden until the
   widget JS releases it (homepage: only after the scroll journey completes). */
.imm-chat { position: fixed; left: 24px; bottom: 24px; z-index: 80; font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif; color: #14213d; }
.imm-chat[hidden] { display: none !important; }
body.nav-open .imm-chat { display: none !important; }

.imm-chat-bubble {
  display: inline-flex; align-items: center; gap: 9px;
  background: #065db5; color: #fff; border: 0; cursor: pointer;
  font: 600 15px/1 Figtree, system-ui, sans-serif;
  padding: 14px 20px 14px 16px; border-radius: 999px;
  box-shadow: 0 10px 28px rgba(6, 43, 86, .35);
}
.imm-chat-bubble:hover { background: #1557b0; }
.imm-chat-bubble:focus-visible { outline: 3px solid #9ec7f5; outline-offset: 2px; }
.imm-chat-bubble .imm-chat-dot { width: 9px; height: 9px; border-radius: 50%; background: #57e6a9; flex: none; }
.imm-chat-bubble svg { flex: none; }

.imm-chat-panel {
  position: absolute; left: 0; bottom: 64px;
  width: min(380px, calc(100vw - 28px));
  height: min(600px, calc(100dvh - 190px));
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #d7e3f2; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(10, 35, 66, .30); overflow: hidden;
}
.imm-chat-panel[hidden] { display: none !important; }

.imm-chat-head {
  background: #14213d; color: #fff; padding: 13px 16px;
  display: flex; align-items: center; gap: 11px; flex: none;
}
.imm-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: #065db5; color: #fff; display: grid; place-items: center;
  font: 700 17px/1 Figtree, sans-serif;
}
.imm-chat-head .imm-chat-who { flex: 1; min-width: 0; }
.imm-chat-head .imm-chat-name { font-weight: 700; font-size: 16px; line-height: 1.15; }
.imm-chat-head .imm-chat-role { font-size: 12.5px; opacity: .82; line-height: 1.25; }
.imm-chat-call {
  color: #fff; text-decoration: none; font: 600 13px/1 Figtree, sans-serif;
  border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 8px 12px; flex: none;
}
.imm-chat-call:hover { background: rgba(255,255,255,.12); }
.imm-chat-close {
  background: none; border: 0; color: #fff; cursor: pointer; flex: none;
  font-size: 22px; line-height: 1; padding: 4px 2px; opacity: .9;
}

.imm-chat-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; background: #f4f8fd; }
.imm-chat-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; margin: 0 0 9px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.imm-chat-msg.natalie { background: #fff; border: 1px solid #dbe7f5; border-bottom-left-radius: 5px; margin-right: auto; }
.imm-chat-msg.visitor { background: #065db5; color: #fff; border-bottom-right-radius: 5px; margin-left: auto; }
.imm-chat-msg a { color: inherit; }

.imm-chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 14px 10px; background: #f4f8fd; }
.imm-chat-chip {
  background: #fff; border: 1px solid #b9d2ee; color: #065db5; cursor: pointer;
  font: 600 13px/1 Figtree, sans-serif; padding: 8px 12px; border-radius: 999px;
}
.imm-chat-chip:hover { background: #eaf3fe; }

.imm-chat-card {
  background: #fff; border: 1px solid #b9d2ee; border-radius: 14px;
  padding: 14px; margin: 2px 0 10px;
}
.imm-chat-card h4 { margin: 0 0 4px; font-size: 15px; }
.imm-chat-card p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; color: #3c4c63; }
.imm-chat-card label.f { display: block; font-size: 12.5px; font-weight: 600; margin: 0 0 8px; }
.imm-chat-card input[type="text"], .imm-chat-card input[type="email"], .imm-chat-card input[type="tel"], .imm-chat-card textarea {
  width: 100%; box-sizing: border-box; margin-top: 4px;
  border: 1px solid #c3d5ec; border-radius: 9px; padding: 10px 11px;
  font: 400 16px/1.3 Figtree, system-ui, sans-serif; background: #fff; color: #14213d;
}
.imm-chat-card textarea { resize: vertical; min-height: 52px; }
.imm-chat-card .consent { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; line-height: 1.45; color: #3c4c63; margin: 4px 0 10px; font-weight: 400; }
.imm-chat-card .consent input { margin-top: 2px; flex: none; width: 16px; height: 16px; }
.imm-chat-card .consent a { color: #065db5; }
.imm-chat-send {
  width: 100%; background: #065db5; color: #fff; border: 0; cursor: pointer;
  font: 700 15px/1 Figtree, sans-serif; padding: 13px; border-radius: 10px;
}
.imm-chat-send:hover { background: #1557b0; }
.imm-chat-send[disabled] { opacity: .55; cursor: default; }
.imm-chat-callrow { text-align: center; margin-top: 10px; font-size: 13.5px; }
.imm-chat-callrow a { color: #065db5; font-weight: 700; text-decoration: none; }
.imm-chat-dismiss { display: block; margin: 9px auto 0; background: none; border: 0; color: #5a6b84; cursor: pointer; font: 600 12.5px Figtree, sans-serif; text-decoration: underline; }

.imm-chat-form { display: flex; gap: 8px; padding: 11px 12px; background: #fff; border-top: 1px solid #d7e3f2; flex: none; }
.imm-chat-input {
  flex: 1; min-width: 0; border: 1px solid #c3d5ec; border-radius: 999px;
  padding: 11px 15px; font: 400 16px/1.3 Figtree, system-ui, sans-serif; color: #14213d;
}
.imm-chat-input:focus { outline: 2px solid #9ec7f5; border-color: #065db5; }
.imm-chat-go {
  background: #065db5; color: #fff; border: 0; cursor: pointer; flex: none;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
}
.imm-chat-go:hover { background: #1557b0; }
.imm-chat-fine { font-size: 11px; color: #7186a1; text-align: center; padding: 0 14px 10px; background: #fff; flex: none; }

@media (max-width: 1060px) {
  .imm-chat { left: 14px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .imm-chat-panel { bottom: 62px; height: min(560px, calc(100dvh - 240px)); }
}
