/* =============================================================================
   DrivePrime palette bridge — the widget CSS below was written against the old
   static site's variables. Map them to the Next site's Tailwind palette so the
   widget is self-contained (no dependency on a global styles.css).
   ============================================================================= */
:root {
  --navy:  #08192E;  /* navy-950 */
  --blue:  #1668F0;  /* brand */
  --line:  #DCE6F3;  /* line */
  --light: #EEF4FC;  /* panel */
  --text:  #08192E;
  --muted: #64748B;
}


.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border: 0;
  border-radius: 50px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(23, 105, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(23,105,255,.5); }
.chat-launcher svg { width: 20px; height: 20px; }
.chat-launcher.hidden { display: none; }

/* A quiet pulse — one ring, once on load. Enough to be noticed, not enough
   to be a nuisance to someone reading the page. */
.chat-launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50px;
  border: 2px solid var(--blue);
  animation: chat-ping 2.4s ease-out 3;
  opacity: 0;
}
@keyframes chat-ping {
  0%   { transform: scale(1);    opacity: .7; }
  100% { transform: scale(1.35); opacity: 0; }
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 61;
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 100px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(7, 26, 51, 0.35);
}
.chat-panel.open { display: flex; animation: chat-in .25s cubic-bezier(.22,1,.36,1); }
@keyframes chat-in { from { opacity: 0; transform: translateY(16px); } }

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--navy);
  color: #fff;
}
.chat-head .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #38d47a; box-shadow: 0 0 0 3px rgba(56,212,122,.2);
}
.chat-head strong { font-size: 14px; display: block; }
.chat-head span { font-size: 11px; color: #8db4ff; }
.chat-close {
  margin-left: auto; background: none; border: 0;
  color: #8db4ff; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px;
}
.chat-close:hover { color: #fff; }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--light);
}

.msg {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.bot  { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--text); border-bottom-left-radius: 3px; }
.msg.user { align-self: flex-end;   background: var(--blue); color: #fff; border-bottom-right-radius: 3px; }
.msg.err  { align-self: flex-start; background: #fff2f2; border: 1px solid #ffd0d0; color: #a12626; }

.chat-typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px; }
.chat-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: chat-bounce 1.2s infinite;
}
.chat-typing i:nth-child(2) { animation-delay: .15s; }
.chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-bounce { 0%,60%,100% { transform: translateY(0); opacity:.4 } 30% { transform: translateY(-5px); opacity:1 } }

/* Suggested openers — the blank-input problem is real. Give people a door. */
.chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 12px; background: var(--light); }
.chat-chips button {
  background: #fff; border: 1px solid var(--line); color: var(--text);
  border-radius: 20px; padding: 8px 13px; font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; transition: .15s;
}
.chat-chips button:hover { border-color: var(--blue); color: var(--blue); }
.chat-chips.hidden { display: none; }

.chat-input {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--line); background: #fff;
}
.chat-input input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; font-size: 14px; color: var(--text);
}
.chat-input input:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.chat-input button {
  background: var(--blue); border: 0; color: #fff; border-radius: 8px;
  width: 44px; display: grid; place-items: center; cursor: pointer;
}
.chat-input button:disabled { opacity: .45; cursor: not-allowed; }
.chat-input svg { width: 18px; height: 18px; }

.chat-disclaimer {
  padding: 0 12px 10px; background: #fff;
  font-size: 10px; color: var(--muted); text-align: center;
}

@media (max-width: 620px) {
  .chat-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 70px); }
  .chat-launcher { right: 14px; bottom: 14px; padding: 13px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-launcher::before, .chat-typing i, .chat-panel.open { animation: none; }
}
