/* BHARAT KATARIA & CO. | chatbot.css - simple lead-capture chat widget */

.cb {
  --cb-b700: #123d6e;
  --cb-b600: #1a5499;
  --cb-b500: #2470c8;
  --cb-b50: #ebf3fc;
  --cb-t: #071829;
  --cb-t3: #456480;
  --cb-bdr: rgba(7, 24, 41, .1);
  --cb-r: 12px;
  --cb-e: cubic-bezier(.22, 1, .36, 1);

  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* LAUNCHER */
.cb-btn {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-b600), var(--cb-b500));
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(18, 61, 110, .32);
  transition: transform 240ms var(--cb-e), box-shadow 240ms var(--cb-e);
}

.cb-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 30px rgba(18, 61, 110, .4);
}

.cb-btn:focus-visible {
  outline: 3px solid var(--cb-b500);
  outline-offset: 3px;
}

.cb-btn svg {
  width: 26px;
  height: 26px;
}

.cb-btn .cb-ic-close {
  display: none;
}

.cb.is-open .cb-btn .cb-ic-chat {
  display: none;
}

.cb.is-open .cb-btn .cb-ic-close {
  display: block;
}

/* unread dot */
.cb-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e0483d;
  border: 2px solid #fff;
}

.cb.is-open .cb-dot,
.cb.is-seen .cb-dot {
  display: none;
}

/* PANEL */
.cb-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(370px, calc(100vw - 40px));
  height: min(540px, calc(100vh - 130px));
  background: #fff;
  border: 1px solid var(--cb-bdr);
  border-radius: var(--cb-r);
  box-shadow: 0 20px 50px rgba(7, 24, 41, .2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.97);
  transform-origin: bottom right;
  transition: opacity 240ms var(--cb-e), transform 240ms var(--cb-e), visibility 240ms;
}

.cb.is-open .cb-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* HEADER */
.cb-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  background: linear-gradient(135deg, var(--cb-b700), var(--cb-b600));
  color: #fff;
  flex-shrink: 0;
}

.cb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .3px;
  flex-shrink: 0;
}

.cb-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.cb-sub {
  font-size: 12px;
  opacity: .82;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cb-sub::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46d17f;
}

/* MESSAGES */
.cb-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: #f7fafd;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overscroll-behavior: contain;
}

.cb-body::-webkit-scrollbar {
  width: 6px;
}

.cb-body::-webkit-scrollbar-thumb {
  background: rgba(7, 24, 41, .16);
  border-radius: 3px;
}

.cb-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cb-t);
  animation: cb-in 260ms var(--cb-e) both;
}

@keyframes cb-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.cb-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--cb-bdr);
  border-bottom-left-radius: 4px;
}

.cb-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--cb-b600), var(--cb-b500));
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* typing indicator */
.cb-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 13px 15px;
}

.cb-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cb-t3);
  animation: cb-bounce 1.2s infinite;
}

.cb-typing span:nth-child(2) {
  animation-delay: .18s;
}

.cb-typing span:nth-child(3) {
  animation-delay: .36s;
}

@keyframes cb-bounce {

  0%,
  60%,
  100% {
    opacity: .3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* FORM */
.cb-form {
  align-self: stretch;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--cb-bdr);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  animation: cb-in 260ms var(--cb-e) both;
}

.cb-form h4 {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--cb-b700);
  margin: 0;
}

.cb-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--cb-t3);
  margin-bottom: 4px;
}

.cb-field input,
.cb-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--cb-bdr);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--cb-t);
  background: #fbfdff;
  transition: border-color 150ms, box-shadow 150ms;
}

.cb-field textarea {
  resize: vertical;
  min-height: 62px;
}

.cb-field input:focus,
.cb-field textarea:focus {
  outline: 0;
  border-color: var(--cb-b500);
  box-shadow: 0 0 0 3px rgba(36, 112, 200, .14);
}

.cb-field.has-error input,
.cb-field.has-error textarea {
  border-color: #e0483d;
}

.cb-err {
  display: none;
  font-size: 11.5px;
  color: #e0483d;
  margin-top: 3px;
}

.cb-field.has-error .cb-err {
  display: block;
}

/* honeypot - hidden from humans, visible to bots */
.cb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cb-submit {
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cb-b600), var(--cb-b500));
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 150ms, transform 150ms;
}

.cb-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.cb-submit:disabled {
  opacity: .62;
  cursor: not-allowed;
}

.cb-note {
  font-size: 11px;
  color: var(--cb-t3);
  text-align: center;
  line-height: 1.45;
}

/* COMPOSER */
.cb-foot {
  display: flex;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid var(--cb-bdr);
  background: #fff;
  flex-shrink: 0;
}

.cb-input {
  flex: 1;
  padding: 10px 13px;
  border: 1px solid var(--cb-bdr);
  border-radius: 22px;
  font-family: inherit;
  font-size: 14px;
  color: var(--cb-t);
  background: #f7fafd;
}

.cb-input:focus {
  outline: 0;
  border-color: var(--cb-b500);
  background: #fff;
}

.cb-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-b600), var(--cb-b500));
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: filter 150ms;
}

.cb-send:hover {
  filter: brightness(1.1);
}

.cb-send svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .cb {
    right: 14px;
    bottom: 14px;
  }

  .cb-panel {
    width: calc(100vw - 28px);
    height: min(520px, calc(100vh - 110px));
  }
}

@media (prefers-reduced-motion: reduce) {

  .cb *,
  .cb *::before {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
