/* Aprova: carregar após styles.css. Movimento acompanha ações, sem mudar layout.
 * .point-item.motion-point = ponto recém-incluído; .motion-saved / .motion-error
 * = feedback opcional de resultado. Não aplicar motion-point à lista inteira.
 * Remover/reaplicar a classe permite novo feedback; nenhum efeito fica em loop.
 */

:is(.text-button, .textbutton, .primary-button, .primary, .secondary-button,
    .choice, .tool-button, .toolbutton, .close-button, .mark-toolbar button) {
  transition-property: transform, opacity;
  transition-duration: 100ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

:is(.text-button, .textbutton, .primary-button, .primary, .secondary-button,
    .choice, .tool-button, .toolbutton, .close-button, .mark-toolbar button):not(:disabled):active {
  transform: scale(0.98);
}

dialog[open] {
  animation: aprova-dialog-enter 180ms cubic-bezier(0.16, 1, 0.3, 1) 1;
}

.toast:not([hidden]) {
  animation: aprova-toast-enter 180ms cubic-bezier(0.16, 1, 0.3, 1) 1;
}

.point-item.motion-point {
  animation: aprova-point-enter 180ms cubic-bezier(0.16, 1, 0.3, 1) 1;
}

.motion-saved {
  animation: aprova-saved 150ms cubic-bezier(0.16, 1, 0.3, 1) 1;
}

.motion-error {
  animation: aprova-error 150ms cubic-bezier(0.4, 0, 0.2, 1) 1;
}

@keyframes aprova-dialog-enter {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes aprova-toast-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes aprova-point-enter {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes aprova-saved {
  from { opacity: 0.55; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes aprova-error {
  0% { opacity: 0.7; transform: translateX(0); }
  35% { opacity: 1; transform: translateX(-3px); }
  70% { opacity: 1; transform: translateX(3px); }
  100% { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  :is(.text-button, .textbutton, .primary-button, .primary, .secondary-button,
      .choice, .tool-button, .toolbutton, .close-button, .mark-toolbar button) {
    transition-duration: 0s !important;
  }

  :is(.text-button, .textbutton, .primary-button, .primary, .secondary-button,
      .choice, .tool-button, .toolbutton, .close-button, .mark-toolbar button):not(:disabled):active {
    transform: none !important;
  }

  dialog[open], .toast:not([hidden]), .point-item.motion-point,
  .motion-saved, .motion-error {
    animation: none !important;
    transition-duration: 0s !important;
  }
}
