/* Fitz interaction motion: response to an action, never a prerequisite for it.
   Do not animate page shells, scroll positions, private photos, or long lists. */
:root {
  --fitz-motion-press: 100ms;
  --fitz-motion-fast: 120ms;
  --fitz-motion-normal: 180ms;
  --fitz-motion-progress: 240ms;
  --fitz-motion-ease: cubic-bezier(.2, 0, 0, 1);
}

@keyframes fitz-content-reveal {
  from { opacity: .55; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Primary actions get a small press response; layout and hit areas stay put. */
  html body :is(.btn,.button,.primary-button,.secondary-button,.signup-mode-submit,.admin-btn) {
    transition: background-color var(--fitz-motion-fast) ease,
      border-color var(--fitz-motion-fast) ease, color var(--fitz-motion-fast) ease,
      opacity var(--fitz-motion-fast) ease, scale var(--fitz-motion-press) var(--fitz-motion-ease) !important;
  }
  html body :is(.btn,.button,.primary-button,.secondary-button,.signup-mode-submit,.admin-btn):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):active {
    scale: .985;
  }

  /* Selection is signalled by the existing purple state, with a short colour change. */
  html body :is(.choice-square,.preference-chip,.fitz-mode-option,.documents-tab,.join-terms-tab,
    .district-chip,.selected-region-chip,.province-chip,.profile-region-chip,.profile-region-option,.fitz-select-option,
    .document-file-picker,.lm-stepper-button,.match-photo-arrow,.profile-height-wheel-option,
    .signup-height-option,.signup-education-option,.signup-simple-select-option),
  html body .ownership-share-presets button,
  html body .footer-nav a {
    transition: background-color var(--fitz-motion-fast) ease,
      border-color var(--fitz-motion-fast) ease, color var(--fitz-motion-fast) ease,
      opacity var(--fitz-motion-fast) ease !important;
  }

  /* Content enters on reveal only. Opacity avoids moving fixed children or focus targets. */
  html body :is(.documents-tab-panel,.education-detail-panel,.address-search-results,.area-candidate-results,
    .notification-panel):not([hidden]),
  html body .nav-admin-menu[open] > .nav-admin-links,
  html body .fitz-business-compact-details[open] > .fitz-business-details,
  html body .preference-details[open] > .preference-details-body,
  html body .profile-edit-toast:not([hidden]) {
    animation: fitz-content-reveal var(--fitz-motion-normal) var(--fitz-motion-ease);
  }
  html body .signup-onboarding-step.is-active :is(.signup-onboarding-copy h1,.signup-verified-summary,.signup-onboarding-fields),
  html body .join-terms-panel {
    animation: fitz-content-reveal var(--fitz-motion-normal) var(--fitz-motion-ease) !important;
  }

  /* Keep existing open/close transforms and JS timings; align their visual cadence. */
  html body :is(.fitz-select-dialog,.lm-dialog,.lm-toast,.signup-height-sheet,.signup-education-sheet,
    .signup-simple-select-sheet,.club-block-sheet-panel) {
    transition-duration: var(--fitz-motion-normal) !important;
    transition-timing-function: var(--fitz-motion-ease) !important;
  }
  html body :is(.profile-region-sheet,.region-picker-sheet,.join-terms-surface) {
    animation-duration: var(--fitz-motion-normal) !important;
    animation-timing-function: var(--fitz-motion-ease) !important;
  }
  html body :is(.fitz-select-trigger-chevron,.profile-region-chevron),
  html body #fitzBusinessFooter .fitz-business-summary::after {
    transition: transform var(--fitz-motion-normal) var(--fitz-motion-ease);
  }
  html body .signup-onboarding-progress span,
  html body .progress-bar {
    transition: width var(--fitz-motion-progress) var(--fitz-motion-ease);
  }
}

/* Applies to existing effects too, including standalone login/share/admin layouts. */
@media (prefers-reduced-motion: reduce) {
  html, html body *, html body *::before, html body *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}
