/* Incorpium website chat (agent/web/widget.js). Incorpium design system: navy header, brand blue actions,
   IBM Plex Sans, 4px radii, borders instead of shadows. Everything is scoped under .ic-* classes. */
.ic-chat, .ic-panel, .ic-lead-thanks, .ic-lead-error {
  --ic-navy: #0b2545;
  --ic-brand: #1d4e89;
  --ic-brand-hover: #163d6c;
  --ic-tint: #e6eef7;
  --ic-ink: #16202c;
  --ic-muted: #5b6573;
  --ic-line: #d5dae1;
  --ic-surface: #ffffff;
  --ic-alt: #f3f5f8;
  --ic-error: #b3261e;
  --ic-success: #1f7a4d;
  --ic-font: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
}

.ic-chat {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 460px;
  background: var(--ic-surface);
  color: var(--ic-ink);
  border: 1px solid var(--ic-line);
  border-radius: 4px;
  overflow: hidden;
  font: 400 15px/22px var(--ic-font);
  text-align: start;
}
.ic-chat *, .ic-chat *::before, .ic-chat *::after { box-sizing: border-box; }
.ic-chat button, .ic-chat input, .ic-chat textarea { font: inherit; color: inherit; }

/* header */
.ic-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ic-navy);
  color: #fff;
  flex: none;
}
.ic-mark-wrap { display: inline-flex; flex: none; }
.ic-mark { width: 28px; height: 28px; flex: none; }
.ic-head-text { flex: 1; min-width: 0; }
.ic-title { font-weight: 600; font-size: 15px; line-height: 20px; }
.ic-sub { font-size: 12px; line-height: 16px; color: #c5d3e6; }
.ic-head button {
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 20px;
  flex: none;
}
.ic-head button:hover { border-color: #6e9bd6; }
.ic-head button:focus-visible { outline: 2px solid #6e9bd6; outline-offset: 1px; }
.ic-close { width: 32px; height: 32px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.ic-close svg { width: 18px; height: 18px; }
.ic-chat:not(.ic-in-panel) .ic-close { display: none; }

/* messages */
.ic-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--ic-surface);
  overscroll-behavior: contain;
  position: relative;
}
.ic-log:focus-visible { outline: 2px solid var(--ic-brand); outline-offset: -2px; }
.ic-msg { display: flex; }
.ic-msg.ic-user { justify-content: flex-end; }
.ic-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ic-bot .ic-bubble { background: var(--ic-alt); border: 1px solid var(--ic-line); }
.ic-user .ic-bubble { background: var(--ic-brand); color: #fff; }
.ic-bubble strong { font-weight: 600; }
.ic-bubble a { color: var(--ic-brand); text-decoration: underline; }
.ic-user .ic-bubble a { color: #fff; }
.ic-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* typing indicator */
.ic-typing .ic-bubble { color: var(--ic-muted); display: inline-flex; align-items: center; gap: 8px; }
.ic-dots { display: inline-flex; gap: 3px; }
.ic-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ic-muted); animation: ic-blink 1.2s infinite ease-in-out; }
.ic-dots i:nth-child(2) { animation-delay: .2s; }
.ic-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ic-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ic-dots i { animation: none; opacity: .6; } }

/* suggested questions */
.ic-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; flex: none; }
.ic-suggest[hidden] { display: none; }
.ic-chip {
  background: var(--ic-surface);
  border: 1px solid var(--ic-line);
  color: var(--ic-brand);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  text-align: start;
}
.ic-chip:hover { border-color: var(--ic-brand); background: var(--ic-tint); }
.ic-chip:focus-visible { outline: 2px solid var(--ic-brand); outline-offset: 1px; }

