/* ProChat structural defaults. Override the custom properties in site CSS. */
.prochat {
  --prochat-font-family: var(--primaryfont, sans-serif);
  --prochat-text-color: #111;
  --prochat-surface-color: #fff;
  --prochat-muted-surface: #f1f0f0;
  --prochat-muted-text: #888;
  --prochat-accent-color: var(--color1, #0084ff);
  --prochat-accent-contrast: #fff;
  --prochat-selected-color: var(--color2, #aa23ec);
  --prochat-border-color: #ddd;
  --prochat-error-color: #ff4d4d;
  --prochat-error-surface: #fff6f6;
  --prochat-radius: 15px;
  --prochat-bubble-radius: 18px;
  --prochat-shadow: 0 10px 15px rgb(0 0 0 / 35%);
  --prochat-backdrop-color: rgb(0 0 0 / 62%);
  --prochat-modal-width: 520px;
  --prochat-layer: 1000;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--prochat-layer);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--prochat-text-color);
  font-family: var(--prochat-font-family);
}

body.prochat-modal-open { overflow: hidden; }

.prochat .Prochat-backdrop { display: none; }

.prochat.prochat--modal {
  inset: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.prochat.prochat--modal .Prochat-backdrop {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--prochat-backdrop-color);
}

.prochat.prochat--modal [data-prochat-toggle] { display: none; }

.prochat.prochat--modal [data-prochat-window] {
  position: relative;
  z-index: 1;
  width: min(var(--prochat-modal-width), calc(100vw - 40px));
  height: min(620px, calc(100vh - 80px));
}

.prochat .Prochat-window-controls {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--prochat-border-color);
}

.prochat .Prochat-window-controls button {
  display: inline-flex;
  width: auto;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--prochat-text-color);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.prochat .Prochat-window-controls button:hover { background: var(--prochat-muted-surface); }

.prochat [data-prochat-toggle][aria-expanded="true"] { display: none; }

.prochat [data-prochat-toggle] {
  margin: 5px;
  padding: 12px 20px;
  border: 0;
  border-radius: 25px;
  background: var(--prochat-accent-color);
  color: var(--prochat-accent-contrast);
  box-shadow: var(--prochat-shadow);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
}

.prochat [data-prochat-window] {
  display: flex;
  width: min(350px, calc(100vw - 40px));
  height: min(500px, calc(100vh - 120px));
  flex-direction: column;
  border: 1px solid var(--prochat-border-color);
  border-radius: var(--prochat-radius);
  background: var(--prochat-surface-color);
  box-shadow: var(--prochat-shadow);
}

.prochat [data-prochat-window].Prochat-hidden,
.prochat .Prochat-hidden {
  display: none;
}

.prochat [data-prochat-body] {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.prochat .Prochat-bubble,
.prochat .Prochat-bubble-secondary {
  max-width: 80%;
  border: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}

.prochat .Prochat-bubble { padding: 10px 14px; border-radius: var(--prochat-bubble-radius); }
.prochat .Prochat-bubble-secondary { padding: 0 3px 0 0; background: transparent; }
.prochat .Prochat-org-msg { align-self: flex-start; background: var(--prochat-muted-surface); color: var(--prochat-text-color); border-bottom-left-radius: 4px; }
.prochat .Prochat-user-choice { align-self: flex-end; background: var(--prochat-accent-color); color: var(--prochat-accent-contrast); border-bottom-right-radius: 4px; cursor: pointer; }
.prochat .Prochat-user-choice-secondary { align-self: flex-end; color: var(--prochat-accent-color); cursor: pointer; }
.prochat .Prochat-user-choice:hover,
.prochat .Prochat-user-choice-secondary:hover { opacity: .8; }
.prochat .Prochat-user-choice-static,
.prochat .Prochat-user-choice-secondary-static { align-self: flex-end; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--prochat-bubble-radius); border-bottom-right-radius: 4px; background: var(--prochat-selected-color); color: var(--prochat-accent-contrast); opacity: .8; }

.prochat .Prochat-bubble-email-form { min-width: 250px; max-width: 80%; padding: 10px 14px; border-radius: var(--prochat-bubble-radius); }
.prochat .Prochat-email-form input,
.prochat .Prochat-email-form textarea { width: 100%; margin-top: 5px; padding: 8px; border: 1px solid var(--prochat-border-color); border-radius: 5px; outline: none; }
.prochat .Prochat-email-form button { margin-top: 5px; padding: 10px; border: 0; border-radius: 10px; background: var(--prochat-accent-color); color: var(--prochat-accent-contrast); cursor: pointer; font: inherit; }
.prochat .Prochat-error-field { border: 2px solid var(--prochat-error-color) !important; background: var(--prochat-error-surface); animation: prochat-shake .2s ease-in-out 0s 2; }

.prochat .Prochat-typing-indicator { display: flex; width: fit-content; gap: 4px; margin-bottom: 10px; padding: 12px; border-radius: var(--prochat-bubble-radius); background: var(--prochat-muted-surface); }
.prochat .Prochat-typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--prochat-muted-text); animation: prochat-blink 1.4s infinite both; }
.prochat .Prochat-typing-indicator span:nth-child(2) { animation-delay: .2s; }
.prochat .Prochat-typing-indicator span:nth-child(3) { animation-delay: .4s; }

.prochat [data-prochat-footer] { display: flex; max-width: 45px; justify-content: flex-start; padding: 10px; border-radius: 0 10px 0 10px; background: var(--prochat-muted-surface); }
.prochat [data-prochat-reset] { display: flex; align-items: center; border: 0; background: none; color: var(--prochat-muted-text); cursor: pointer; transition: color .2s, transform .2s; }
.prochat [data-prochat-reset]:hover { color: var(--prochat-accent-color); transform: scale(1.1); }
.prochat .Prochat-hidden-btn { visibility: hidden; opacity: 0; }

.prochat button:focus-visible,
.prochat input:focus-visible,
.prochat textarea:focus-visible { outline: 3px solid var(--prochat-accent-color); outline-offset: 2px; }

@keyframes prochat-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(.5rem); }
  75% { transform: translateX(-.5rem); }
}

@keyframes prochat-blink {
  0%, 80%, 100% { opacity: .2; }
  40% { opacity: 1; }
}

@media (max-width: 600px) {
  .prochat.prochat--modal { align-items: flex-end; }
  .prochat.prochat--modal [data-prochat-window] {
    width: 100%;
    height: min(82vh, 680px);
    border-radius: var(--prochat-radius) var(--prochat-radius) 0 0;
  }
}
