/* ──────────────────────────────────────────────────────────────
   EQui-T Chatbot — chat surface
   B/W only · sharp corners · no shadows · Nunito Sans
   ────────────────────────────────────────────────────────────── */

/* ── Chat column (sits inside .site-main next to .info-sidebar) ── */
.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: var(--color-bg);
}

/* ── Header (slim disclaimer strip above the chat surface) ── */
.chat-header {
  padding: 22px 40px 0;
  background: var(--color-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.header-main-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-icon {
  width: 48px;
  height: 48px;
  background: var(--color-bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-icon svg path { fill: var(--color-text-on-dark); }
.header-icon svg circle { fill: var(--color-text-on-dark); }

.header-text h2 {
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 1.375rem;
  line-height: 1.36;
  color: var(--color-text);
  letter-spacing: 0;
}
.header-text p {
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  margin-top: 4px;
}

/* AI warning */
.ai-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 0.8125rem;
  line-height: 1.46;
  color: var(--color-text);
}
.ai-warning svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-text);
}

/* ── Messages list ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  background: var(--color-bg);
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--color-text); }

.message {
  max-width: 86%;
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 1rem;
  line-height: 1.5;
  word-wrap: break-word;
}

/* User → dark bubble, light text. Sharp. */
.message.user {
  align-self: flex-end;
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  padding: 14px 18px;
  border: 1px solid var(--color-rule);
  border-radius: 0;
  position: relative;
}
.message.user::before {
  content: attr(data-label, "Sie");
  position: absolute;
  top: -10px;
  right: 0;
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-on-dark);
  background: var(--color-bg-dark);
  padding: 0 6px;
}

/* Assistant → light bubble, dark border. */
.message.assistant {
  align-self: flex-start;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 16px 18px;
  border: 1px solid var(--color-rule);
  border-radius: 0;
  position: relative;
}
.message.assistant::before {
  content: "EQui-T Bot";
  position: absolute;
  top: -10px;
  left: 0;
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-on-dark);
  background: var(--color-bg-dark);
  padding: 0 8px;
}

.message.assistant p { margin-bottom: 10px; }
.message.assistant p:last-child { margin-bottom: 0; }
.message.assistant ul,
.message.assistant ol { margin: 6px 0 10px 22px; }
.message.assistant li { margin-bottom: 4px; }
.message.assistant strong {
  font-family: var(--font-bold);
  font-weight: var(--weight-bold);
  color: var(--color-text);
}

/* ── Sources ── */
.message-sources {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-rule);
  font-size: 0.875rem;
  color: var(--color-text);
}
.message-sources-label {
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text);
}
.message-sources-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: var(--weight-regular);
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
}
.source-chip:hover {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}
.source-chip:hover svg { stroke: var(--color-text-on-dark); }
.source-chip svg { flex-shrink: 0; stroke: var(--color-text); }

/* ── Feedback ── */
.message-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-rule);
}
.feedback-label {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-text);
  flex: 1;
}
.feedback-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  border-radius: 0;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: var(--weight-regular);
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.feedback-btn:hover {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}
.feedback-btn:hover svg path { stroke: var(--color-text-on-dark); }
.feedback-btn.active-positive,
.feedback-btn.active-negative {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  border-color: var(--color-rule);
}
.feedback-btn.active-positive svg path,
.feedback-btn.active-negative svg path { stroke: var(--color-text-on-dark); }

/* ── Error ── */
.message.error {
  align-self: center;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-rule);
  border-left: 6px solid var(--color-rule);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 12px 16px;
  border-radius: 0;
  max-width: 90%;
}

/* ── Typing indicator ── */
.typing-indicator {
  align-self: flex-start;
  display: none;
  gap: 6px;
  padding: 14px 18px;
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  border-radius: 0;
}
.typing-indicator.visible { display: flex; }
.typing-indicator span {
  width: 8px; height: 8px;
  background: var(--color-text);
  border-radius: 0;            /* square dots — strictly no rounding */
  animation: typingBounce 1.3s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0);   opacity: 0.25; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Input area ── */
.chat-input-area {
  padding: 20px 40px 28px;
  border-top: 1px solid var(--color-rule);
  background: var(--color-bg);
  flex-shrink: 0;
}

/* Field — Angular Material style: bottom rule only, light gray field bg */
.input-row {
  display: flex;
  gap: 0;
  align-items: stretch;
  background: var(--color-field-bg);
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  padding: 0;
  border-radius: 0;
}
.input-row:focus-within {
  outline: 2px solid var(--color-rule);
  outline-offset: 0;
}

