/* MagicPage Conversão — widget (premium light) */
#mpc-widget-root.mpc-root,
.mpc-root {
  --mpc-primary: #0f766e;
  --mpc-primary-deep: #115e59;
  --mpc-ink: #333333;
  --mpc-muted: #6b7280;
  --mpc-surface: #fbfbfc;
  --mpc-bg: #f7f8fa;
  --mpc-line: #e5e7eb;
  --mpc-radius: 18px;
  --mpc-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  left: auto !important;
  top: auto !important;
  z-index: 2147483000 !important;
  width: auto !important;
  max-width: calc(100vw - 24px);
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
  box-sizing: border-box;
}

.mpc-root.mpc-pos-bottom-left {
  right: auto !important;
  left: 20px !important;
}

.mpc-root > * {
  pointer-events: auto;
}

.mpc-root.mpc-hide-desktop {
  display: none !important;
}

@media (max-width: 768px) {
  .mpc-root.mpc-hide-mobile {
    display: none !important;
  }
  .mpc-root:not(.mpc-hide-mobile) {
    display: block !important;
  }
}

@media (min-width: 769px) {
  .mpc-root.mpc-hide-desktop {
    display: none !important;
  }
  .mpc-root:not(.mpc-hide-desktop) {
    display: block !important;
  }
}

.mpc-fab {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--mpc-primary), var(--mpc-primary-deep));
  color: #fff !important;
  border-radius: 999px;
  padding: 14px 18px;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
  transition: transform .18s ease, box-shadow .18s ease;
  line-height: 1.2;
  font-size: 14px;
}

.mpc-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.36);
}

.mpc-fab:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 3px;
}

.mpc-fab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.mpc-fab-icon svg {
  display: block;
  width: 28px;
  height: 28px;
}

.mpc-fab-text {
  font-weight: 600;
  font-size: 14px;
  color: inherit;
}

.mpc-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: min(360px, calc(100vw - 28px));
  height: min(540px, calc(100vh - 110px));
  background: var(--mpc-surface);
  border-radius: var(--mpc-radius);
  box-shadow: var(--mpc-shadow);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  animation: mpc-panel-in .18s ease;
}

@keyframes mpc-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

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

.mpc-panel:not([hidden]) {
  display: flex !important;
}

.mpc-pos-bottom-left .mpc-panel {
  right: auto;
  left: 0;
}

.mpc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, var(--mpc-primary), var(--mpc-primary-deep));
  color: #fff;
}

.mpc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mpc-header-text {
  flex: 1;
  min-width: 0;
}

.mpc-header-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.mpc-header-text span {
  display: block;
  font-size: 12px;
  opacity: 0.88;
}

.mpc-close {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 10px;
}

.mpc-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mpc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(500px 180px at 0% 0%, rgba(15, 118, 110, 0.05), transparent 60%),
    var(--mpc-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mpc-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mpc-bubble.bot {
  align-self: flex-start;
  background: #fff;
  color: var(--mpc-ink);
  border: 1px solid var(--mpc-line);
  border-bottom-left-radius: 4px;
}

.mpc-bubble.user {
  align-self: flex-end;
  background: var(--mpc-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.mpc-composer {
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--mpc-line);
}

.mpc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mpc-chip {
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: #fff;
  color: var(--mpc-primary);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: background .15s ease, transform .12s ease;
}

.mpc-chip:hover {
  background: rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}

.mpc-input-row {
  display: flex;
  gap: 8px;
}

.mpc-input,
.mpc-textarea {
  flex: 1;
  border: 1px solid var(--mpc-line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--mpc-ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.mpc-input:focus,
.mpc-textarea:focus {
  outline: none;
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.mpc-textarea {
  min-height: 72px;
  resize: vertical;
}

.mpc-send,
.mpc-btn {
  border: 0;
  background: var(--mpc-primary);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}

.mpc-send:hover,
.mpc-btn:hover {
  background: #0d9488;
}

.mpc-send:disabled,
.mpc-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mpc-btn.secondary {
  background: #fff;
  color: var(--mpc-primary);
  border: 1px solid rgba(15, 118, 110, 0.28);
}

.mpc-consent {
  display: flex;
  gap: 8px;
}

.mpc-done {
  display: grid;
  gap: 10px;
}

.mpc-wa-link {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
  background: #16a34a;
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
}

.mpc-helper {
  font-size: 12px;
  color: var(--mpc-muted);
  margin: 0 0 8px;
}

.mpc-error {
  font-size: 12px;
  color: #b42318;
  margin: 6px 0 0;
}

.mpc-input.is-invalid,
.mpc-textarea.is-invalid {
  border-color: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.1);
}

@media (max-width: 480px) {
  .mpc-root {
    bottom: 12px !important;
    right: 12px !important;
    left: 12px !important;
  }

  .mpc-root.mpc-pos-bottom-left {
    left: 12px !important;
    right: 12px !important;
  }

  .mpc-panel {
    width: 100%;
    right: 0;
    left: 0;
    bottom: 64px;
    height: min(72vh, 580px);
  }

  .mpc-fab {
    width: 100%;
    justify-content: center;
  }
}
