/* Blad IT Solutions — chat widget */
.blad-chat-root {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9990;
  font-family: inherit;
}

.blad-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blad-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.42);
}

.blad-chat-toggle i {
  font-size: 1.1rem;
}

.blad-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 6rem));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.blad-chat-panel[hidden] {
  display: none !important;
}

.blad-chat-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
}

.blad-chat-header p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  opacity: 0.9;
}

.blad-chat-close {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
}

.blad-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.blad-chat-msg {
  max-width: 88%;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.blad-chat-msg p {
  margin: 0;
}

.blad-chat-msg--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.blad-chat-msg--user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}

.blad-chat-msg--typing {
  align-self: flex-start;
  background: #e2e8f0;
  color: #475569;
  font-style: italic;
}

.blad-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.blad-chat-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  min-height: 2.5rem;
  max-height: 6rem;
}

.blad-chat-form textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: #2563eb;
}

.blad-chat-send {
  border: none;
  border-radius: 10px;
  width: 2.6rem;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.blad-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.blad-chat-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem 0.65rem;
  font-size: 0.78rem;
  color: #64748b;
  background: #fff;
}

.blad-chat-footer a {
  color: #2563eb;
  text-decoration: none;
}

.blad-chat-footer a:hover {
  text-decoration: underline;
}

.blad-chat-captcha,
.blad-chat-lead {
  padding: 0.65rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fffbeb;
}

.blad-chat-lead {
  background: #f0fdf4;
}

.blad-chat-captcha-label,
.blad-chat-lead-title {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
}

.blad-chat-lead-title {
  color: #166534;
}

.blad-chat-captcha-row input,
.blad-chat-lead input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  margin-bottom: 0.4rem;
}

.blad-chat-lead-submit {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 0.5rem;
  background: #059669;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.blad-chat-lead-submit:disabled {
  opacity: 0.6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .blad-chat-root {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .blad-chat-toggle-label {
    display: none;
  }

  .blad-chat-panel {
    width: calc(100vw - 1.5rem);
    height: min(70vh, 520px);
  }
}
