/* Feedback FAB — bottom-right; bottom margin matches right */
.feedback-fab-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-fab {
  width: 3.25rem;
  height: 3.25rem;
  min-width: 3.25rem;
  min-height: 3.25rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--fab-grad, linear-gradient(135deg, var(--brand-secondary, #ff9933), var(--brand-primary, #663399)));
  color: var(--text-on-brand, #fff);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--brand-secondary, #ff9933) 40%, transparent);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .15s, box-shadow .15s, background .15s;
  font: inherit;
  line-height: 1;
  flex-shrink: 0;
}

.feedback-fab:hover,
.feedback-fab:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--brand-secondary, #ff9933) 50%, transparent);
}

.feedback-fab-icon {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
}

body.feedback-modal-open {
  overflow: hidden;
}

.feedback-modal[hidden] {
  display: none !important;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.feedback-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.feedback-modal__panel {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface, #fff);
  color: var(--text, #1a1a2e);
  border: 1px solid var(--border, #d8dee9);
  border-radius: var(--radius, 12px);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, .06),
    0 16px 48px rgba(0, 0, 0, .14);
  overflow: hidden;
}

[data-theme="dark"] .feedback-modal__panel {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, .25),
    0 16px 48px rgba(0, 0, 0, .45);
}

.feedback-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #d8dee9);
  background: var(--modal-head-bg, var(--bg-surface, #fff));
  flex-shrink: 0;
}

.feedback-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-primary, #663399);
}

.feedback-modal__close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  opacity: .7;
}

.feedback-modal__close:hover,
.feedback-modal__close:focus-visible {
  opacity: 1;
  background: var(--hover-tint, rgba(102, 51, 153, 0.08));
}

.feedback-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.feedback-modal__body {
  padding: 8px 16px 12px;
  overflow-y: auto;
  flex: 0 1 auto;
  min-height: 0;
}

.feedback-modal__form label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text, inherit);
}

.feedback-modal__form label:first-child {
  margin-top: 0;
}

.feedback-modal__form select,
.feedback-modal__form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #d8dee9);
  background: var(--bg-app, #eef2f7);
  color: var(--text, inherit);
  font-size: 14px;
  box-sizing: border-box;
}

.feedback-modal__form select:focus-visible,
.feedback-modal__form textarea:focus-visible {
  outline: none;
  border-color: var(--brand-primary, #663399);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #663399) 22%, transparent);
}

.feedback-tipo-desc {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted, inherit);
  opacity: .9;
}

.feedback-contexto {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--hover-tint, rgba(102, 51, 153, 0.05));
  border: 1px solid var(--border, #d8dee9);
}

.feedback-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.feedback-contexto-resumo {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, inherit);
}

.feedback-contexto-resumo dt {
  font-weight: 600;
  margin-top: 4px;
  color: var(--text, inherit);
}

.feedback-contexto-resumo dd {
  margin: 0 0 4px;
  word-break: break-all;
}

.feedback-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.feedback-alert--success {
  background: color-mix(in srgb, var(--accent-blue, #00b4d8) 12%, transparent);
  border: 1px solid var(--border, #d8dee9);
  color: var(--text, inherit);
}

.feedback-alert--error {
  background: rgba(220, 53, 69, 0.12);
  color: var(--text, #842029);
  border: 1px solid rgba(220, 53, 69, 0.25);
}

[data-theme="dark"] .feedback-alert--error {
  color: #f5c2c7;
}

.feedback-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border, #d8dee9);
  flex-shrink: 0;
}

.feedback-modal__btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.25;
}

.feedback-modal__btn--ghost {
  border: 1px solid var(--border, #d8dee9);
  background: transparent;
  color: inherit;
}

.feedback-modal__btn--ghost:hover,
.feedback-modal__btn--ghost:focus-visible {
  background: var(--hover-tint, rgba(102, 51, 153, 0.08));
}

.feedback-modal__btn--primary {
  border: none;
  background: var(--fab-grad, linear-gradient(135deg, var(--brand-primary, #663399), var(--brand-secondary, #ff9933)));
  color: var(--text-on-brand, #fff);
}

.feedback-modal__btn--primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 640px) {
  .feedback-fab-wrap {
    bottom: 16px;
    right: 16px;
  }
}
