/* „Frag Temto" widget — floating chat for landing pages.
   Owns its own namespace (.ftq-) so it cannot bleed into the rest
   of the landing CSS. Brand colours pulled from landing-base.css. */

.ftq-launcher {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 9990;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #54308C 0%, #247CC6 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(36, 124, 198, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ftq-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 32px rgba(36, 124, 198, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.ftq-launcher svg { width: 26px; height: 26px; }
.ftq-launcher[data-open="true"] { display: none; }

.ftq-panel {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 9991;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 150px);
  background: #0a1628;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(63, 169, 245, 0.12);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.ftq-panel[data-open="true"] { display: flex; }

.ftq-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(84, 48, 140, 0.35) 0%, rgba(36, 124, 198, 0.35) 100%);
}
.ftq-header-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #54308C 0%, #247CC6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ftq-header-logo svg { width: 14px; height: 14px; color: #fff; }
.ftq-header-text { flex: 1; min-width: 0; }
.ftq-header-title {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}
.ftq-header-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  line-height: 1.2;
  margin-top: 2px;
}
.ftq-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  display: flex;
}
.ftq-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.ftq-close svg { width: 16px; height: 16px; }

.ftq-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.ftq-messages::-webkit-scrollbar { width: 6px; }
.ftq-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

.ftq-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ftq-msg-bot {
  background: rgba(63, 169, 245, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(63, 169, 245, 0.18);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.ftq-msg-user {
  background: linear-gradient(135deg, #54308C 0%, #247CC6 100%);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.ftq-msg-error {
  background: rgba(255, 100, 100, 0.1);
  color: #ffcfcf;
  border: 1px solid rgba(255, 100, 100, 0.25);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ftq-typing {
  display: inline-flex;
  gap: 4px;
  padding: 6px 0;
}
.ftq-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: ftq-bounce 1.2s infinite ease-in-out;
}
.ftq-typing span:nth-child(2) { animation-delay: 0.15s; }
.ftq-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ftq-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.ftq-suggestions {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ftq-suggestion {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ftq-suggestion:hover {
  background: rgba(63, 169, 245, 0.15);
  color: #fff;
  border-color: rgba(63, 169, 245, 0.4);
}

.ftq-input-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.15);
}
.ftq-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 9px 12px;
  resize: none;
  max-height: 120px;
  min-height: 38px;
  outline: none;
  transition: border-color 0.15s;
}
.ftq-input:focus { border-color: rgba(63, 169, 245, 0.5); }
.ftq-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.ftq-send {
  background: linear-gradient(135deg, #54308C 0%, #247CC6 100%);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.ftq-send:hover:not(:disabled) { transform: translateY(-1px); }
.ftq-send:disabled { opacity: 0.4; cursor: not-allowed; }
.ftq-send svg { width: 16px; height: 16px; }

.ftq-disclaimer {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  padding: 4px 12px 8px;
  background: rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
  .ftq-launcher { right: 16px; bottom: 20px; }
  .ftq-panel {
    right: 8px;
    left: 8px;
    bottom: 20px;
    width: auto;
    max-width: none;
    height: 65vh;
    max-height: calc(100vh - 160px);
  }
}

/* ─── Authenticated-area overrides ─────────────────────────────
   base.html applies global `input, select, textarea` and
   `button, .btn` styles inside the dashboard. Those leak into the
   widget (visible artefact: a pale rounded input rendered next to
   our textarea, focus glow showing through, etc.). We bump every
   offending selector's specificity to a panel-scoped form so the
   widget always wins, regardless of which base template hosts it. */
.ftq-panel .ftq-input,
.ftq-panel textarea.ftq-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 9px 12px;
  border-radius: 10px;
  box-shadow: none;
  outline: none;
  resize: none;
  max-height: 120px;
  min-height: 38px;
  transition: border-color 0.15s;
}
.ftq-panel .ftq-input:focus,
.ftq-panel textarea.ftq-input:focus {
  border-color: rgba(63, 169, 245, 0.5);
  box-shadow: none;
  outline: none;
}
.ftq-panel button.ftq-send,
.ftq-panel .ftq-send {
  background: linear-gradient(135deg, #54308C 0%, #247CC6 100%);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: none;
}
.ftq-panel button.ftq-close,
.ftq-panel .ftq-close {
  background: none;
  border: none;
  padding: 6px;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  font-family: inherit;
}
.ftq-panel button.ftq-suggestion,
.ftq-panel .ftq-suggestion {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  box-shadow: none;
}
body button.ftq-launcher,
body .ftq-launcher {
  background: linear-gradient(135deg, #54308C 0%, #247CC6 100%);
  border: none;
  padding: 0;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(36, 124, 198, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
