@font-face {
  font-family: "TT Norms Pro";
  src: url("../fonts/TT-Norms-Pro-Var-Roman.woff2") format("woff2-variations"),
       url("../fonts/TT-Norms-Pro-Var-Roman.woff2") format("woff2"),
       url("../fonts/TT-Norms-Pro-Var-Roman.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TT Norms Pro";
  src: url("../fonts/TT-Norms-Pro-Var-Italic.woff2") format("woff2-variations"),
       url("../fonts/TT-Norms-Pro-Var-Italic.woff2") format("woff2"),
       url("../fonts/TT-Norms-Pro-Var-Italic.woff") format("woff");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

html, body {
  background: transparent !important;
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "TT Norms Pro", sans-serif;
}

:root {
  --chat-primary: #452b75;
  --chat-primary-2: #6a46b5;
  --chat-glass-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 255, 255, 0.28)
  );
}

.chatWidget-panel {
  width: 100%;
  height: 100%;
  box-sizing: border-box;

  border-radius: 24px;
  overflow: hidden;

  background: var(--chat-glass-bg);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.45);

  display: flex;
  flex-direction: column;

  position: relative;
}

.chatWidget-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    circle at 0% 0%,
    rgba(255, 255, 255, 0.65),
    transparent 55%
  );
  opacity: 0.9;
  mix-blend-mode: screen;
}

.chatWidget-header {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;

  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  padding: 0 14px;

  background: linear-gradient(
    135deg,
    rgba(69, 43, 117, 0.98),
    rgba(106, 70, 181, 0.96)
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  color: #fff;
  font-weight: 600;
  border: none;
}

.chatWidget-header svg {
  color: #fff;
}

.chatWidget-iconBtn {
  border: none;
  background: transparent;
  color: inherit;

  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  outline: none;
}

.chatWidget-iconBtn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.chatWidget-body {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;

  background: var(--chat-glass-bg);

  display: flex;
  flex-direction: column;
}

#webchat {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  background: transparent;
}

.chatWidget-disclaimer {
  flex: 0 0 auto;
  padding: 8px 12px 12px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(15, 23, 42, 0.72);
  background: transparent;
  text-align: center;
}
.chatWidget-disclaimer strong {
  color: rgba(15, 23, 42, 0.86);
}

/* ============================================================
   WebChat UI overrides (Bot Framework WebChat)
   ============================================================ */
#webchat .webchat__transcript-scrollable {
  background: transparent !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  position: relative !important;
}

/* Skjul WebChats innebygde typing-indikator helt - vi bruker kun
   vår egen overlay (#chatUiThinking) styrt av meldingshendelser.
   Uten dette kunne begge vises samtidig og gi "duplisert" prikker
   når boten faktisk sender ekte typing-aktiviteter. */
#webchat .webchat__typing-indicator {
  display: none !important;
}

.chatUi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chat-primary, #452b75);
  opacity: 0.8;
  animation: chatUiBounce 1.2s infinite cubic-bezier(0.22, 0.61, 0.36, 1);
}

#webchat .webchat__typing-indicator .chatUi-dot:nth-child(2) {
  animation-delay: 0.15s;
}
#webchat .webchat__typing-indicator .chatUi-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatUiBounce {
  0%,
  80%,
  100% {
    transform: translateY(0) scale(0.9);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-5px) scale(1.1);
    opacity: 1;
  }
}

.chatUi-thinking {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 10;

  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;

  width: 60px;
  height: 24px;

  background: transparent;
  pointer-events: none;
}

.chatUi-thinking.is-visible {
  display: flex !important;
}

.chatUi-thinking .chatUi-dot:nth-child(2) {
  animation-delay: 0.15s;
}
.chatUi-thinking .chatUi-dot:nth-child(3) {
  animation-delay: 0.3s;
}

#webchat,
#webchat * {
  scrollbar-color: rgba(69, 43, 117, 0.6) transparent;
}

#webchat .webchat__transcript-scrollable::-webkit-scrollbar {
  width: 12px;
  background: transparent;
}

#webchat .webchat__transcript-scrollable::-webkit-scrollbar-thumb {
  background: rgba(69, 43, 117, 0.6);
  border-radius: 10px;
  border: 2px solid rgba(248, 248, 251, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

#webchat .webchat__transcript-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(69, 43, 117, 0.75);
}

#webchat .webchat__suggested-actions__list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;

  margin: 6px 10px 0 !important;
  padding: 0 !important;

  overflow: visible !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;

  background: transparent !important;
  list-style: none !important;
  width: 100%;
}

#webchat .webchat__suggested-action,
#webchat .webchat__suggested-action > button {
  flex: 0 1 auto !important;
  min-width: 0 !important;

  background: rgba(69, 43, 117, 0.9) !important;
  color: #fff !important;

  border: none !important;
  border-radius: 9px !important;

  padding: 8px 12px !important;

  white-space: normal !important;
  max-width: 100% !important;
  word-break: break-word !important;
  line-height: 1.3 !important;
  text-align: left !important;
}

#webchat .react-film__filmstrip__list {
  display: flex !important;
  flex-wrap: wrap !important;
}

#webchat .react-film__filmstrip__item {
  margin: 0 !important;
  padding: 0 !important;
}

#webchat .webchat__upload-button,
#webchat input[type="file"].webchat__send-box__file-input {
  display: none !important;
}

#webchat .webchat__send-box__main {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;

  margin: 10px !important;
  padding: 10px 12px !important;

  background: var(--chat-glass-bg) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;

  border-radius: 14px !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22) !important;
  border: none !important;
}

