/* ============================================================================
   OTIT Hilfe-Chatbot — Floating Widget
   ============================================================================ */

.otit-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0d9488;
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(13, 148, 136, .4);
  cursor: pointer;
  font-size: 28px;
  z-index: 9000;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.otit-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(13, 148, 136, .5);
}
.otit-chat-fab.is-open { background: #0b7f74; }
.otit-chat-fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  display: none;
}

.otit-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 140px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9001;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  border: 1px solid #e5e7eb;
}
.otit-chat-panel.is-open { display: flex; }

.otit-chat-header {
  background: linear-gradient(135deg, #0d9488 0%, #0b7f74 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.otit-chat-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.otit-chat-header__title {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.otit-chat-header__subtitle {
  font-size: 11px;
  opacity: .85;
  margin-top: 1px;
}
.otit-chat-header__close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: .9;
  padding: 4px 8px;
  border-radius: 6px;
}
.otit-chat-header__close:hover { background: rgba(255, 255, 255, .15); }

.otit-chat-disclaimer {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 8px 16px;
  font-size: 11px;
  color: #92400e;
  line-height: 1.4;
}

.otit-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.otit-chat-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.otit-chat-msg--bot {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111827;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.otit-chat-msg--user {
  background: #0d9488;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.otit-chat-msg code {
  background: rgba(17, 24, 39, .08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
}
.otit-chat-msg--user code { background: rgba(255, 255, 255, .25); }
.otit-chat-msg a { color: inherit; text-decoration: underline; }
.otit-chat-msg ol, .otit-chat-msg ul { margin: 6px 0; padding-left: 22px; }

.otit-chat-msg--typing {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-style: italic;
  align-self: flex-start;
}
.otit-chat-msg--typing::after {
  content: '...';
  display: inline-block;
  animation: otit-chat-dots 1.2s infinite steps(4);
}
@keyframes otit-chat-dots {
  0% { content: '.'; }
  25% { content: '..'; }
  50% { content: '...'; }
  75% { content: '....'; }
}

.otit-chat-msg--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.otit-chat-input {
  border-top: 1px solid #e5e7eb;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.otit-chat-input textarea {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 110px;
  min-height: 38px;
  outline: none;
  line-height: 1.4;
}
.otit-chat-input textarea:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, .2);
}
.otit-chat-input button {
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  height: 38px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.otit-chat-input button:hover { background: #0b7f74; }
.otit-chat-input button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.otit-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.otit-chat-suggestion {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}
.otit-chat-suggestion:hover {
  background: #f0fdfa;
  border-color: #0d9488;
  color: #0d9488;
}

@media (max-width: 480px) {
  .otit-chat-panel {
    right: 8px;
    bottom: 84px;
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
  }
  .otit-chat-fab {
    right: 16px;
    bottom: 16px;
  }
}
