/**
 * iaJudice Feedback Widget Standalone CSS (Camaleão White-Label)
 * Suporte nativo a cores do destino via CSS Variables: var(--ia-fb-primary)
 */

.ia-fb-overlay-ignore {
  /* Marcação para ignorar na captura do html2canvas */
}

#ia-fb-widget-modal {
  --ia-fb-primary: #19253A;
  position: fixed;
  z-index: 999999;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #FFFFFF;
  border: 1px solid #E0DCD3;
  border-radius: 16px;
  box-shadow: 0 20px 30px -10px rgba(25, 37, 58, 0.25), 0 0 1px 1px rgba(25, 37, 58, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #19253A;
  box-sizing: border-box;
  overflow: hidden;
  animation: iaFbFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes iaFbFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#ia-fb-widget-modal * {
  box-sizing: border-box;
}

/* Header */
.ia-fb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #FAF9F7;
  border-bottom: 1px solid #E0DCD3;
}

.ia-fb-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #19253A;
  letter-spacing: -0.01em;
}

.ia-fb-header-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(25, 37, 58, 0.08);
  color: var(--ia-fb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ia-fb-header-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  display: inline-block;
}

.ia-fb-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #8C827A;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ia-fb-close-btn:hover {
  background: rgba(25, 37, 58, 0.06);
  color: #19253A;
}

/* Body */
.ia-fb-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bloco da Evidência de 130px */
.ia-fb-preview-box {
  background: #FAF9F7;
  border: 1px solid #E0DCD3;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ia-fb-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.ia-fb-preview-title {
  font-weight: 600;
  color: #19253A;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ia-fb-preview-title svg {
  color: var(--ia-fb-primary);
}

.ia-fb-preview-coords {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ia-fb-primary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.ia-fb-preview-img-wrapper {
  position: relative;
  width: 100%;
  height: 128px;
  border-radius: 8px;
  overflow: hidden;
  background: #0F172A;
  border: 1px solid #E0DCD3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ia-fb-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ia-fb-preview-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  padding: 6px 8px 4px;
  pointer-events: none;
}

.ia-fb-preview-loading {
  width: 100%;
  height: 128px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px dashed #E0DCD3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #6B7280;
  font-size: 11px;
}

/* Spinner */
.ia-fb-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--ia-fb-primary);
  border-radius: 50%;
  animation: iaFbSpin 0.7s linear infinite;
}

@keyframes iaFbSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Formulário */
.ia-fb-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #19253A;
  margin-bottom: 6px;
}

.ia-fb-textarea {
  width: 100%;
  height: 84px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  background: #FAF9F7;
  border: 1px solid #E0DCD3;
  border-radius: 10px;
  color: #19253A;
  outline: none;
  resize: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.ia-fb-textarea:focus {
  background: #FFFFFF;
  border-color: var(--ia-fb-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.ia-fb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.ia-fb-hint {
  font-size: 11px;
  color: #9CA3AF;
}

.ia-fb-submit-btn {
  background: var(--ia-fb-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ia-fb-submit-btn:hover {
  filter: brightness(1.1);
}

.ia-fb-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tela de Sucesso */
.ia-fb-success-view {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  animation: iaFbFadeIn 0.3s ease;
}

.ia-fb-success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--ia-fb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ia-fb-success-title {
  font-size: 14px;
  font-weight: 700;
  color: #19253A;
  margin: 0;
}

.ia-fb-success-desc {
  font-size: 12px;
  color: #6B7280;
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}

.ia-fb-success-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ia-fb-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
