/* Infiniti Assistant — floating chat widget (client-side only, no external calls) */
/* Brand colours match the site: --blue #1e3a6e, --blue-mid #2a4f96, --blue-light #3a6abf */

.ia-fab {
  position: fixed;
  right: 24px;
  bottom: 94px; /* sits directly above the WhatsApp float (24px + 58px + 12px gap) */
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 18px 0 15px;
  border: none;
  border-radius: 999px;
  background: #1e3a6e;
  color: #fff;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.ia-fab:hover { transform: scale(1.04); background: #2a4f96; box-shadow: 0 8px 26px rgba(0, 0, 0, .32); }
.ia-fab svg { flex: none; }

.ia-panel {
  position: fixed;
  right: 24px;
  bottom: 158px; /* fab bottom (94px) + fab height (52px) + 12px gap */
  z-index: 10000;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: min(560px, calc(100vh - 200px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dfe6f0;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(13, 43, 69, .28);
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #1c2b3a;
}
.ia-panel[hidden] { display: none; }

.ia-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #1e3a6e 0%, #162d5a 60%, #0e1f40 100%);
  color: #fff;
}
.ia-title { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.ia-sub { font-size: 12px; color: rgba(255, 255, 255, .78); margin-top: 2px; }
.ia-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.ia-close:hover { background: rgba(255, 255, 255, .28); }

.ia-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f9fc;
}
.ia-msg { max-width: 88%; padding: 10px 13px; border-radius: 13px; font-size: 13.8px; line-height: 1.55; }
.ia-msg p { margin: 0 0 8px; }
.ia-msg p:last-child { margin-bottom: 0; }
.ia-msg ul { margin: 4px 0 8px; padding-left: 18px; }
.ia-msg li { margin-bottom: 3px; }
.ia-msg a { color: #2a4f96; text-decoration: underline; }
.ia-msg table { border-collapse: collapse; margin: 6px 0; font-size: 13px; width: 100%; }
.ia-msg th, .ia-msg td { border: 1px solid #d5dce6; padding: 4px 7px; text-align: left; vertical-align: top; }
.ia-msg th { background: #e8eef8; font-weight: 600; }
/* Side-by-side comparison table (approved preview's compare()) */
.ia-compare { font-size: 12.5px; }
.ia-compare th { background: #dbe4f3; color: #1e3a6e; }
.ia-compare td:first-child { font-weight: 600; color: #1e3a6e; white-space: nowrap; }
.ia-assistant { align-self: flex-start; background: #fff; border: 1px solid #dfe6f0; border-bottom-left-radius: 4px; }
.ia-user { align-self: flex-end; background: #1e3a6e; color: #fff; border-bottom-right-radius: 4px; }
.ia-user a { color: #fff; }

.ia-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 2px 2px; }
.ia-action {
  border: 1px solid #2a4f96;
  background: #fff;
  color: #1e3a6e;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ia-action:hover { background: #e8eef8; }

.ia-chips {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  border-top: 1px solid #e6ebf2;
  background: #fff;
  scrollbar-width: none;
}
.ia-chips::-webkit-scrollbar { display: none; }
.ia-chip {
  flex: none;
  border: 1px solid #c9d4e4;
  background: #f3f6fb;
  color: #1e3a6e;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.ia-chip:hover { background: #e8eef8; }

.ia-quote {
  padding: 12px 14px;
  border-top: 1px solid #e6ebf2;
  background: #fff;
  max-height: 46%;
  overflow-y: auto;
}
.ia-quote-title { font-weight: 700; color: #1e3a6e; font-size: 14px; margin-bottom: 10px; }
.ia-field { display: block; margin-bottom: 9px; }
.ia-field > span { display: block; font-size: 12.5px; font-weight: 600; color: #33465a; margin-bottom: 3px; }
.ia-field input, .ia-field select, .ia-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c9d4e4;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13.5px;
  color: #1c2b3a;
  background: #fff;
}
.ia-field input:focus, .ia-field select:focus, .ia-field textarea:focus { outline: 2px solid #3a6abf; outline-offset: 0; border-color: #3a6abf; }
.ia-btn {
  width: 100%;
  border: none;
  border-radius: 9px;
  background: #1e3a6e;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px;
  cursor: pointer;
}
.ia-btn:hover { background: #2a4f96; }
.ia-done {
  margin-top: 10px;
  border: 1.5px solid #bfe3cd;
  background: #f0f9f3;
  border-radius: 8px;
  padding: 12px 13px;
  font-size: 13.5px;
  color: #1e7d46;
}
.ia-quote-note { margin: 9px 0 0; font-size: 12.5px; color: #5a6b7d; text-align: center; }
.ia-quote-note a { color: #2a4f96; }

.ia-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e6ebf2;
  background: #fff;
}
.ia-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #c9d4e4;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13.5px;
  color: #1c2b3a;
}
.ia-input-row input:focus { outline: 2px solid #3a6abf; outline-offset: 0; border-color: #3a6abf; }
.ia-send {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #1e3a6e;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ia-send:hover { background: #2a4f96; }

/* Inline "Ask Infiniti Assistant" card on the contact page */
.ia-contact-card {
  background: #f3f6fb;
  border: 1px solid #e8eef8;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 22px;
}
.ia-contact-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #3a6abf;
  font-weight: 700;
  margin-bottom: 8px;
}
.ia-contact-card h3 { margin: 0 0 6px; font-size: 19px; color: #1e3a6e; }
.ia-contact-card p { margin: 0 0 14px; font-size: 13.5px; color: #44586a; line-height: 1.6; }

@media (max-width: 768px) {
  .ia-fab { right: 16px; bottom: 80px; height: 48px; font-size: 13.5px; padding: 0 15px 0 13px; } /* above the 52px WhatsApp float (16px + 52px + 12px) */
  .ia-panel { right: 16px; left: 16px; width: auto; max-width: none; bottom: 140px; height: min(560px, calc(100vh - 180px)); }
}