form.webchat__send-box__text-box {
  flex: 1 1 auto !important;
  display: flex !important;
}

input.webchat__send-box-text-box__input {
  flex: 1 !important;
  border: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 16px !important;
  outline: none !important;
  padding: 0 !important;
}

#webchat .webchat__icon-button,
#webchat .webchat__send-button {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
}

#webchat .webchat__send-button {
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;

  background: var(--chat-primary) !important;
  box-shadow: 0 10px 24px rgba(69, 43, 117, 0.35) !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  cursor: pointer !important;
  border: none !important;
}

#webchat .webchat__send-button:hover,
#webchat .webchat__send-button:focus,
#webchat .webchat__send-button:focus-visible {
  background: var(--chat-primary) !important;
  box-shadow: 0 10px 24px rgba(69, 43, 117, 0.35) !important;
  outline: none !important;
}

#webchat .webchat__send-button svg,
#webchat .webchat__send-button svg path {
  fill: #fff !important;
  stroke: #fff !important;
}

#webchat .webchat__bubble.webchat__bubble--from-user,
#webchat .webchat__bubble:not(.webchat__bubble--from-user) {
  border-radius: 18px !important;
  overflow: hidden !important;
  border: none !important;
}

#webchat
  .webchat__bubble:not(.webchat__bubble--from-user)
  .webchat__bubble__content {
  background: linear-gradient(
    135deg,
    rgba(69, 43, 117, 0.22),
    rgba(69, 43, 117, 0.08)
  ) !important;

  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);

  border: none !important;
  outline: none !important;

  box-shadow: 0 8px 22px rgba(69, 43, 117, 0.12) !important;
  color: #0f172a !important;
}

#webchat .webchat__bubble.webchat__bubble--from-user .webchat__bubble__content {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 18px !important;

  background: linear-gradient(
    135deg,
    rgba(255, 113, 1, 0.38),
    rgba(255, 113, 1, 0.18)
  ) !important;

  backdrop-filter: blur(10px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(130%) !important;

  background-clip: padding-box !important;
  border: none !important;
  outline: none !important;

  box-shadow: 0 12px 26px rgba(255, 113, 1, 0.24) !important;
  color: #0f172a !important;
}

#webchat
  .webchat__bubble.webchat__bubble--from-user
  .webchat__bubble__content::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;

  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.02)
  );
}

@media (prefers-reduced-motion: no-preference) {
  #webchat .webchat__bubble .webchat__bubble__content {
    transition: transform 0.18s ease;
  }
  #webchat .webchat__bubble:hover .webchat__bubble__content {
    transform: translateY(-1px);
  }
}

.chatUi-reactions {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  align-self: flex-start;

  gap: 8px;
  width: calc(100% - 24px);

  margin-left: 12px;
  margin-right: 12px;
  margin-top: 7px;

  background: transparent;
}

.chatUi-reactions__bar {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.chatUi-reactions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  width: 40px;
  border-radius: 14px;

  border: none;
  background: rgba(255, 255, 255, 0.85);

  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);

  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  outline: none;
}

.chatUi-reactions__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.chatUi-reactions__btn.is-voted {
  box-shadow: 0 18px 40px rgba(69, 43, 117, 0.3);
}

.chatUi-reactions__btn svg {
  display: block;
  color: var(--chat-primary);
}

.chatUi-reactions form {
  position: relative !important;
  overflow: hidden !important;

  background: linear-gradient(
    135deg,
    rgba(69, 43, 117, 0.22),
    rgba(69, 43, 117, 0.08)
  ) !important;

  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);

  border: none !important;
  outline: none !important;
  border-radius: 18px !important;

  padding: 16px 14px 14px !important;
}

.chatUi-reactions form label {
  display: block;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
}

.chatUi-reactions form textarea {
  width: 100%;
  border-radius: 12px;
  border: none;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.65);
  resize: none;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1.4;
  color: #0f172a;
  outline: none !important;
}

.chatUi-reactions form textarea::placeholder {
  color: rgba(71, 85, 105, 0.75);
}

.chatUi-reactions form > div[style*="font-size:12px"] {
  margin-top: 8px !important;
  color: rgba(71, 85, 105, 0.95) !important;
}

.chatUi-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.chatUi-btn {
  background: var(--chat-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.chatUi-btn:hover {
  background: var(--chat-primary);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(69, 43, 117, 0.28);
}

#webchat button:focus-visible {
  outline: none;
}

#webchat .webchat__send-button.webchat__send-box__button {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;

  border: 0 !important;
  background: var(--chat-primary) !important;
  color: #fff !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#webchat .webchat__send-button.webchat__send-box__button:hover,
#webchat .webchat__send-button.webchat__send-box__button:focus,
#webchat .webchat__send-button.webchat__send-box__button:focus-visible {
  background: var(--chat-primary) !important;
  outline: none !important;
  box-shadow: none !important;
}

#webchat .webchat__send-button.webchat__send-box__button svg,
#webchat .webchat__send-button.webchat__send-box__button svg path {
  fill: #fff !important;
  stroke: #fff !important;
}

#webchat .webchat__icon-button:hover,
#webchat .webchat__icon-button:active,
#webchat .webchat__send-button:hover,
#webchat .webchat__send-button:active,
#webchat [role="button"]:hover,
#webchat [role="button"]:active {
  background-color: transparent !important;
  background: transparent !important;
}

#webchat .webchat__icon-button > *,
#webchat .webchat__suggested-action > * {
  background: transparent !important;
}

#webchat .webchat__icon-button:active {
  filter: none !important;
}
