.contact-form ::placeholder {
  color: #555 !important;
  opacity: 1;
}

/* ==========================================================================
   DB-Mig Chatbot Widget
   ========================================================================== */

/* ── Variables ── */
:root {
  --chat-primary:       #0A3D62;
  --chat-secondary:     #1E90FF;
  --chat-bg:            #ffffff;
  --chat-surface:       #f4f7fb;
  --chat-border:        #e2e8f0;
  --chat-text:          #1a202c;
  --chat-text-muted:    #64748b;
  --chat-bot-bg:        #eef2f8;
  --chat-user-bg:       #0A3D62;
  --chat-user-text:     #ffffff;
  --chat-radius:        14px;
  --chat-shadow:        0 24px 64px rgba(10,61,98,.22), 0 4px 16px rgba(10,61,98,.1);
}

/* ── Floating Toggle Button ── */
.dbmig-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0A3D62 0%, #1E90FF 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(10,61,98,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
  padding: 0;
}
.dbmig-chat-toggle:hover,
.dbmig-chat-toggle:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(10,61,98,.55);
}
.dbmig-chat-toggle:focus-visible {
  outline: 3px solid #1E90FF;
  outline-offset: 3px;
}
.dbmig-chat-toggle svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  transition: opacity .15s ease, transform .2s ease;
  flex-shrink: 0;
}
.dbmig-chat-toggle .icon-close { display: none; }
.dbmig-chat-toggle.is-open .icon-chat  { display: none; }
.dbmig-chat-toggle.is-open .icon-close { display: block; }

