/* RC Konsulten – Lead-guide (chatbot) */

.rc-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9990;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(145deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  color: var(--color-navy);
  box-shadow: 0 8px 28px rgba(12, 26, 46, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.rc-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(12, 26, 46, 0.28);
}

.rc-chat-launcher svg {
  width: 1.5rem;
  height: 1.5rem;
}

.rc-chat-launcher--hidden {
  display: none;
}

.rc-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 9991;
  width: min(400px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 7rem));
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(12, 26, 46, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
}

.rc-chat-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.rc-chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
  color: var(--color-white);
}

.rc-chat-panel__brand {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.rc-chat-panel__brand span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
}

.rc-chat-panel__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.rc-chat-panel__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rc-chat-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  background: var(--color-off-white);
}

.rc-chat-msg {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 100%;
}

.rc-chat-msg--bot {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  color: var(--color-navy);
  border-bottom-left-radius: 4px;
}

.rc-chat-msg--user {
  margin-left: auto;
  background: var(--color-navy);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
  width: fit-content;
}

.rc-chat-lang {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rc-chat-lang button {
  flex: 1 1 calc(33% - 0.35rem);
  min-width: 5.5rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  background: var(--color-white);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-navy);
  transition: border-color 0.2s, background 0.2s;
}

.rc-chat-lang button:hover {
  border-color: var(--color-gold);
  background: rgba(201, 168, 76, 0.08);
}

.rc-chat-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rc-chat-options button {
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  background: var(--color-white);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-navy);
  transition: all 0.2s;
}

.rc-chat-options button:hover {
  border-color: var(--color-gold-dark);
  background: rgba(201, 168, 76, 0.1);
}

.rc-chat-options button.rc-chat-options__primary {
  background: linear-gradient(180deg, var(--color-gold) 0%, #c4a347 100%);
  border-color: var(--color-gold);
  color: var(--color-navy);
  font-weight: 600;
}

.rc-chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rc-chat-form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-gray-500);
}

.rc-chat-form input,
.rc-chat-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
}

.rc-chat-form textarea {
  min-height: 72px;
  resize: vertical;
}

.rc-chat-form button[type='submit'] {
  margin-top: 0.35rem;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--color-gold) 0%, #c4a347 100%);
  color: var(--color-navy);
  font-weight: 600;
  cursor: pointer;
}

.rc-chat-form button[type='submit']:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rc-chat-error {
  font-size: 0.82rem;
  color: #c0392b;
  margin: 0;
}

.rc-chat-panel__foot {
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  color: var(--color-gray-400);
  text-align: center;
  border-top: 1px solid var(--color-gray-200);
  background: var(--color-white);
}

@media (max-width: 480px) {
  .rc-chat-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }

  .rc-chat-launcher {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rc-chat-panel,
  .rc-chat-launcher {
    transition: none;
  }
}
