/* ---------------------------------------------------------------------------
   assets/css/forpay-support.css — the support chat.

   Every colour is a Bootstrap 5.3 theme token, so the conversation follows the
   light/dark toggle. The two exceptions are deliberate and marked.
   --------------------------------------------------------------------------- */

.fp-chat-card { overflow: hidden; }

/* The conversation fills the viewport minus the chrome around it, so the
   composer sits at the bottom of the screen rather than below the fold. */
.fp-chat-body {
  position: relative;
  height: clamp(22rem, calc(100vh - 20rem), 42rem);
  background: var(--bs-body-tertiary-bg, var(--bs-tertiary-bg));
}
.fp-chat-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: .875rem 1rem 1rem;
  scroll-behavior: smooth;
}
.fp-chat-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem; gap: .25rem;
}
.fp-chat-hero {
  width: 64px; height: 64px; border-radius: 50%; margin-bottom: .5rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.75rem;
  background: rgba(var(--bs-primary-rgb), .12); color: var(--bs-primary);
}

/* ---------- header ---------- */
.fp-chat-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: rgba(var(--bs-primary-rgb), .12); color: var(--bs-primary);
}
.fp-chat-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bs-success); margin-right: .4rem; vertical-align: 1px;
}
.fp-chat-dot.is-off { background: var(--bs-secondary-color); }

/* ---------- day separator ---------- */
.fp-chat-daychip { text-align: center; margin: .85rem 0; }
.fp-chat-daychip span {
  display: inline-block; padding: .2rem .75rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  background: var(--bs-secondary-bg); color: var(--bs-secondary-color);
}

/* ---------- bubbles ---------- */
.fp-chat-row { display: flex; align-items: flex-end; gap: .4rem; margin-bottom: .5rem; }
.fp-chat-row.is-me   { justify-content: flex-end; }
.fp-chat-row.is-them { justify-content: flex-start; }

.fp-chat-who {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  background: rgba(var(--bs-primary-rgb), .12); color: var(--bs-primary);
}

.fp-chat-bubble {
  max-width: min(75%, 34rem);
  padding: .5rem .75rem;
  border-radius: 1rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .07);
  word-break: break-word; overflow-wrap: anywhere;
}
.fp-chat-row.is-them .fp-chat-bubble { border-bottom-left-radius: .25rem; }
.fp-chat-row.is-me   .fp-chat-bubble {
  border-bottom-right-radius: .25rem;
  background: var(--bs-primary);
  /* Fixed white, not a token: this bubble is always the primary fill, in both
     themes, so its text must contrast with that rather than with the page. */
  color: #fff;
}
.fp-chat-bubble.is-media { padding: .25rem; }

.fp-chat-text { font-size: .92rem; line-height: 1.5; white-space: pre-wrap; }
/* Underline links inside a message, but not the document card — that is a
   button-shaped thing that happens to be an anchor, and underlining its
   filename made it read as a broken link. */
.fp-chat-bubble a { color: inherit; text-decoration: underline; }
.fp-chat-bubble a.fp-chat-doc,
.fp-chat-bubble a.fp-chat-doc * { text-decoration: none; }

.fp-chat-meta {
  display: block; text-align: right; font-size: .68rem;
  opacity: .7; margin-top: .15rem; white-space: nowrap;
}
.fp-chat-bubble.is-media .fp-chat-meta { padding: 0 .35rem .15rem 0; }
.fp-chat-agent { display: block; font-weight: 600; opacity: .85; }

/* ---------- attachments in a bubble ---------- */
.fp-chat-media { padding: 0; border: 0; background: none; display: block; max-width: 100%; }
.fp-chat-media img,
.fp-chat-media-el {
  display: block; max-width: 100%; max-height: 260px;
  border-radius: .75rem; object-fit: cover;
}
.fp-chat-audio { display: block; max-width: 100%; width: 15rem; height: 38px; }
.fp-chat-doc {
  display: flex; align-items: center; gap: .55rem; text-decoration: none;
  color: inherit; padding: .45rem .5rem; border-radius: .6rem;
  background: rgba(127, 127, 127, .14); min-width: 12rem;
}

/* ---------- jump to latest ---------- */
.fp-chat-jump {
  position: absolute; right: 1rem; bottom: 1rem;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg); color: var(--bs-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- composer ---------- */
.fp-chat-composer {
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  padding: .6rem .75rem;
}
.fp-chat-pill {
  display: flex; align-items: flex-end; gap: .25rem;
  border: 1px solid var(--bs-border-color); border-radius: 1.5rem;
  background: var(--bs-tertiary-bg); padding: .15rem .5rem .15rem .15rem;
}
.fp-chat-iconbtn {
  border: 0; background: none; color: var(--bs-primary);
  font-size: 1.25rem; line-height: 1; padding: .4rem .5rem; flex-shrink: 0;
}
.fp-chat-input {
  flex-grow: 1; border: 0; background: none; resize: none;
  color: var(--bs-body-color); font-size: .92rem; line-height: 1.45;
  padding: .5rem .25rem; max-height: 140px; min-height: 2.4rem;
}
.fp-chat-input:focus { outline: none; box-shadow: none; }
.fp-chat-send {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: var(--bs-primary); color: #fff; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
}
.fp-chat-send:disabled { opacity: .6; }
.fp-chat-preview { height: 38px; max-width: 100%; }

.fp-chat-recdot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--bs-danger);
  animation: fp-chat-pulse 1.2s ease-in-out infinite;
}
@keyframes fp-chat-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .fp-chat-recdot { animation: none; }
  .fp-chat-scroll { scroll-behavior: auto; }
}

/* ---------- attachment popover ---------- */
.fp-chat-attach { position: relative; }
.fp-chat-attach-menu {
  position: absolute; bottom: calc(100% + .5rem); left: 0; z-index: 20;
  display: none; flex-direction: column; min-width: 11rem; padding: .35rem;
  border: 1px solid var(--bs-border-color); border-radius: .75rem;
  background: var(--bs-body-bg); box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.fp-chat-attach-menu.is-open { display: flex; }
.fp-chat-attach-menu button {
  display: flex; align-items: center; gap: .6rem;
  border: 0; background: none; color: var(--bs-body-color);
  padding: .5rem .6rem; border-radius: .5rem; font-size: .88rem; text-align: left;
}
.fp-chat-attach-menu button:hover { background: var(--bs-secondary-bg); }
.fp-chat-attach-ico {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.fp-chat-attach-ico.is-gallery { background: rgba(var(--bs-primary-rgb), .12); color: var(--bs-primary); }
.fp-chat-attach-ico.is-camera  { background: var(--bs-success-bg-subtle);      color: var(--bs-success-text-emphasis); }
.fp-chat-attach-ico.is-doc     { background: var(--bs-warning-bg-subtle);      color: var(--bs-warning-text-emphasis); }

/* ---------- snackbar ---------- */
.fp-chat-snack {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px);
  opacity: 0; pointer-events: none; z-index: 2000; max-width: min(92vw, 520px);
  /* Fixed dark chip in both themes, matching the other snackbars on the site. */
  background: #323232; color: #fff; padding: .6rem 1rem; border-radius: .5rem;
  font-size: .85rem; transition: opacity .2s, transform .2s;
}
.fp-chat-snack.is-on { opacity: 1; transform: translate(-50%, 0); }
.fp-chat-snack.is-error { background: #d32f2f; }

@media (max-width: 575.98px) {
  .fp-chat-body { height: calc(100vh - 15rem); }
  .fp-chat-bubble { max-width: 85%; }
}
