/* Website-Chat IT Kaufmann — eigenständiges Stylesheet, keine Abhängigkeiten.
   Alle Regeln sind mit .itkfm-chat vorangestellt. Grund: das Elementor-Kit der Seite
   formatiert jeden button (.elementor-kit-5 button) und hat damit mehr Gewicht als
   eine einzelne Klasse. Ohne den Vorsatz übernimmt das Kit Radius, Abstände,
   Schriftgröße und Ausrichtung und die Anordnung im Knopf bricht auseinander. */
.itkfm-chat, .itkfm-chat * { box-sizing: border-box; }

.itkfm-chat {
  --blau: #164B84;
  --blau-dunkel: #10395f;
  --akzent: #9AC9FF;
  --hell: #EAF2FB;
  --ink: #12203A;
  --grau: #5B6572;
  --linie: #DCE4EF;
  /* Standard ist die linke Ecke: rechts unten sitzt auf itkaufmann.at bereits der
     Knopf 'nach oben' (ue-scroll-to, 50x50, 20px Abstand). Über die Einstellung
     lässt sich die Seite wechseln, falls dort einmal nichts mehr im Weg ist. */
  position: fixed; left: 22px; right: auto; bottom: 22px; z-index: 99999;
  font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Schutzschicht gegen Themenstile: alles Fremde abräumen, danach selbst setzen. */
.itkfm-chat button,
.itkfm-chat textarea {
  appearance: none; -webkit-appearance: none;
  margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: inherit; letter-spacing: normal; text-transform: none; text-decoration: none;
  min-width: 0; min-height: 0; width: auto;
}

/* --- Startknopf --- */
.itkfm-chat .itkfm-chat__knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; cursor: pointer;
  background: var(--blau); color: #fff; border: 1px solid var(--blau);
  font-size: 16px; font-weight: 600; line-height: 1;
  box-shadow: 0 6px 18px rgba(6, 20, 38, .20);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
/* Wie die uebrigen Knoepfe der Website: beim Ueberfahren dreht sich die Flaeche um.
   Die Textfarbe MUSS hier stehen — sonst setzt das Elementor-Kit sie auf Primary und
   es steht blaue Schrift auf blauem Grund. */
.itkfm-chat .itkfm-chat__knopf:hover {
  background: #fff; color: var(--blau); border-color: var(--blau);
  transform: translateY(-1px); box-shadow: 0 10px 24px rgba(6, 20, 38, .26);
}
.itkfm-chat .itkfm-chat__knopf:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }
.itkfm-chat .itkfm-chat__knopf svg { width: 20px; height: 20px; flex: 0 0 20px; display: block; }
.itkfm-chat .itkfm-chat__knopf span { line-height: 1; display: block; }

/* --- Fenster --- */
.itkfm-chat .itkfm-chat__fenster {
  display: none; flex-direction: column; overflow: hidden;
  width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 120px);
  background: #fff; border: 1px solid var(--linie); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(6, 20, 38, .22);
}
/* Doppelte Klasse, damit der Zustand 'offen' unabhaengig von der Reihenfolge gewinnt. */
.itkfm-chat.itkfm-chat--rechts { left: auto; right: 22px; }
.itkfm-chat.itkfm-chat--offen .itkfm-chat__fenster { display: flex; }
.itkfm-chat.itkfm-chat--offen .itkfm-chat__knopf { display: none; }

