/* ── Pricing IQ Chatbot — Nile Brand CSS ── */

:root {
  --piq-corbeau:        #0E111E;
  --piq-nile-default:   #001E2D;
  --piq-dark-blue:      #1E57F7;
  --piq-dark-cornflower:#163498;
  --piq-dark-robins:    #2BF9EB;
  --piq-amber:          #FF6600;
  --piq-nile-grey:      #F6F8FB;
  --piq-cloud:          #e6e7e8;
  --piq-smoke:          #6e7078;
  --piq-white:          #ffffff;
  --piq-grad-cool:      linear-gradient(225deg, #163498 9.38%, #1E57F7 50.52%, #2BF9EB 92.62%);
  --piq-grad-branding:  linear-gradient(90deg, rgba(22,52,137,1) 35%, rgba(14,17,30,1) 100%);
  --piq-grad-cc:        linear-gradient(225deg, #163498 0%, #0E1113 100%);
}

/* ── FAB ── */
#piq-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--piq-grad-cool);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  box-shadow: 0 6px 24px rgba(30,87,247,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: piq-fab-pulse 3s ease-in-out infinite;
}
@keyframes piq-fab-pulse {
  0%,100% { box-shadow: 0 6px 24px rgba(30,87,247,0.45), 0 0 0 0 rgba(30,87,247,0.25); }
  50%     { box-shadow: 0 6px 24px rgba(30,87,247,0.45), 0 0 0 12px rgba(30,87,247,0); }
}
#piq-fab:hover {
  transform: scale(1.07);
  animation: none;
  box-shadow: 0 10px 32px rgba(30,87,247,0.6);
}
#piq-fab svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}
#piq-fab .piq-icon-chat  { display: block; }
#piq-fab .piq-icon-close { display: none; }
#piq-fab.open .piq-icon-chat  { display: none; }
#piq-fab.open .piq-icon-close { display: block; }
#piq-fab.open { animation: none; }

.piq-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 20px;
  height: 20px;
  background: var(--piq-amber);
  border-radius: 50%;
  border: 2px solid var(--piq-corbeau);
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}
.piq-badge.visible { display: flex; }

/* ── Chat popup ── */
#piq-popup {
  position: fixed;
  bottom: 112px;
  right: 28px;
  width: 430px;
  max-width: calc(100vw - 40px);
  height: 650px;
  max-height: calc(100vh - 130px);
  background: var(--piq-white);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(30,87,247,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999998;
  transform: scale(0.88) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1), opacity 0.2s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