/* Notification badge */
.dbmig-chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  background: #e53e3e;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  animation: dbmigBadgePulse 2.2s infinite ease-in-out;
  pointer-events: none;
}
@keyframes dbmigBadgePulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* ── Chat Panel ── */
.dbmig-chat-panel {
  position: fixed;
  bottom: 98px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(.97);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.dbmig-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header ── */
.dbmig-chat-header {
  background: linear-gradient(135deg, #0A3D62 0%, #0d5490 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.dbmig-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  border: 2px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dbmig-chat-avatar svg { width: 22px; height: 22px; fill: #fff; }
.dbmig-chat-header-info { flex: 1; min-width: 0; }
.dbmig-chat-header-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dbmig-chat-header-status {
  font-size: 12px;
  opacity: .85;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.dbmig-chat-header-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48bb78;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(72,187,120,.7);
}
.dbmig-chat-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.dbmig-chat-close-btn:hover,
.dbmig-chat-close-btn:focus-visible { color: #fff; background: rgba(255,255,255,.12); }
.dbmig-chat-close-btn:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 1px; }
.dbmig-chat-close-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Progress bar ── */
.dbmig-chat-progress {
  height: 3px;
  background: rgba(30,144,255,.15);
  flex-shrink: 0;
}
.dbmig-chat-progress-bar {
  height: 100%;
  background: var(--chat-secondary);
  transition: width .45s ease;
}

/* ── Messages ── */
.dbmig-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.dbmig-chat-messages::-webkit-scrollbar { width: 4px; }
.dbmig-chat-messages::-webkit-scrollbar-track { background: transparent; }
.dbmig-chat-messages::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 2px; }

/* Message bubbles */
.dbmig-msg {
  display: flex;
  flex-direction: column;
  max-width: 87%;
  animation: dbmigMsgIn .24s ease;
}
@keyframes dbmigMsgIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dbmig-msg.bot  { align-self: flex-start; align-items: flex-start; }
.dbmig-msg.user { align-self: flex-end;   align-items: flex-end; }
.dbmig-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.dbmig-msg.bot  .dbmig-msg-bubble {
  background: var(--chat-bot-bg);
  color: var(--chat-text);
  border-bottom-left-radius: 4px;
}
.dbmig-msg.user .dbmig-msg-bubble {
  background: var(--chat-user-bg);
  color: var(--chat-user-text);
  border-bottom-right-radius: 4px;
}
.dbmig-msg-bubble a.dbmig-inline-link {
  color: var(--chat-secondary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.dbmig-msg-bubble a.dbmig-inline-link:hover { text-decoration: underline; }

/* Typing indicator */
.dbmig-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 15px;
  background: var(--chat-bot-bg);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.dbmig-typing span {
  width: 7px;
  height: 7px;
  background: #93afc5;
  border-radius: 50%;
  animation: dbmigDot 1.3s infinite ease-in-out;
}
.dbmig-typing span:nth-child(2) { animation-delay: .18s; }
.dbmig-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes dbmigDot {
  0%,60%,100% { transform: translateY(0);    opacity: .45; }
  30%          { transform: translateY(-6px); opacity: 1;   }
}

/* ── Action area (options / inputs) ── */
.dbmig-chat-actions { flex-shrink: 0; }

.dbmig-chat-options {
  padding: 6px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dbmig-chat-option-btn {
  width: 100%;
  padding: 9px 13px;
  background: #fff;
  border: 1.5px solid var(--chat-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--chat-text);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1.4;
  font-family: inherit;
}
.dbmig-chat-option-btn:hover,
.dbmig-chat-option-btn:focus-visible {
  background: #eff6ff;
  border-color: var(--chat-secondary);
  color: var(--chat-primary);
}
.dbmig-chat-option-btn:focus-visible {
  outline: 2px solid var(--chat-secondary);
  outline-offset: 1px;
}

/* Input area */
.dbmig-chat-input-area {
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dbmig-chat-input-label {
  font-size: 11.5px;
  color: var(--chat-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dbmig-chat-input-row {
  display: flex;
  gap: 7px;
  align-items: center;
}
.dbmig-chat-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--chat-border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--chat-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  min-width: 0;
}
.dbmig-chat-input:focus {
  border-color: var(--chat-secondary);
  box-shadow: 0 0 0 3px rgba(30,144,255,.14);
}
.dbmig-chat-input.is-invalid {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229,62,62,.12);
}
.dbmig-chat-send-btn {
  padding: 9px 16px;
  background: var(--chat-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.dbmig-chat-send-btn:hover,
.dbmig-chat-send-btn:focus-visible { background: #0d5490; }
.dbmig-chat-send-btn:focus-visible {
  outline: 2px solid var(--chat-secondary);
  outline-offset: 2px;
}
.dbmig-chat-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--chat-border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--chat-text);
  background: #fff;
  resize: none;
  height: 76px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  box-sizing: border-box;
}
.dbmig-chat-textarea:focus {
  border-color: var(--chat-secondary);
  box-shadow: 0 0 0 3px rgba(30,144,255,.14);
}
.dbmig-skip-btn {
  background: none;
  border: none;
  color: var(--chat-text-muted);
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 0;
  font-family: inherit;
  text-align: left;
}
.dbmig-skip-btn:hover { color: var(--chat-text); }

/* ── Footer quick-links ── */
.dbmig-chat-footer {
  padding: 8px 14px 12px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  flex-shrink: 0;
  border-top: 1px solid var(--chat-border);
}
.dbmig-chat-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  line-height: 1;
}
.dbmig-chat-footer-btn svg { flex-shrink: 0; }
.dbmig-chat-footer-btn.wa      { background: #e8f5e9; color: #2e7d32; }
.dbmig-chat-footer-btn.wa:hover { background: #25D366; color: #fff; }
.dbmig-chat-footer-btn.contact      { background: #e8eaf6; color: var(--chat-primary); }
.dbmig-chat-footer-btn.contact:hover { background: var(--chat-primary); color: #fff; }
.dbmig-chat-footer-btn.restart      { background: var(--chat-surface); color: var(--chat-text-muted); margin-left: auto; }
.dbmig-chat-footer-btn.restart:hover { background: #dde3ec; color: var(--chat-text); }
.dbmig-chat-footer-btn:focus-visible {
  outline: 2px solid var(--chat-secondary);
  outline-offset: 2px;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .dbmig-chat-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 82px;
    max-height: calc(100vh - 100px);
  }
  .dbmig-chat-toggle {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }
}

/* WhatsApp link direto dentro de bolha de mensagem */
.dbmig-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 18px;
  background: #25D366;
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  transition: background .15s;
}
.dbmig-wa-btn:hover,
.dbmig-wa-btn:focus-visible {
  background: #1ea952;
  color: #fff !important;
  text-decoration: none !important;
}
.dbmig-wa-btn:focus-visible {
  outline: 2px solid #1ea952;
  outline-offset: 2px;
}

/* <a> usada como opção de botão (ex: WhatsApp direto no renderOptions) */
a.dbmig-chat-option-btn {
  display: block;
  text-decoration: none;
}
a.dbmig-chat-option-btn:hover,
a.dbmig-chat-option-btn:focus-visible {
  background: #e6f9ee;
  border-color: #25D366;
  color: #1a5c2e;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .dbmig-chat-panel,
  .dbmig-msg,
  .dbmig-chat-badge { animation: none; transition: opacity .1s; }
  .dbmig-typing span { animation: none; opacity: .6; }
}