.chat-input-area textarea {
  flex: 1;
  resize: none;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 52px;
  max-height: 160px;
  color: var(--color-text);
  outline: none;
  border-radius: 0;
}
.chat-input-area textarea::placeholder {
  color: var(--color-text);
  opacity: 0.55;
}

/* Send → dark square button, light arrow */
.send-btn {
  width: 56px;
  border: 0;
  border-left: 1px solid var(--color-rule);
  border-radius: 0;
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.send-btn:hover:not(:disabled) {
  background: var(--color-text-on-dark);
  color: var(--color-bg-dark);
}
.send-btn:hover:not(:disabled) svg path {
  fill: var(--color-bg-dark);
  stroke: var(--color-bg-dark);
}
.send-btn:active { opacity: 0.7; }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.send-btn svg path {
  fill: var(--color-text-on-dark);
  stroke: var(--color-text-on-dark);
}

/* Clear → secondary destructive square, same footprint as send */
.clear-btn {
  width: 56px;
  border: 0;
  border-left: 1px solid var(--color-rule);
  border-radius: 0;
  background: var(--color-field-bg);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.clear-btn:hover:not(:disabled) {
  background: var(--color-text);
  color: var(--color-field-bg);
  border-left-color: var(--color-field-bg);
}
.clear-btn:active   { opacity: 0.7; }
.clear-btn:disabled { opacity: 0.35; cursor: not-allowed; background: var(--color-field-bg); }

/* Clear confirmation modal */
.confirm-modal[hidden] { display: none; }
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.confirm-modal-content {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  padding: 24px 28px;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.confirm-modal-content h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold, 600);
  color: var(--color-text);
}
.confirm-modal-content p {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text);
}
.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 4px;
}
.confirm-modal-actions .btn-secondary,
.confirm-modal-actions .btn-danger {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 10px 20px;
  border-radius: 0;
  cursor: pointer;
  transition: opacity 0.12s, background 0.12s;
}
.confirm-modal-actions .btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-rule);
}
.confirm-modal-actions .btn-secondary:hover {
  background: var(--color-field-bg);
}
.confirm-modal-actions .btn-danger {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  border: 1px solid var(--color-bg-dark);
}
.confirm-modal-actions .btn-danger:hover {
  opacity: 0.85;
}

.input-hint {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-text);
  margin-top: 12px;
  text-align: left;
  letter-spacing: 0;
}

/* ── Welcome state ── */
.welcome-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  margin: 0 auto;
  padding: 24px 0 8px;
  width: 100%;
  max-width: 720px;
}

.welcome-icon { display: none; }   /* H2 + rule lead instead — matches site */

.welcome { text-align: left; color: var(--color-text); width: 100%; }
.welcome h2 {
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 2rem;
  line-height: 1.25;
  color: var(--color-text);
  margin-bottom: 12px;
}
.welcome p {
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  max-width: 560px;
}

.faq-label {
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text);
  border-top: 1px solid var(--color-rule);
  padding-top: 18px;
  width: 100%;
}

/* FAQ buttons */
.faq-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  border: 1px solid var(--color-rule);
  border-bottom: 0;
}

.faq-btn {
  background: var(--color-bg);
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  border-right: 1px solid var(--color-rule);
  padding: 22px 22px 26px;
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  min-height: 132px;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}
.faq-btn:nth-child(2n) { border-right: 0; }
.faq-btn::after {
  content: "→";
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 1.375rem;
  line-height: 1;
  color: var(--color-text);
  transition: transform 0.15s, color 0.15s;
}
.faq-btn:hover {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}
.faq-btn:hover::after {
  color: var(--color-text-on-dark);
  transform: translateX(4px);
}
.faq-btn:hover .faq-btn-icon { color: var(--color-text-on-dark); }

.faq-btn-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-text);
  stroke-width: 1.4;
}

/* Category eyebrow above each FAQ button text */
.faq-btn::before {
  content: attr(data-category);
  font-family: var(--font-xbold);
  font-weight: var(--weight-xbold);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: inherit;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .chat-header { padding: 22px 18px 18px; }
  .chat-messages { padding: 20px 18px; }
  .chat-input-area { padding: 16px 18px 22px; }
  .header-text h2 { font-size: 1.25rem; line-height: 1.4; }
  .welcome h2 { font-size: 1.625rem; line-height: 1.23; }
  .faq-buttons { grid-template-columns: 1fr; }
  .faq-btn,
  .faq-btn:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid var(--color-rule);
  }
}