#piq-popup.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
.piq-header {
  background: var(--piq-grad-branding);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(30,87,247,0.2);
  box-sizing: border-box;
}
.piq-header-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--piq-grad-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.piq-header-logo svg { width: 20px; height: 20px; fill: #fff; }
.piq-name  { font-weight: 700; font-size: 0.9rem; color: #fff; letter-spacing: -0.01em; }
.piq-sub   { font-size: 0.68rem; color: rgba(230,231,232,0.7); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.piq-dot   { width: 5px; height: 5px; background: var(--piq-dark-robins); border-radius: 50%; display: inline-block; }
.piq-header-actions { margin-left: auto; }
.piq-clear-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(230,231,232,0.8);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.piq-clear-btn:hover { border-color: var(--piq-amber); color: var(--piq-amber); }

/* ── Messages ── */
#piq-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--piq-nile-grey);
  box-sizing: border-box;
}
#piq-messages::-webkit-scrollbar { width: 4px; }
#piq-messages::-webkit-scrollbar-thumb { background: var(--piq-cloud); border-radius: 2px; }

.piq-msg-row { display: flex; gap: 8px; align-items: flex-end; }
.piq-msg-row.piq-user { flex-direction: row-reverse; }

.piq-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.piq-avatar.piq-bot  { background: var(--piq-grad-cc); border: 1.5px solid rgba(30,87,247,0.4); }
.piq-avatar.piq-user { background: var(--piq-amber); }

.piq-bubble {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.83rem;
  line-height: 1.65;
  word-break: break-word;
  box-sizing: border-box;
}
.piq-msg-row.piq-user .piq-bubble {
  background: var(--piq-corbeau);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.piq-msg-row.piq-bot .piq-bubble {
  background: var(--piq-white);
  color: var(--piq-nile-default);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.piq-time { font-size: 0.61rem; color: var(--piq-smoke); margin-top: 3px; }
.piq-msg-row.piq-user .piq-time { text-align: right; }

/* ── Answer card ── */
.piq-answer-card {
  background: var(--piq-white);
  border: 1px solid var(--piq-cloud);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 4px;
}
.piq-ac-head {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(30,87,247,0.12);
  background: var(--piq-grad-branding);
}
.piq-ac-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--piq-grad-cool);
  display: flex;
  align-items: center;
  justify-content: center;
}
.piq-ac-icon svg { width: 13px; height: 13px; fill: #fff; }
.piq-ac-name { font-weight: 700; font-size: 0.75rem; color: #fff; }
.piq-ac-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.piq-ac-badge.piq-yes { background: rgba(43,249,235,0.15); color: var(--piq-dark-robins); }
.piq-ac-badge.piq-no  { background: rgba(255,102,0,0.12); color: var(--piq-amber); }
.piq-ac-body {
  padding: 10px 12px;
  font-size: 0.79rem;
  line-height: 1.68;
  color: var(--piq-nile-default);
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.piq-ac-body::-webkit-scrollbar { width: 3px; }
.piq-ac-body::-webkit-scrollbar-thumb { background: var(--piq-cloud); }

/* ── Typing indicator ── */
.piq-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.piq-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--piq-dark-blue);
  animation: piq-bounce 1.2s infinite;
  opacity: 0.7;
}
.piq-typing span:nth-child(2) { animation-delay: 0.2s; }
.piq-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes piq-bounce {
  0%,80%,100% { transform: translateY(0); }
  40%         { transform: translateY(-6px); }
}

/* ── Welcome chips ── */
.piq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.piq-chip {
  background: rgba(30,87,247,0.08);
  color: var(--piq-dark-blue);
  border: 1px solid rgba(30,87,247,0.22);
  border-radius: 30px;
  padding: 5px 14px;
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.piq-chip:hover { background: rgba(30,87,247,0.16); border-color: var(--piq-dark-blue); }

/* ── Input area ── */
.piq-input-wrap {
  padding: 12px 13px;
  border-top: 1px solid var(--piq-cloud);
  background: var(--piq-white);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  box-sizing: border-box;
}
#piq-input {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--piq-cloud);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 0.83rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--piq-nile-default);
  outline: none;
  min-height: 40px;
  max-height: 110px;
  transition: border-color 0.2s;
  background: var(--piq-nile-grey);
  box-sizing: border-box;
}
#piq-input:focus  { border-color: var(--piq-dark-blue); background: var(--piq-white); }
#piq-input::placeholder { color: var(--piq-smoke); }

.piq-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--piq-amber);
  border: 1px solid var(--piq-amber);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.3s ease-in-out, box-shadow 0.2s, transform 0.1s;
}
.piq-send-btn:hover  { background: #e55c00; box-shadow: -1px 3px 3px rgba(0,0,0,0.16); }
.piq-send-btn:active { transform: scale(0.93); }
.piq-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.piq-send-btn svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.piq-hint {
  font-size: 0.61rem;
  color: var(--piq-smoke);
  text-align: center;
  padding: 0 13px 8px;
  background: var(--piq-white);
  margin-top: -4px;
  font-family: inherit;
}

/* ── Restored session notice ── */
.piq-restored-notice {
  text-align: center;
  font-size: 0.65rem;
  color: var(--piq-smoke);
  padding: 4px 0 8px;
}