/* composer */
.ic-compose {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--ic-line);
  background: var(--ic-surface);
  flex: none;
  align-items: flex-end;
}
.ic-compose textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding: 8px 12px;
  border: 1px solid var(--ic-line);
  border-radius: 4px;
  background: var(--ic-surface);
  line-height: 22px;
}
.ic-compose textarea:focus { outline: 2px solid var(--ic-brand); outline-offset: -1px; border-color: var(--ic-brand); }
.ic-btn {
  background: var(--ic-brand);
  color: #fff !important;
  border: 1px solid var(--ic-brand);
  border-radius: 4px;
  padding: 8px 16px;
  min-height: 40px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.ic-btn:hover { background: var(--ic-brand-hover); border-color: var(--ic-brand-hover); }
.ic-btn:focus-visible { outline: 2px solid var(--ic-navy); outline-offset: 2px; }
.ic-btn[disabled] { opacity: .55; cursor: default; }

/* footer */
.ic-foot {
  padding: 8px 16px 12px;
  background: var(--ic-alt);
  border-top: 1px solid var(--ic-line);
  font-size: 13px;
  line-height: 18px;
  color: var(--ic-muted);
  flex: none;
}
.ic-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ic-foot a { color: var(--ic-brand); text-decoration: none; font-weight: 600; }
.ic-foot a:hover { text-decoration: underline; }
.ic-note { margin: 4px 0 0; font-size: 12px; line-height: 16px; }

/* forms inside the conversation: phone gate, readiness, lead form */
.ic-card {
  border: 1px solid var(--ic-line);
  border-inline-start: 3px solid var(--ic-brand);
  border-radius: 4px;
  background: var(--ic-surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ic-msg > .ic-card { width: 100%; }
.ic-card-title { font-weight: 600; margin: 0; }
.ic-card:focus { outline: 2px solid var(--ic-brand); outline-offset: 1px; }
.ic-card-text { margin: 0; color: var(--ic-muted); font-size: 14px; line-height: 20px; }
.ic-field { display: flex; flex-direction: column; gap: 4px; }
.ic-field label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ic-muted); }
.ic-field input, .ic-field textarea {
  width: 100%;
  padding: 8px 12px;
  min-height: 40px;
  border: 1px solid var(--ic-line);
  border-radius: 4px;
  background: var(--ic-surface);
}
.ic-field textarea { resize: vertical; min-height: 64px; }
.ic-field input:focus, .ic-field textarea:focus { outline: 2px solid var(--ic-brand); outline-offset: -1px; border-color: var(--ic-brand); }
.ic-field input[aria-invalid="true"] { border-color: var(--ic-error); }
.ic-hp { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; } /* no off-screen offset: it scrolls RTL pages */
.ic-err { margin: 0; color: var(--ic-error); font-size: 14px; line-height: 20px; }
.ic-err:empty { display: none; }
.ic-ok { margin: 0; color: var(--ic-success); font-weight: 600; }
.ic-card .ic-btn { align-self: flex-start; }
.ic-card-links { font-size: 14px; }
.ic-card-links a { color: var(--ic-brand); font-weight: 600; }

/* placeholder left in the page while the chat is open in the panel */
.ic-placeholder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  padding: 24px;
  border: 1px solid var(--ic-line);
  border-radius: 4px;
  background: var(--ic-alt);
  color: var(--ic-muted);
  font: 400 15px/22px "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
}

/* the panel opened by #incorpium-chat-launcher */
.ic-panel {
  position: fixed;
  z-index: 2147483000;
  inset-inline-end: 24px;
  bottom: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh - 48px));
  display: flex;
}
.ic-panel[hidden] { display: none; }
.ic-panel .ic-chat { min-height: 0; border-color: var(--ic-navy); }
@media (max-width: 640px) {
  .ic-panel { inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; }
  .ic-panel .ic-chat { border: 0; border-radius: 0; }
  .ic-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .ic-in-panel .ic-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .ic-compose textarea { font-size: 16px; } /* no zoom on iOS */
  .ic-field input, .ic-field textarea { font-size: 16px; }
}
html.ic-noscroll, html.ic-noscroll body { overflow: hidden; }

/* page lead forms (form[data-incorpium-lead]) */
.ic-hidden { display: none !important; }
.ic-lead-thanks, .ic-lead-error { font-family: var(--ic-font); }
.ic-lead-thanks {
  padding: 16px;
  border: 1px solid var(--ic-line);
  border-inline-start: 3px solid var(--ic-success);
  border-radius: 4px;
  background: var(--ic-surface);
  color: var(--ic-ink);
}
.ic-lead-thanks-title { margin: 0 0 8px; font-weight: 600; }
.ic-lead-thanks:focus { outline: 2px solid var(--ic-brand); outline-offset: 2px; }
.ic-lead-thanks a, .ic-lead-error a { color: var(--ic-brand); font-weight: 600; }
.ic-lead-error { color: var(--ic-error); margin: 8px 0 0; }
.ic-lead-error:empty { display: none; }