.itkfm-chat .itkfm-chat__kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: var(--blau); color: #fff;
}
.itkfm-chat .itkfm-chat__titel { font-size: 16px; font-weight: 700; line-height: 1.2; }
.itkfm-chat .itkfm-chat__unterzeile { font-size: 12px; opacity: .85; margin-top: 2px; line-height: 1.35; }
.itkfm-chat .itkfm-chat__zu {
  display: flex; align-items: center; justify-content: center; flex: 0 0 32px;
  width: 32px; height: 32px; padding: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
  font-size: 20px; line-height: 1;
}
.itkfm-chat .itkfm-chat__zu:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.itkfm-chat .itkfm-chat__zu:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- Verlauf --- */
.itkfm-chat .itkfm-chat__verlauf {
  flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px;
  background: #F7F9FC;
}
.itkfm-chat .itkfm-blase {
  max-width: 86%; padding: 11px 14px; border-radius: 14px;
  font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.itkfm-chat .itkfm-blase--bot { align-self: flex-start; background: #fff; border: 1px solid var(--linie); color: var(--ink); }
.itkfm-chat .itkfm-blase--ich { align-self: flex-end; background: var(--blau); color: #fff; }
.itkfm-chat .itkfm-blase--hinweis { align-self: center; background: var(--hell); color: var(--blau); font-size: 13px; text-align: center; }
.itkfm-chat .itkfm-blase a { color: inherit; }
.itkfm-chat .itkfm-blase--bot a { color: var(--blau); }

.itkfm-chat .itkfm-chat__tippt { display: inline-flex; gap: 4px; align-items: center; }
.itkfm-chat .itkfm-chat__tippt i {
  width: 6px; height: 6px; border-radius: 999px; background: var(--grau); display: inline-block;
  animation: itkfm-huepf 1.2s infinite ease-in-out;
}
.itkfm-chat .itkfm-chat__tippt i:nth-child(2) { animation-delay: .15s; }
.itkfm-chat .itkfm-chat__tippt i:nth-child(3) { animation-delay: .3s; }
@keyframes itkfm-huepf { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .itkfm-chat .itkfm-chat__tippt i { animation: none; opacity: .6; }
  .itkfm-chat .itkfm-chat__knopf { transition: none; }
}

/* --- Eingabe --- */
.itkfm-chat .itkfm-chat__fuss { border-top: 1px solid var(--linie); padding: 12px; background: #fff; }
.itkfm-chat .itkfm-chat__zeile { display: flex; gap: 8px; align-items: flex-end; }
.itkfm-chat .itkfm-chat__eingabe {
  flex: 1; resize: none; max-height: 120px; padding: 11px 13px;
  border: 1px solid var(--linie); border-radius: 12px;
  font-size: 15px; line-height: 1.4; color: var(--ink); background: #fff;
}
.itkfm-chat .itkfm-chat__eingabe:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: var(--blau); }
.itkfm-chat .itkfm-chat__senden {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 44px; padding: 0;
  border-radius: 12px; background: var(--blau); color: #fff; cursor: pointer;
}
.itkfm-chat .itkfm-chat__senden:hover:not(:disabled) { background: #fff; color: var(--blau); box-shadow: inset 0 0 0 1px var(--blau); }
.itkfm-chat .itkfm-chat__senden:disabled { opacity: .45; cursor: default; }
.itkfm-chat .itkfm-chat__senden svg { width: 18px; height: 18px; display: block; }
.itkfm-chat .itkfm-chat__rechtliches { margin-top: 8px; font-size: 11px; line-height: 1.45; color: var(--grau); text-align: center; }
.itkfm-chat .itkfm-chat__rechtliches a { color: var(--grau); }

/* Cloudflare-Prüfung: normalerweise unsichtbar, erscheint nur bei einer Rückfrage. */
.itkfm-chat .itkfm-chat__pruefung { display: flex; justify-content: center; }
.itkfm-chat .itkfm-chat__pruefung:not(:empty) { margin-bottom: 10px; }
.itkfm-chat .itkfm-chat__pruefung iframe { max-width: 100%; }

@media (max-width: 480px) {
  .itkfm-chat, .itkfm-chat.itkfm-chat--rechts { right: 12px; bottom: 12px; left: 12px; }
  .itkfm-chat .itkfm-chat__fenster { width: 100%; height: min(72vh, 560px); }
  .itkfm-chat .itkfm-chat__knopf { margin-right: auto; }
  .itkfm-chat.itkfm-chat--rechts .itkfm-chat__knopf { margin-right: 0; margin-left: auto; }
}
